twx-linux/include/uapi/linux
Yonghong Song 492e639f0c bpf: Add bpf_seq_printf and bpf_seq_write helpers
Two helpers bpf_seq_printf and bpf_seq_write, are added for
writing data to the seq_file buffer.

bpf_seq_printf supports common format string flag/width/type
fields so at least I can get identical results for
netlink and ipv6_route targets.

For bpf_seq_printf and bpf_seq_write, return value -EOVERFLOW
specifically indicates a write failure due to overflow, which
means the object will be repeated in the next bpf invocation
if object collection stays the same. Note that if the object
collection is changed, depending how collection traversal is
done, even if the object still in the collection, it may not
be visited.

For bpf_seq_printf, format %s, %p{i,I}{4,6} needs to
read kernel memory. Reading kernel memory may fail in
the following two cases:
  - invalid kernel address, or
  - valid kernel address but requiring a major fault
If reading kernel memory failed, the %s string will be
an empty string and %p{i,I}{4,6} will be all 0.
Not returning error to bpf program is consistent with
what bpf_trace_printk() does for now.

bpf_seq_printf may return -EBUSY meaning that internal percpu
buffer for memory copy of strings or other pointees is
not available. Bpf program can return 1 to indicate it
wants the same object to be repeated. Right now, this should not
happen on no-RT kernels since migrate_disable(), which guards
bpf prog call, calls preempt_disable().

