Search CVEs and advisories

Search CVEs and Linux security advisories by vendor, product, package, or severity, and see which vulnerabilities each advisory addresses.

CVE

CVE-2021-47303

published high CVSS 3.1 · 7.8

bpf: Track subprog poke descriptors correctly and fix use-after-free

Published
21 May 2024, 14:35:24 UTC
Updated
05 Aug 2026, 08:47:10 UTC
Language
en

Package status and fixes

Distro / vendorReleasePackage / productPublisher statusFixed buildSource
Linux — Linuxa748c6975dea325da540610c2ba9b5f332c603e6 to < a9f36bf3613c65cb587c70fac655c775d911409b · a748c6975dea325da540610c2ba9b5f332c603e6 to < 599148d40366bd5d1d504a3a8fcd65e21107e500 · a748c6975dea325da540610c2ba9b5f332c603e6 to < f263a81451c12da5a342d90572e317e611846f2c · Other versions: unaffected Affected Not stated Linux
Linux — Linux5.10 (affected) · 0 to < 5.10 (unaffected · semver) · 5.10.53 through 5.10.* (unaffected · semver) · 5.13.5 through 5.13.* (unaffected · semver) · 5.14 and later (unaffected · original_commit_for_fix) · Other versions: affected Version-specific Not stated Linux
Amazon Linux AL2 Release evaluation Not Affected Not required Amazon Linux assessment
Amazon Linux AL2 Release evaluationALAS2KERNEL-5.10-2022-004 Fixed Not stated Amazon Linux assessment
Amazon Linux AL2023 Release evaluation Not Affected Not required Amazon Linux assessment
Amazon Linux AL2 kernelaarch64 Listed in advisory Not stated ALAS2KERNEL-5.10-2022-004
Amazon Linux AL2 kerneli686 Listed in advisory Not stated ALAS2KERNEL-5.10-2022-004
Amazon Linux AL2 kernelsrc Listed in advisory Not stated ALAS2KERNEL-5.10-2022-004
Show 1 more entries
Distro / vendorReleasePackage / productPublisher statusFixed buildSource
Amazon Linux AL2 kernelx86_64 Listed in advisory Not stated ALAS2KERNEL-5.10-2022-004

Description

