]> git.baikalelectronics.ru Git - kernel.git/commit
bpf: make direct packet write unclone more robust
authorDaniel Borkmann <daniel@iogearbox.net>
Wed, 24 Oct 2018 20:05:49 +0000 (22:05 +0200)
committerAlexei Starovoitov <ast@kernel.org>
Fri, 26 Oct 2018 00:02:06 +0000 (17:02 -0700)
commit3ae30dd1d50b6870d02f0c4a24743cd89a4f60f8
tree56255e6f507f2685a1ff991502711cdbe5de20e9
parentb043e04455bb0b831de8527a63ae6f7e67704c0b
bpf: make direct packet write unclone more robust

Given this seems to be quite fragile and can easily slip through the
cracks, lets make direct packet write more robust by requiring that
future program types which allow for such write must provide a prologue
callback. In case of XDP and sk_msg it's noop, thus add a generic noop
handler there. The latter starts out with NULL data/data_end unconditionally
when sg pages are shared.

Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
Acked-by: Alexei Starovoitov <ast@kernel.org>
Acked-by: Song Liu <songliubraving@fb.com>
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
kernel/bpf/verifier.c
net/core/filter.c