summaryrefslogtreecommitdiff
path: root/kernel
diff options
context:
space:
mode:
authorToke Høiland-Jørgensen <toke@redhat.com>2022-01-07 23:11:13 +0100
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2022-01-27 11:05:26 +0100
commitb87b59633e358f15e782df96f41733b228c06023 (patch)
tree86aaf01d6e491605d811f32c0caecd25b8b0cad8 /kernel
parentb46b0ef69d07b17d084c1fee14a738354201b0f0 (diff)
xdp: check prog type before updating BPF link
commit 382778edc8262b7535f00523e9eb22edba1b9816 upstream. The bpf_xdp_link_update() function didn't check the program type before updating the program, which made it possible to install any program type as an XDP program, which is obviously not good. Syzbot managed to trigger this by swapping in an LWT program on the XDP hook which would crash in a helper call. Fix this by adding a check and bailing out if the types don't match. Fixes: 026a4c28e1db ("bpf, xdp: Implement LINK_UPDATE for BPF XDP link") Reported-by: syzbot+983941aa85af6ded1fd9@syzkaller.appspotmail.com Acked-by: Andrii Nakryiko <andrii@kernel.org> Signed-off-by: Toke Høiland-Jørgensen <toke@redhat.com> Link: https://lore.kernel.org/r/20220107221115.326171-1-toke@redhat.com Signed-off-by: Alexei Starovoitov <ast@kernel.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'kernel')
0 files changed, 0 insertions, 0 deletions