aboutsummaryrefslogtreecommitdiffstats
path: root/sys/linux/bpf.txt.const
diff options
context:
space:
mode:
authorPaul Chaignon <paul@isovalent.com>2021-12-19 20:59:43 +0100
committerDmitry Vyukov <dvyukov@google.com>2021-12-21 05:33:37 +0100
commit249a240f56f88e69fe97cdcf8fb614ade2251958 (patch)
tree295327a5cb0e9b2f9aad94ff37863b94aed81405 /sys/linux/bpf.txt.const
parentb747e572ec589543e9ccb870158f467f7fa3d825 (diff)
sys/linux: support callback BPF functions
Commit [1] upstream introduced a new BPF helper, bpf_for_each_map_elem, which comes with callback functions (BPF programs). The callback function's address is provided via a 64-bit IMM load instruction where the first 32-bit of the immediate value are the offset from the current instruction to the start of the callback function. The 64-bit value is then rewritten into the address of the callback function. Callback BPF functions are similar to BPF_PSEUDO_CALL functions, except the offset to the function is converted into an address to be passed to a BPF helper. The same workaround is thus used to encode the offset in syzkaller, given we can't currently limit the offset to the program size. 1 - https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=69c087ba6225b Signed-off-by: Paul Chaignon <paul@isovalent.com>
Diffstat (limited to 'sys/linux/bpf.txt.const')
-rw-r--r--sys/linux/bpf.txt.const1
1 files changed, 1 insertions, 0 deletions
diff --git a/sys/linux/bpf.txt.const b/sys/linux/bpf.txt.const
index 83ff643d5..5f8cf4c07 100644
--- a/sys/linux/bpf.txt.const
+++ b/sys/linux/bpf.txt.const
@@ -192,6 +192,7 @@ BPF_PROG_TYPE_TRACING = 26
BPF_PROG_TYPE_XDP = 6
BPF_PSEUDO_BTF_ID = 3
BPF_PSEUDO_CALL = 1
+BPF_PSEUDO_FUNC = 4
BPF_PSEUDO_MAP_FD = 1
BPF_PSEUDO_MAP_IDX = 5
BPF_PSEUDO_MAP_IDX_VALUE = 6