]> git.baikalelectronics.ru Git - kernel.git/commit
bpf: fix direct packet write into pop/peek helpers
authorDaniel Borkmann <daniel@iogearbox.net>
Wed, 24 Oct 2018 20:05:47 +0000 (22:05 +0200)
committerAlexei Starovoitov <ast@kernel.org>
Fri, 26 Oct 2018 00:02:06 +0000 (17:02 -0700)
commitdfd1f8df8ce222eeb971d044c10cc21bb7de0447
tree83740a6f5a2d27764c8cd5833546cd3e9cdaf8c8
parent667f2e377db5eca436cba049ec0943839bb91ba3
bpf: fix direct packet write into pop/peek helpers

Commit 3f0ed437d88f ("bpf: add queue and stack maps") probably just
copy-pasted .pkt_access for bpf_map_{pop,peek}_elem() helpers, but
this is buggy in this context since it would allow writes into cloned
skbs which is invalid. Therefore, disable .pkt_access for the two.

Fixes: 3f0ed437d88f ("bpf: add queue and stack maps")
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
Acked-by: Alexei Starovoitov <ast@kernel.org>
Cc: Mauricio Vasquez B <mauricio.vasquez@polito.it>
Acked-by: Mauricio Vasquez B<mauricio.vasquez@polito.it>
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
kernel/bpf/helpers.c