bpf, xdp: move offload check into dev_xdp_install()
Linux
Affected versions
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
|
Linux
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
|
≥ 026a4c28e1db3b0cb99cd9a3e495d4a8b632fa74 · < 03022dd874070768a7099f18b1944c633641315f| No fix yet |
| Linux Linux |
|
|
In the Linux kernel, the following vulnerability has been resolved:
bpf, xdp: move offload check into dev_xdp_install()
bpf_xdp_link_update() calls dev_xdp_install() directly and skips dev_xdp_attach(), so the checks in dev_xdp_attach() do not run. A user can make an XDP link with a normal program and then swap in an offloaded or device-bound program with BPF_LINK_UPDATE, which puts it on the software path.
dev_xdp_install() is the one place all three paths go through: "ip link set xdp" and BPF_LINK_CREATE reach it via dev_xdp_attach(), and BPF_LINK_UPDATE calls it directly. So move the program checks (offloaded, bound to another device, device-bound in generic mode, native vs generic, DEVMAP and CPUMAP) there, and keep only the netlink-flag check (XDP_FLAGS_UPDATE_IF_NOEXIST) in dev_xdp_attach().
From the CVE record · Linux
The Linux kernel does not apply all XDP program checks when BPF_LINK_UPDATE calls dev_xdp_install() directly. A user able to update an XDP link can replace a normal program with an offloaded or device-bound program, putting it on the software path. The input does not specify authentication requirements or user interaction.
Engineers running the Linux kernel should check their installations; affected versions are not specified.