]> git.baikalelectronics.ru Git - kernel.git/commit
bpf: fix two missing target_size settings in bpf_convert_ctx_access
authorDaniel Borkmann <daniel@iogearbox.net>
Fri, 11 Aug 2017 16:31:25 +0000 (18:31 +0200)
committerDavid S. Miller <davem@davemloft.net>
Fri, 11 Aug 2017 21:59:24 +0000 (14:59 -0700)
commit7e4bf643d85ec34fe5e5ce937848b277508d464c
treee73ac37a02171305e0efbaae972b38ef0a998a22
parentd47efacbc2eae5f19f3d5011a247b289712fab65
bpf: fix two missing target_size settings in bpf_convert_ctx_access

When CONFIG_NET_SCHED or CONFIG_NET_RX_BUSY_POLL is /not/ set and
we try a narrow __sk_buff load of tc_index or napi_id, respectively,
then verifier rightfully complains that it's misconfigured, because
we need to set target_size in each of the two cases. The rewrite
for the ctx access is just a dummy op, but needs to pass, so fix
this up.

Fixes: 04923fb0220f ("bpf: simplify narrower ctx access")
Reported-by: Shubham Bansal <illusionist.neo@gmail.com>
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/core/filter.c