diff options
author | Toke Høiland-Jørgensen <[email protected]> | 2022-01-07 23:11:13 +0100 |
---|---|---|
committer | Alexei Starovoitov <[email protected]> | 2022-01-11 09:44:06 -0800 |
commit | 382778edc8262b7535f00523e9eb22edba1b9816 (patch) | |
tree | 5c20588a75ee236ddb87ff426cf198c11cf37b9f /lib/test_overflow.c | |
parent | 1e9d74660d4df625b0889e77018f9e94727ceacd (diff) |
xdp: check prog type before updating BPF link
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: [email protected]
Acked-by: Andrii Nakryiko <[email protected]>
Signed-off-by: Toke Høiland-Jørgensen <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Alexei Starovoitov <[email protected]>
Diffstat (limited to 'lib/test_overflow.c')
0 files changed, 0 insertions, 0 deletions