aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/bpf.h
diff options
context:
space:
mode:
authorJiong Wang <jiong.wang@netronome.com>2018-11-08 04:08:42 -0500
committerDaniel Borkmann <daniel@iogearbox.net>2018-11-09 09:16:31 +0100
commite647815a4d3b3be9d85b5750ed0f2947fd78fac7 (patch)
tree3f5c73cd81f673cacdd375e1e3f5381b5ce1c296 /include/linux/bpf.h
parentbpf_load: add map name to load_maps error message (diff)
downloadlinux-dev-e647815a4d3b3be9d85b5750ed0f2947fd78fac7.tar.xz
linux-dev-e647815a4d3b3be9d85b5750ed0f2947fd78fac7.zip
bpf: let verifier to calculate and record max_pkt_offset
In check_packet_access, update max_pkt_offset after the offset has passed __check_packet_access. It should be safe to use u32 for max_pkt_offset as explained in code comment. Also, when there is tail call, the max_pkt_offset of the called program is unknown, so conservatively set max_pkt_offset to MAX_PACKET_OFF for such case. Reviewed-by: Jakub Kicinski <jakub.kicinski@netronome.com> Signed-off-by: Jiong Wang <jiong.wang@netronome.com> Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
Diffstat (limited to 'include/linux/bpf.h')
-rw-r--r--include/linux/bpf.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/include/linux/bpf.h b/include/linux/bpf.h
index 33014ae73103..b6a296e01f6a 100644
--- a/include/linux/bpf.h
+++ b/include/linux/bpf.h
@@ -293,6 +293,7 @@ struct bpf_prog_aux {
atomic_t refcnt;
u32 used_map_cnt;
u32 max_ctx_offset;
+ u32 max_pkt_offset;
u32 stack_depth;
u32 id;
u32 func_cnt;