In the Linux kernel, the following vulnerability has been resolved: bpf: Track subprog poke descriptors correctly and fix use-after-free Subprograms are calling map_poke_track(), but on program release there is no hook to call map_poke_untrack(). However, on program release, the aux memory (and poke descriptor table) is freed even though we still have a reference to it in the element list of the map aux data. When we run map_poke_run(), we then end up accessing free'd memory, triggering KASAN in prog_array_map_poke_run(): [...] [ 402.824689] BUG: KASAN: use-after-free in prog_array_map_poke_run+0xc2/0x34e [ 402.824698] Read of size 4 at addr ffff8881905a7940 by task hubble-fgs/4337 [ 402.824705] CPU: 1 PID: 4337 Comm: hubble-fgs Tainted: G I 5.12.0+ #399 [ 402.824715] Call Trace: [ 402.824719] dump_stack+0x93/0xc2 [ 402.824727] print_address_description.constprop.0+0x1a/0x140 [ 402.824736] ? prog_array_map_poke_run+0xc2/0x34e [ 402.824740] ? prog_array_map_poke_run+0xc2/0x34e [ 402.824744] kasan_report.cold+0x7c/0xd8 [ 402.824752] ? prog_array_map_poke_run+0xc2/0x34e [ 402.824757] prog_array_map_poke_run+0xc2/0x34e [ 402.824765] bpf_fd_array_map_update_elem+0x124/0x1a0 [...] The elements concerned are walked as follows: for (i = 0; i < elem->aux->size_poke_tab; i++) { poke = &elem->aux->poke_tab[i]; [...] The access to size_poke_tab is a 4 byte read, verified by checking offsets in the KASAN dump: [ 402.825004] The buggy address belongs to the object at ffff8881905a7800 which belongs to the cache kmalloc-1k of size 1024 [ 402.825008] The buggy address is located 320 bytes inside of 1024-byte region [ffff8881905a7800, ffff8881905a7c00) The pahole output of bpf_prog_aux: struct bpf_prog_aux { [...] /* --- cacheline 5 boundary (320 bytes) --- */ u32 size_poke_tab; /* 320 4 */ [...] In general, subprograms do not necessarily manage their own data structures. For example, BTF func_info and linfo are just pointers to the main program structure. This allows reference counting and cleanup to be done on the latter which simplifies their management a bit. The aux->poke_tab struct, however, did not follow this logic. The initial proposed fix for this use-after-free bug further embedded poke data tracking into the subprogram with proper reference counting. However, Daniel and Alexei questioned why we were treating these objects special; I agree, its unnecessary. The fix here removes the per subprogram poke table allocation and map tracking and instead simply points the aux->poke_tab pointer at the main programs poke table. This way, map tracking is simplified to the main program and we do not need to manage them per subprogram. This also means, bpf_prog_free_deferred(), which unwinds the program reference counting and kfrees objects, needs to ensure that we don't try to double free the poke_tab when free'ing the subprog structures. This is easily solved by NULL'ing the poke_tab pointer. The second detail is to ensure that per subprogram JIT logic only does fixups on poke_tab[] entries it owns. To do this, we add a pointer in the poke structure to point at the subprogram value so JITs can easily check while walking the poke_tab structure if the current entry belongs to the current program. The aux pointer is stable and therefore suitable for such comparison. On the jit_subprogs() error path, we omit cleaning up the poke->aux field because these are only ever referenced from the JIT side, but on error we will never make it to the JIT, so its fine to leave them dangling. Removing these pointers would complicate the error path for no reason. However, we do need to untrack all poke descriptors from the main program as otherwise they could race with the freeing of JIT memory from the subprograms. Lastly, a748c6975dea3 ("bpf: propagate poke des ---truncated---

en · Linux · cna

Vendor advisories explicitly linked to this CVE.

1

Assessment

CVSS risk assessment and additional context for this vulnerability.

CVSS version
3.1
Base score
7.8 / 10
Severity
high
Provider
Linux · cna
Vector string
CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H
Scenarios
en: AV:L - The bug is reached through local bpf() syscalls (BPF_PROG_LOAD with subprogs/tail calls, then BPF_MAP_UPDATE_ELEM on a BPF_MAP_TYPE_PROG_ARRAY); it is not reachable from network packets alone. AC:L - The attacker fully controls program load, program release, and the subsequent prog-array update that invokes prog_array_map_poke_run() on the dangling tracked aux; no race or external condition is required. PR:L - Triggering requires CAP_BPF (subprograms need bpf_capable()), which is routinely held by non-root BPF services (e.g. cilium/hubble) and is below full admin/root; choosing the higher-severity option yields Low rather than High. UI:N - No victim action is required; the attacker loads the crafted program, closes it, and updates the prog-array map themselves. S:U - Impact is a standard in-kernel UAF/privilege-escalation path within the same host kernel security authority, not a VM/IOMMU/sandbox scope change. C:H - Use-after-free of bpf_prog_aux lets an attacker reclaim and control the freed object contents read by prog_array_map_poke_run(), enabling kernel memory disclosure primitives. I:H - The UAF feeds attacker-controlled poke descriptors into bpf_arch_text_poke(), enabling heap spraying and arbitrary kernel text/data modification / control-flow hijacking. A:H - Even without full exploitation, accessing the freed aux during map updates causes a kernel oops/panic (as shown by the KASAN UAF report), so availability impact is High.

Publisher product statements

Version ranges and default statuses as reported by each provider.

Affected vendor and product assertions
VendorProductVersion statusSource
Linux Linux a748c6975dea325da540610c2ba9b5f332c603e6 to < a9f36bf3613c65cb587c70fac655c775d911409b (affected · git)a748c6975dea325da540610c2ba9b5f332c603e6 to < 599148d40366bd5d1d504a3a8fcd65e21107e500 (affected · git)a748c6975dea325da540610c2ba9b5f332c603e6 to < f263a81451c12da5a342d90572e317e611846f2c (affected · git)Default: unaffected Linux · cna
Linux Linux 5.10 (affected)0 to < 5.10 (unaffected · semver)5.10.53 through 5.10.* (unaffected · semver)5.13.5 through 5.13.* (unaffected · semver)5.14 and later (unaffected · original_commit_for_fix)Default: affected Linux · cna

Weaknesses

0

No weakness assertions.

References

3

Provider assertions

3

Linux · cna

bpf: Track subprog poke descriptors correctly and fix use-after-free

CISA-ADP · adp

CISA ADP Vulnrichment

CVE · adp

CVE Program Container

Provenance

Schema
5.2
Searchable
yes
Content hash
a67cf532c45b3f6bb4b0669e8fae6e533684dd0b22bd36b1cd18d08f46d4208d
Ingested
23 Sep 2026, 07:57:11 UTC
Source record
Official CVE record

Search filters

Match options apply to free text. CVE words match tokens; use contains:"…" for literal substrings.

Text

Words and phrases
buffer overflow "remote code execution"
Word prefix
auth*
Literal substring (title or description)
contains:"use-after-free"
Exclude a term or filter
-test -vendor:example

Affected product

Vendor
vendor:Example
Product
product:"Demo Widget"

Severity and score

Severity · none, low, medium, high, critical, unknown
severity:critical
CWE identifier
cwe:CWE-863
CVSS score (0–10)
cvss:>=7.0

Dates and status

Published date · comparisons, relative days
published:>=2026-01-01
Updated date · comparisons, relative days
updated:<30d
Status · published (default), rejected, unknown
status:rejected