CVE-2022-50483
published high CVSS 3.1 · 7.5net: enetc: avoid buffer leaks on xdp_do_redirect() failure
Package status and fixes
| Distro / vendor | Release | Package / product | Publisher status | Fixed build | Source |
|---|---|---|---|---|---|
| Linux | — | Linux9d2b68cc108db2fdb35022ed2d88cfb305c441a6 to < bcf2c1dc5358dcf7e34a68cdb6b0bbf967801efa · 9d2b68cc108db2fdb35022ed2d88cfb305c441a6 to < 7fba523b51ccce5f7981f8a43ad84d664da68131 · 9d2b68cc108db2fdb35022ed2d88cfb305c441a6 to < 306526331e7a37e714e11ab7c6d73eb004745224 · 9d2b68cc108db2fdb35022ed2d88cfb305c441a6 to < 628050ec952d2e2e46ec9fb6aa07e41139e030c8 · Other versions: unaffected | Affected | Not stated | Linux |
| Linux | — | Linux5.13 (affected) · 0 to < 5.13 (unaffected · semver) · 5.15.86 through 5.15.* (unaffected · semver) · 6.0.16 through 6.0.* (unaffected · semver) · 6.1.2 through 6.1.* (unaffected · semver) · 6.2 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 | AL2023 | Release evaluation | Not Affected | Not required | Amazon Linux assessment |
Description
In the Linux kernel, the following vulnerability has been resolved: net: enetc: avoid buffer leaks on xdp_do_redirect() failure Before enetc_clean_rx_ring_xdp() calls xdp_do_redirect(), each software BD in the RX ring between index orig_i and i can have one of 2 refcount values on its page. We are the owner of the current buffer that is being processed, so the refcount will be at least 1. If the current owner of the buffer at the diametrically opposed index in the RX ring (i.o.w, the other half of this page) has not yet called kfree(), this page's refcount could even be 2. enetc_page_reusable() in enetc_flip_rx_buff() tests for the page refcount against 1, and [ if it's 2 ] does not attempt to reuse it. But if enetc_flip_rx_buff() is put after the xdp_do_redirect() call, the page refcount can have one of 3 values. It can also be 0, if there is no owner of the other page half, and xdp_do_redirect() for this buffer ran so far that it triggered a flush of the devmap/cpumap bulk queue, and the consumers of those bulk queues also freed the buffer, all by the time xdp_do_redirect() returns the execution back to enetc. This is the reason why enetc_flip_rx_buff() is called before xdp_do_redirect(), but there is a big flaw with that reasoning: enetc_flip_rx_buff() will set rx_swbd->page = NULL on both sides of the enetc_page_reusable() branch, and if xdp_do_redirect() returns an error, we call enetc_xdp_free(), which does not deal gracefully with that. In fact, what happens is quite special. The page refcounts start as 1. enetc_flip_rx_buff() figures they're reusable, transfers these rx_swbd->page pointers to a different rx_swbd in enetc_reuse_page(), and bumps the refcount to 2. When xdp_do_redirect() later returns an error, we call the no-op enetc_xdp_free(), but we still haven't lost the reference to that page. A copy of it is still at rx_ring->next_to_alloc, but that has refcount 2 (and there are no concurrent owners of it in flight, to drop the refcount). What really kills the system is when we'll flip the rx_swbd->page the second time around. With an updated refcount of 2, the page will not be reusable and we'll really leak it. Then enetc_new_page() will have to allocate more pages, which will then eventually leak again on further errors from xdp_do_redirect(). The problem, summarized, is that we zeroize rx_swbd->page before we're completely done with it, and this makes it impossible for the error path to do something with it. Since the packet is potentially multi-buffer and therefore the rx_swbd->page is potentially an array, manual passing of the old pointers between enetc_flip_rx_buff() and enetc_xdp_free() is a bit difficult. For the sake of going with a simple solution, we accept the possibility of racing with xdp_do_redirect(), and we move the flip procedure to execute only on the redirect success path. By racing, I mean that the page may be deemed as not reusable by enetc (having a refcount of 0), but there will be no leak in that case, either. Once we accept that, we have something better to do with buffers on XDP_REDIRECT failure. Since we haven't performed half-page flipping yet, we won't, either (and this way, we can avoid enetc_xdp_free() completely, which gives the entire page to the slab allocator). Instead, we'll call enetc_xdp_drop(), which will recycle this half of the buffer back to the RX ring.
Related advisories
Vendor advisories explicitly linked to this CVE.
No linked advisories were found for this CVE.
Assessment
CVSS risk assessment and additional context for this vulnerability.
- CVSS version
- 3.1
- Base score
- 7.5 / 10
- Severity
- high
- Provider
- Linux · cna
- Vector string
- CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H
- Scenarios
- en: AV:N - The bug sits in enetc_clean_rx_ring_xdp() on the native NAPI RX path, so received Ethernet frames drive it. In a reasonable ENETC gateway/TSN deployment with an XDP_REDIRECT program already attached, a remote peer’s packets reach the vulnerable error path. AC:L - Once XDP_REDIRECT is active, the attacker can reliably force xdp_do_redirect() failures by flooding (devmap/cpumap enqueue/ENOMEM pressure) or against a down/invalid redirect target; no race or attacker-uncontrollable memory layout is required. PR:N - In the highest-impact scenario the administrator has already attached the XDP program; the attacker needs no host account or capability and only sends unauthenticated frames on the wire. UI:N - Packet reception and NAPI polling run automatically on the up interface; no separate victim mount, open, or interactive step is required. S:U - The leaked RX pages and resulting DoS remain inside the host kernel’s memory authority; there is no VM escape, IOMMU bypass, or other cross-boundary impact. C:N - This is a pure page reference leak after enetc_flip_rx_buff() nulls rx_swbd->page before a failed redirect; there is no OOB read, UAF reclaim, or other disclosure primitive. I:N - No out-of-bounds write, use-after-free, or type confusion occurs—only unreclaimed page references—so there is no integrity or code-execution primitive. A:H - Each failed redirect permanently leaks RX page(s), and sustained remote traffic can exhaust memory until the host is OOM/unavailable; the fix commit itself describes this progressive leak as killing the system, so availability is High.
Publisher product statements
Version ranges and default statuses as reported by each provider.
| Vendor | Product | Version status | Source |
|---|---|---|---|
| Linux | Linux | 9d2b68cc108db2fdb35022ed2d88cfb305c441a6 to < bcf2c1dc5358dcf7e34a68cdb6b0bbf967801efa (affected · git)9d2b68cc108db2fdb35022ed2d88cfb305c441a6 to < 7fba523b51ccce5f7981f8a43ad84d664da68131 (affected · git)9d2b68cc108db2fdb35022ed2d88cfb305c441a6 to < 306526331e7a37e714e11ab7c6d73eb004745224 (affected · git)9d2b68cc108db2fdb35022ed2d88cfb305c441a6 to < 628050ec952d2e2e46ec9fb6aa07e41139e030c8 (affected · git)Default: unaffected | Linux · cna |
| Linux | Linux | 5.13 (affected)0 to < 5.13 (unaffected · semver)5.15.86 through 5.15.* (unaffected · semver)6.0.16 through 6.0.* (unaffected · semver)6.1.2 through 6.1.* (unaffected · semver)6.2 and later (unaffected · original_commit_for_fix)Default: affected | Linux · cna |
Weaknesses
0No weakness assertions.
References
4Provider assertions
1Linux · cna
net: enetc: avoid buffer leaks on xdp_do_redirect() failure
Provenance
- Schema
- 5.2
- Searchable
- yes
- Content hash
- 80b25399a80a57aeaf853743399653999cd297195457593d444e772494b2822c
- Ingested
- 23 Sep 2026, 08:04:48 UTC
- Source record
- Official CVE record