Signed-off-by: Yonghong Song <yhs@fb.com>
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Acked-by: Andrii Nakryiko <andriin@fb.com>
Link: https://lore.kernel.org/bpf/20200509175914.2476661-1-yhs@fb.com
2020-05-09 17:05:26 -07:00
..
android
byteorder
caif
can can: don't use deprecated license identifiers 2019-11-05 12:44:34 +01:00
cifs
dvb
genwqe
hdlc wan/hdlc_x25: make lapb params configurable 2020-01-21 11:41:36 +01:00
hsi
iio
isdn
mmc mmc: Replace zero-length array with flexible-array member 2020-03-24 14:39:45 +01:00
netfilter netfilter: nft_nat: add netmap support 2020-04-28 00:53:54 +02:00
netfilter_arp net, uapi: fix -Wpointer-arith warnings 2019-10-04 14:25:17 -07:00
netfilter_bridge netfilter: Replace zero-length array with flexible-array member 2020-03-15 15:20:16 +01:00
netfilter_ipv4 net, uapi: fix -Wpointer-arith warnings 2019-10-04 14:25:17 -07:00
netfilter_ipv6 net, uapi: fix -Wpointer-arith warnings 2019-10-04 14:25:17 -07:00
nfsd
raid
sched
spi
sunrpc
tc_act net: qos: introduce a gate control flow action 2020-05-01 16:08:19 -07:00
tc_ematch
usb usb: raw_gadget: fix compilation warnings in uapi headers 2020-03-17 16:04:49 +01:00
wimax
a.out.h
acct.h acct: stop using get_seconds() 2019-12-18 18:07:31 +01:00
adb.h
adfs_fs.h
affs_hardblocks.h
agpgart.h
aio_abi.h
am437x-vpfe.h
apm_bios.h
arcfb.h
arm_sdei.h
aspeed-lpc-ctrl.h
aspeed-p2a-ctrl.h
atalk.h
atm_eni.h
atm_he.h
atm_idt77105.h
atm_nicstar.h
atm_tcp.h
atm_zatm.h
atm.h
atmapi.h
atmarp.h
atmbr2684.h
atmclip.h
atmdev.h
atmioc.h
atmlec.h
atmmpc.h
atmppp.h
atmsap.h
atmsvc.h
audit.h bpf: Emit audit messages upon successful prog load and unload 2019-12-11 17:41:09 +01:00
auto_dev-ioctl.h
auto_fs4.h
auto_fs.h
auxvec.h
ax25.h
batadv_packet.h batman-adv: Update copyright years for 2020 2020-01-01 00:00:33 +01:00
batman_adv.h batman-adv: Update copyright years for 2020 2020-01-01 00:00:33 +01:00
baycom.h
bcache.h bcache: use read_cache_page_gfp to read the superblock 2020-01-23 11:40:01 -07:00
bcm933xx_hcs.h
bfs_fs.h
binfmts.h
blkpg.h
blktrace_api.h
blkzoned.h block: add zone open, close and finish ioctl support 2019-11-07 06:31:50 -07:00
bpf_common.h
bpf_perf_event.h
bpf.h bpf: Add bpf_seq_printf and bpf_seq_write helpers 2020-05-09 17:05:26 -07:00
bpfilter.h
bpqether.h
bsg.h
bt-bmc.h
btf.h bpf: Introduce function-by-function verification 2020-01-10 17:20:07 +01:00
btrfs_tree.h btrfs: add support for 4-copy replication (raid1c4) 2019-11-18 17:51:49 +01:00
btrfs.h btrfs: re-instantiate the removed BTRFS_SUBVOL_CREATE_ASYNC definition 2020-04-10 18:48:27 +02:00
can.h can: don't use deprecated license identifiers 2019-11-05 12:44:34 +01:00
capability.h capabilities: Introduce CAP_PERFMON to kernel and user space 2020-04-16 12:19:06 -03:00
capi.h
cciss_defs.h
cciss_ioctl.h
cdrom.h
cec-funcs.h media: cec-funcs.h: use new CEC_OP_UI_CMD defines 2019-10-07 07:55:17 -03:00
cec.h media: cec: expose the new connector info API 2019-10-01 17:19:41 -03:00
cgroupstats.h
chio.h scsi: ch: add include guard to chio.h 2019-10-09 22:31:14 -04:00
cm4000_cs.h
cn_proc.h
coda.h
coff.h
connector.h
const.h
coresight-stm.h coresight: do not use the BIT() macro in the UAPI header 2020-03-26 15:10:44 +01:00
cramfs_fs.h
cryptouser.h
cuda.h
cyclades.h y2038: uapi: change __kernel_time_t to __kernel_old_time_t 2019-11-15 14:38:29 +01:00
cycx_cfm.h
dcbnl.h net: Fix misspellings of "configure" and "configuration" 2019-10-28 13:41:01 -07:00
dccp.h
devlink.h devlink: Add packet trap policers support 2020-03-30 17:54:58 -07:00
dlm_device.h uapi: linux: dlm_device.h: Replace zero-length array with flexible-array member 2020-04-18 15:44:56 -05:00
dlm_netlink.h
dlm_plock.h
dlm.h
dlmconstants.h
dm-ioctl.h dm: bump version of core and various targets 2020-03-03 11:10:21 -05:00
dm-log-userspace.h
dma-buf.h
dma-heap.h dma-buf: heaps: Use _IOCTL_ for userspace IOCTL identifier 2019-12-17 21:37:40 +05:30
dn.h
dns_resolver.h
dqblk_xfs.h
edd.h
efs_fs_sb.h
elf-em.h
elf-fdpic.h
elf.h
elfcore.h y2038: elfcore: Use __kernel_old_timeval for process times 2019-11-15 14:38:29 +01:00
errno.h
errqueue.h docs: networking: convert timestamping.txt to ReST 2020-04-30 12:56:38 -07:00
erspan.h
ethtool_netlink.h ethtool: provide timestamping information with TSINFO_GET request 2020-03-29 22:32:37 -07:00
ethtool.h ethtool: add timestamping related string sets 2020-03-29 22:32:36 -07:00
eventpoll.h
fadvise.h
falloc.h
fanotify.h fanotify: report name info for FAN_DIR_MODIFY event 2020-03-25 23:17:16 +01:00
fb.h
fcntl.h open: introduce openat2(2) syscall 2020-01-18 09:19:18 -05:00
fd.h
fdreg.h floppy: separate the FDC's base address from its registers 2020-03-16 08:26:58 -06:00
fib_rules.h
fiemap.h uapi: linux: fiemap.h: Replace zero-length array with flexible-array member 2020-04-18 15:44:56 -05:00
filter.h
firewire-cdev.h
firewire-constants.h
fou.h
fpga-dfl.h
fs.h
fscrypt.h fscrypt: add FS_IOC_GET_ENCRYPTION_NONCE ioctl 2020-03-19 21:56:54 -07:00
fsi.h
fsl_hypervisor.h
fsmap.h
fsverity.h
fuse.h fuse: Add changelog entries for protocols 7.1 - 7.8 2019-10-23 14:26:37 +02:00
futex.h
gameport.h
gen_stats.h net_sched: add TCA_STATS_PKT64 attribute 2019-11-05 18:20:55 -08:00
genetlink.h netlink: add infrastructure to expose policies to userspace 2020-04-30 17:51:42 -07:00
gfs2_ondisk.h
gpio.h gpio: uapi: Improve phrasing around arrays representing empty strings 2020-03-25 09:50:44 +01:00
gsmmux.h
gtp.h
hash_info.h
hdlc.h
hdlcdrv.h
hdreg.h
hid.h
hiddev.h
hidraw.h HID: hidraw: add support uniq ioctl 2019-12-11 15:31:52 +01:00
hpet.h
hsr_netlink.h
hw_breakpoint.h
hyperv.h
i2c-dev.h
i2c.h
i2o-dev.h
i8k.h
icmp.h
icmpv6.h
idxd.h dmaengine: idxd: Merge definition of dsa_batch_desc into dsa_hw_desc 2020-03-11 15:08:52 +05:30
if_addr.h
if_addrlabel.h
if_alg.h
if_arcnet.h arcnet: Replace zero-length array with flexible-array member 2020-02-29 21:52:20 -08:00
if_arp.h
if_bonding.h bonding: rename AD_STATE_* to LACP_STATE_* 2019-12-26 13:09:37 -08:00
if_bridge.h bridge: uapi: mrp: Add mrp attributes. 2020-04-27 11:40:25 -07:00
if_cablemodem.h
if_eql.h
if_ether.h bridge: uapi: mrp: Add mrp attributes. 2020-04-27 11:40:25 -07:00
if_fc.h
if_fddi.h
if_frad.h
if_hippi.h
if_infiniband.h
if_link.h net: bridge: Add port attribute IFLA_BRPORT_MRP_RING_OPEN 2020-04-27 11:40:25 -07:00
if_ltalk.h
if_macsec.h macsec: Netlink support of XPN cipher suites (IEEE 802.1AEbw) 2020-03-16 01:42:31 -07:00
if_packet.h
if_phonet.h
if_plip.h
if_ppp.h
if_pppol2tp.h
if_pppox.h
if_slip.h
if_team.h
if_tun.h
if_tunnel.h
if_vlan.h
if_x25.h docs: networking: convert x25-iface.txt to ReST 2020-05-01 12:24:40 -07:00
if_xdp.h
if.h net: Add IF_OPER_TESTING 2020-04-20 12:43:24 -07:00
ife.h
igmp.h
ila.h
in6.h
in_route.h
in.h seg6: fix SRv6 L2 tunnels to use IANA-assigned protocol number 2020-03-11 23:49:30 -07:00
inet_diag.h inet_diag: add support for cgroup filter 2020-04-30 12:54:02 -07:00
inotify.h
input-event-codes.h Merge branch 'next' into for-linus 2020-04-06 20:56:50 -07:00
input.h Input: input_event - fix struct padding on sparc64 2019-12-13 15:00:36 -08:00
io_uring.h io_uring: make spdxcheck.py happy 2020-03-21 14:03:46 -06:00
ioctl.h
iommu.h iommu: Introduce guest PASID bind function 2019-10-15 13:34:43 +02:00
ip6_tunnel.h
ip_vs.h
ip.h
ipc.h
ipmi_bmc.h
ipmi_msgdefs.h
ipmi.h
ipsec.h
ipv6_route.h
ipv6.h net: ipv6: add support for rpl sr exthdr 2020-03-29 22:30:57 -07:00
ipx.h
irqnr.h
iso_fs.h
isst_if.h
ivtv.h
ivtvfb.h
jffs2.h
joystick.h
kcm.h
kcmp.h
kcov.h kcov: fix struct layout for kcov_remote_arg 2020-01-04 13:55:09 -08:00
kd.h
kdev_t.h
kernel-page-flags.h
kernel.h
kernelcapi.h
kexec.h
keyboard.h
keyctl.h
kfd_ioctl.h
kvm_para.h
kvm.h KVM: PPC: Book3S HV: Add a capability for enabling secure guests 2020-03-26 11:09:04 +11:00
l2tp.h
libc-compat.h
lightnvm.h
limits.h
lirc.h
llc.h
loop.h
lp.h
lwtunnel.h net: ipv6: add rpl sr tunnel 2020-03-29 22:30:57 -07:00
magic.h fs: New zonefs file system 2020-02-07 14:39:38 +09:00
major.h
map_to_7segment.h
matroxfb.h
max2175.h
mdio.h
media-bus-format.h media: v4l: Add 1X14 14-bit greyscale media bus code definition 2020-03-20 09:01:16 +01:00
media.h
mei.h
membarrier.h
memfd.h
mempolicy.h
meye.h
mic_common.h
mic_ioctl.h
mii.h net: phylink: pcs: add 802.3 clause 22 helpers 2020-03-17 22:51:16 -07:00
minix_fs.h
mman.h mm/mremap: add MREMAP_DONTUNMAP to mremap() 2020-04-02 09:35:30 -07:00
mmtimer.h
module.h
mount.h
mpls_iptunnel.h
mpls.h
mptcp.h mptcp: add netlink-based PM 2020-03-29 22:14:49 -07:00
mqueue.h
mroute6.h
mroute.h
mrp_bridge.h bridge: uapi: mrp: Add mrp attributes. 2020-04-27 11:40:25 -07:00
msdos_fs.h
msg.h y2038: uapi: change __kernel_time_t to __kernel_old_time_t 2019-11-15 14:38:29 +01:00
mtio.h
n_r3964.h
nbd-netlink.h
nbd.h
ncsi.h
ndctl.h
neighbour.h
net_dropmon.h drop_monitor: Replace zero-length array with flexible-array member 2020-03-02 11:16:28 -08:00
net_namespace.h
net_tstamp.h ethtool: add timestamping related string sets 2020-03-29 22:32:36 -07:00
net.h
netconf.h
netdevice.h
netfilter_arp.h
netfilter_bridge.h
netfilter_decnet.h
netfilter_ipv4.h
netfilter_ipv6.h
netfilter.h netfilter: revert introduction of egress hook 2020-03-18 16:35:48 -07:00
netlink_diag.h
netlink.h netlink: add infrastructure to expose policies to userspace 2020-04-30 17:51:42 -07:00
netrom.h
nexthop.h
nfc.h
nfs2.h
nfs3.h
nfs4_mount.h
nfs4.h
nfs_fs.h
nfs_idmap.h
nfs_mount.h
nfs.h
nfsacl.h
nilfs2_api.h
nilfs2_ondisk.h
nl80211.h cfg80211: Configure PMK lifetime and reauth threshold for PMKSA entries 2020-03-20 14:42:20 +01:00
nsfs.h
nubus.h
nvme_ioctl.h nvme: change nvme_passthru_cmd64 to explicitly mark rsvd 2019-11-06 06:17:38 +09:00
nvram.h
omap3isp.h
omapfb.h
oom.h
openat2.h open: introduce openat2(2) syscall 2020-01-18 09:19:18 -05:00
openvswitch.h openvswitch: add TTL decrement action 2020-02-16 19:34:44 -08:00
packet_diag.h
param.h
parport.h
patchkey.h
pci_regs.h PCI: pciehp: Disable in-band presence detect when possible 2020-02-20 22:44:30 -06:00
pci.h
pcitest.h misc: pci_endpoint_test: Add ioctl to clear IRQ 2020-04-02 17:57:10 +01:00
perf_event.h perf/core: Add PERF_SAMPLE_CGROUP feature 2020-03-27 10:41:44 -03:00
personality.h
pfkeyv2.h
pg.h block: pg: add header include guard 2019-10-02 20:32:27 -06:00
phantom.h
phonet.h
pkt_cls.h net: qos: introduce a gate control flow action 2020-05-01 16:08:19 -07:00
pkt_sched.h taprio: do not use BIT() in TCA_TAPRIO_ATTR_FLAG_* definitions 2020-03-26 20:08:45 -07:00
pktcdvd.h
pmu.h
poll.h
posix_acl_xattr.h
posix_acl.h
posix_types.h
ppdev.h
ppp_defs.h y2038: syscall implementation cleanups 2019-12-01 14:00:59 -08:00
ppp-comp.h
ppp-ioctl.h compat_ioctl: handle PPPIOCGIDLE for 64-bit time_t 2019-10-23 17:23:47 +02:00
pps.h
pr.h
prctl.h prctl: PR_{G,S}ET_IO_FLUSHER to support controlling memory reclaim 2020-01-28 10:09:51 +01:00
psample.h
psci.h
psp-sev.h crypto: ccp - Retry SEV INIT command in case of integrity check failure. 2019-10-26 02:09:58 +11:00
ptp_clock.h ptp: Add adjust_phase to ptp_clock_caps capability. 2020-05-02 16:31:45 -07:00
ptrace.h
qemu_fw_cfg.h
qnx4_fs.h
qnxtypes.h
qrtr.h
quota.h
radeonfb.h
random.h random: ignore GRND_RANDOM in getentropy(2) 2020-01-07 16:07:01 -05:00
raw.h
rds.h
reboot.h
reiserfs_fs.h
reiserfs_xattr.h
resource.h y2038: rusage: use __kernel_old_timeval 2019-11-15 14:38:29 +01:00
rfkill.h
rio_cm_cdev.h
rio_mport_cdev.h
romfs_fs.h
rose.h
route.h
rpl_iptunnel.h net: ipv6: add rpl sr tunnel 2020-03-29 22:30:57 -07:00
rpl.h include: uapi: linux: add rpl sr header definition 2020-03-29 22:30:57 -07:00
rpmsg.h
rseq.h
rtc.h rtc: make definitions in include/uapi/linux/rtc.h actually useful for user space 2020-03-26 21:38:40 +01:00
rtnetlink.h net: bridge: vlan: add rtnetlink group and notify support 2020-01-15 13:48:18 +01:00
rxrpc.h
scc.h linux/scc.h: make uapi linux/scc.h self-contained 2019-12-04 19:44:12 -08:00
sched.h clone3: allow spawning processes into cgroups 2020-02-12 17:57:51 -05:00
scif_ioctl.h
screen_info.h
sctp.h sctp: add SCTP_PEER_ADDR_THLDS_V2 sockopt 2019-11-08 14:18:32 -08:00
sdla.h
seccomp.h seccomp: allow TSYNC and USER_NOTIF together 2020-03-04 14:48:54 -08:00
securebits.h
sed-opal.h block: sed-opal: Add support to read/write opal tables generically 2019-11-04 07:11:31 -07:00
seg6_genl.h
seg6_hmac.h
seg6_iptunnel.h
seg6_local.h
seg6.h
selinux_netlink.h
sem.h y2038: uapi: change __kernel_time_t to __kernel_old_time_t 2019-11-15 14:38:29 +01:00
serial_core.h serial: fsl_linflexuart: Be consistent with the name 2019-10-16 06:11:24 -07:00
serial_reg.h
serial.h
serio.h Input: avoid BIT() macro usage in the serio.h UAPI header 2020-03-24 15:59:34 -07:00
shm.h y2038: uapi: change __kernel_time_t to __kernel_old_time_t 2019-11-15 14:38:29 +01:00
signal.h
signalfd.h
smc_diag.h
smc.h
smiapp.h
snmp.h tcp: export count for rehash attempts 2020-01-26 15:28:47 +01:00
sock_diag.h bpf: INET_DIAG support in bpf_sk_storage 2020-02-27 18:50:19 -08:00
socket.h
sockios.h
sonet.h
sonypi.h
sound.h
soundcard.h
stat.h statx: define STATX_ATTR_VERITY 2019-11-13 12:15:34 -08:00
stddef.h
stm.h
string.h
suspend_ioctls.h
swab.h include/uapi/linux/swab.h: fix userspace breakage, use __BITS_PER_LONG for swap 2020-02-21 11:22:15 -08:00
switchtec_ioctl.h PCI/switchtec: Add Gen4 flash information interface support 2020-01-15 11:00:39 -06:00
sync_file.h
synclink.h
sysctl.h mm: fix comments related to node reclaim 2020-01-31 10:30:39 -08:00
sysinfo.h
target_core_user.h
taskstats.h tsacct: add 64-bit btime field 2019-12-18 18:07:31 +01:00
tcp_metrics.h
tcp.h tcp: add bytes not sent to SCM_TIMESTAMPING_OPT_STATS 2020-03-09 17:56:33 -07:00
tee.h tee: add AMD-TEE driver 2020-01-04 13:49:51 +08:00
termios.h
thermal.h
time_types.h y2038: rename itimerval to __kernel_old_itimerval 2019-12-18 18:07:33 +01:00
time.h y2038: hide timeval/timespec/itimerval/itimerspec types 2020-02-21 11:22:15 -08:00
timerfd.h
times.h
timex.h y2038: sparc: remove use of struct timex 2019-12-18 18:07:33 +01:00
tiocl.h
tipc_config.h net, uapi: fix -Wpointer-arith warnings 2019-10-04 14:25:17 -07:00
tipc_netlink.h tipc: make legacy address flag readable over netlink 2019-12-20 21:18:42 -08:00
tipc_sockets_diag.h
tipc.h tipc: add new AEAD key structure for user API 2019-11-08 14:01:59 -08:00
tls.h
toshiba.h
tty_flags.h
tty.h
types.h
udf_fs_i.h
udmabuf.h
udp.h xfrm: add espintcp (RFC 8229) 2019-12-09 09:59:07 +01:00
uhid.h
uinput.h
uio.h
uleds.h
ultrasound.h
um_timetravel.h um: Implement time-travel=ext 2020-03-29 23:29:08 +02:00
un.h
unistd.h
unix_diag.h
usbdevice_fs.h
usbip.h
userfaultfd.h userfaultfd: wp: enabled write protection in userfaultfd API 2020-04-07 10:43:39 -07:00
userio.h
utime.h y2038: uapi: change __kernel_time_t to __kernel_old_time_t 2019-11-15 14:38:29 +01:00
utsname.h
uuid.h
uvcvideo.h
v4l2-common.h
v4l2-controls.h media: atmel: atmel-isc-base: expose white balance as v4l2 controls 2020-02-24 16:12:28 +01:00
v4l2-dv-timings.h
v4l2-mediabus.h
v4l2-subdev.h
vbox_err.h
vbox_vmmdev_types.h
vboxguest.h
veth.h
vfio_ccw.h
vfio.h vfio: Introduce VFIO_DEVICE_FEATURE ioctl and first user 2020-03-24 09:28:27 -06:00
vhost_types.h vhost: introduce vDPA-based backend 2020-04-02 10:41:40 -04:00
vhost.h vhost: introduce vDPA-based backend 2020-04-02 10:41:40 -04:00
videodev2.h media: v4l: Add 14-bit raw greyscale pixel format 2020-03-20 09:00:56 +01:00
virtio_9p.h
virtio_balloon.h virtio-balloon: Avoid using the word 'report' when referring to free page hinting 2020-04-17 06:05:30 -04:00
virtio_blk.h
virtio_config.h
virtio_console.h
virtio_crypto.h
virtio_fs.h
virtio_gpu.h
virtio_ids.h mac80211_hwsim: add frame transmission support over virtio 2020-03-20 14:42:19 +01:00
virtio_input.h
virtio_iommu.h iommu/virtio: Fix sparse warning 2020-03-27 11:09:18 +01:00
virtio_mmio.h
virtio_net.h virtio-net: Introduce hash report feature 2020-03-23 09:50:02 -04:00
virtio_pci.h
virtio_pmem.h
virtio_ring.h net, uapi: fix -Wpointer-arith warnings 2019-10-04 14:25:17 -07:00
virtio_rng.h
virtio_scsi.h
virtio_types.h
virtio_vsock.h
vm_sockets_diag.h
vm_sockets.h vsock: add VMADDR_CID_LOCAL definition 2019-12-11 15:01:23 -08:00
vmcore.h
vsockmon.h
vt.h
vtpm_proxy.h
wait.h
watchdog.h
wimax.h
wireguard.h wireguard: global: fix spelling mistakes in comments 2019-12-16 19:22:22 -08:00
wireless.h wireless: Use offsetof instead of custom macro. 2019-12-13 10:45:35 +01:00
wmi.h
x25.h
xattr.h
xdp_diag.h
xfrm.h
xilinx-v4l2-controls.h
zorro_ids.h
zorro.h