VDB

CVE-2024-36937

CVE-2024-36937 PUBLISHED

xdp: use flags field to disambiguate broadcast redirect

Reported by linux · Published May 30, 2024

In the Linux kernel, the following vulnerability has been resolved: xdp: use flags field to disambiguate broadcast redirect When redirecting a packet using XDP, the bpf_redirect_map() helper will set up the redirect destination information in struct bpf_redirect_info (using the __bpf_xdp_redirect_map() helper function), and the xdp_do_redirect() function will read this information after the XDP program returns and pass the frame on to the right redirect destination. When using the BPF_F_BROADCAST flag to do multicast redirect to a whole map, __bpf_xdp_redirect_map() sets the 'map' pointer in struct bpf_redirect_info to point to the destination map to be broadcast. And xdp_do_redirect() reacts to the value of this map pointer to decide whether it's dealing with a broadcast or a single-value redirect. However, if the destination map is being destroyed before xdp_do_redirect() is called, the map pointer will be cleared out (by bpf_clear_redirect_map()) without waiting for any XDP programs to stop running. This causes xdp_do_redirect() to think that the redirect was to a single target, but the target pointer is also NULL (since broadcast redirects don't have a single target), so this causes a crash when a NULL pointer is passed to dev_map_enqueue(). To fix this, change xdp_do_redirect() to react directly to the presence of the BPF_F_BROADCAST flag in the 'flags' value in struct bpf_redirect_info to disambiguate between a single-target and a broadcast redirect. And only read the 'map' pointer if the broadcast flag is set, aborting if that has been cleared out in the meantime. This prevents the crash, while keeping the atomic (cmpxchg-based) clearing of the map pointer itself, and without adding any more checks in the non-broadcast fast path.

Fixed versions

Upgrade to a fixed version or later. Language registries are listed first, then Linux distributions, then vendor products.

PackageEcosystemFixed in
kernel-libbpf-develAmazon Linux6.1.91-99.172.amzn2023
kernel-toolsAmazon Linux6.1.91-99.172.amzn2023
kernel-libbpfAmazon Linux6.1.91-99.172.amzn2023
kernel-libbpf-staticAmazon Linux6.1.91-99.172.amzn2023
perfAmazon Linux6.1.91-99.172.amzn2023
kernelAmazon Linux6.1.91-99.172.amzn2023
kernel-headersAmazon Linux6.1.91-99.172.amzn2023
kernel-livepatch-6.1.91-99.172Amazon Linux1.0-0.amzn2023
kernel-tools-develAmazon Linux6.1.91-99.172.amzn2023
kernel-modules-extra-commonAmazon Linux6.1.91-99.172.amzn2023
bpftoolAmazon Linux6.1.91-99.172.amzn2023
python3-perfAmazon Linux6.1.91-99.172.amzn2023

3 more packages have a fixed version. See every fix in Lookup.

Affected products

VendorProductVersions
LinuxLinuxe624d4ed4aa8cc3c69d1359b0aaea539203ed266, e624d4ed4aa8cc3c69d1359b0aaea539203ed266, e624d4ed4aa8cc3c69d1359b0aaea539203ed266
LinuxLinux5.14, 0, 5.15.159
amazon:2023kernel-libbpf-devel0
amazon:2023kernel-tools0
amazon:2023kernel-libbpf0
amazon:2023kernel-libbpf-static0
amazon:2023perf0
amazon:2023kernel0
amazon:2023kernel-headers0
amazon:2023kernel-livepatch-6.1.91-99.1720
amazon:2023kernel-tools-devel0
amazon:2023kernel-modules-extra-common0
amazon:2023bpftool0
amazon:2023python3-perf0
amazon:2023kernel-modules-extra0
LinuxLinux0, *, 5.15.159
amazon:2023kernel-devel0
linuxlinux_kernel5.14, 5.14, 5.14

Timeline

  • May 30, 2024 CVE Published
  • May 31, 2024 EPSS Score (30 in total, the first dated here)
  • Oct 4, 2024 Coalition ESS Score (24 in total, the first dated here)
  • Jan 9, 2026 Security Advisory (330 in total, the first dated here)
  • Mar 30, 2026 Distribution Patch (234 in total, the first dated here)

Query this with the API

The same record, from the CLI:

vulnetix vdb vuln CVE-2024-36937
vulnetix vdb fixes CVE-2024-36937

Or with curl, using the org id and key from your account page:

curl -s -H "Authorization: ApiKey ${VULNETIX_ORG_ID}:${VULNETIX_API_KEY}" \
  "https://api.vdb.vulnetix.com/v2/vuln/CVE-2024-36937/fixes/registry"

The Community plan is free and allows 50 queries a day. Get a free API key · API quickstart

References

Look up in the Resolve Platform →
$ Lookup Community · 50/day Open Lookup ›