Commit 5a9eae6
net: xdp: Disallow attaching device-bound programs in generic mode
[ Upstream commit 3595599 ]
Device-bound programs are used to support RX metadata kfuncs. These
kfuncs are driver-specific and rely on the driver context to read the
metadata. This means they can't work in generic XDP mode. However, there
is no check to disallow such programs from being attached in generic
mode, in which case the metadata kfuncs will be called in an invalid
context, leading to crashes.
Fix this by adding a check to disallow attaching device-bound programs
in generic mode.
Fixes: 2b3486b ("bpf: Introduce device-bound XDP programs")
Reported-by: Marcus Wichelmann <[email protected]>
Closes: https://lore.kernel.org/r/[email protected]
Tested-by: Marcus Wichelmann <[email protected]>
Acked-by: Stanislav Fomichev <[email protected]>
Signed-off-by: Toke Høiland-Jørgensen <[email protected]>
Acked-by: Daniel Borkmann <[email protected]>
Acked-by: Martin KaFai Lau <[email protected]>
Link: https://patch.msgid.link/[email protected]
Signed-off-by: Jakub Kicinski <[email protected]>
Signed-off-by: Sasha Levin <[email protected]>1 parent b4055e2 commit 5a9eae6
1 file changed
+4
-0
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
9699 | 9699 | | |
9700 | 9700 | | |
9701 | 9701 | | |
| 9702 | + | |
| 9703 | + | |
| 9704 | + | |
| 9705 | + | |
9702 | 9706 | | |
9703 | 9707 | | |
9704 | 9708 | | |
| |||
0 commit comments