New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
xdp: check prog type before updating BPF link #2384
Conversation
Master branch: d6d8683 |
At least one diff in series https://patchwork.kernel.org/project/netdevbpf/list/?series=603638 expired. Closing PR. |
Master branch: d6d8683 |
9da3aef
to
56998e7
Compare
Master branch: dd3ca4c |
56998e7
to
0dc98b3
Compare
Master branch: dd3ca4c |
0dc98b3
to
e1ab129
Compare
Master branch: 7d6019b |
e1ab129
to
196b8c7
Compare
Master branch: 1e9d746 |
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: 026a4c2 ("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>
Convert the selftest to use the preferred ASSERT_* macros instead of the deprecated CHECK(). v2: - Don't add if statements around checks if they weren't there before. Signed-off-by: Toke Høiland-Jørgensen <toke@redhat.com>
… type Add a check to the xdp_link selftest that the kernel rejects replacing an XDP program with a different program type on link update. v2: - Split this out into its own patch. Signed-off-by: Toke Høiland-Jørgensen <toke@redhat.com>
196b8c7
to
115fba7
Compare
At least one diff in series https://patchwork.kernel.org/project/netdevbpf/list/?series=603680 irrelevant now. Closing PR. |
Pull request for series with
subject: xdp: check prog type before updating BPF link
version: 1
url: https://patchwork.kernel.org/project/netdevbpf/list/?series=603638