# CVE-2022-49871: net: tun: Fix memory leaks of napi\_get\_frags

> Archived entry. Full-text search covers entries since 2026-11-10; exact IDs work for all years.

- **Severity:** MEDIUM 5.5
- **CVSS:** 5.5 (v3.1, CNA) `CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:N/I:N/A:H`
- **CVSS metrics:** Attack vector: Local; Attack complexity: Low; Privileges required: Low; User interaction: None; Scope: Unchanged; Confidentiality impact: None; Integrity impact: None; Availability impact: High
- **Exploited in the wild:** Not in CISA KEV
- **Public exploit / PoC:** None known
- **Remote exploitation:** Not remotely exploitable (local or adjacent access needed)
- **EPSS:** 0.29% (percentile 14, 2026-11-26)
- **CWE:** CWE-401
- **Published:** 2025-05-01T14:10:21.760Z
- **Modified:** 2026-06-17T05:19:22.317Z

## Who should check

- Anyone running Linux \>= 90e33d45940793def6f773b2d528e9f3c84ffdc7, \< 223ef6a94e52331a6a7ef31e59921e0e82d2d40a; \>= 90e33d45940793def6f773b2d528e9f3c84ffdc7, \< a4f73f6adc53fd7a3f9771cbc89a03ef39b0b755; \>= 90e33d45940793def6f773b2d528e9f3c84ffdc7, \< 3401f964028ac941425b9b2c8ff8a022539ef44a; \>= 90e33d45940793def6f773b2d528e9f3c84ffdc7, \< d7569302a7a52a9305d2fb054df908ff985553bb; \>= 90e33d45940793def6f773b2d528e9f3c84ffdc7, \< 8b12a020b20a78f62bedc50f26db3bf4fadf8cb9; \>= 90e33d45940793def6f773b2d528e9f3c84ffdc7, \< 1118b2049d77ca0b505775fc1a8d1909cf19a7ec
- Anyone running Linux 4.15

## Description

In the Linux kernel, the following vulnerability has been resolved:

net: tun: Fix memory leaks of napi\_get\_frags

kmemleak reports after running test\_progs:

unreferenced object 0xffff8881b1672dc0 (size 232):
  comm "test\_progs", pid 394388, jiffies 4354712116 (age 841.975s)
  hex dump (first 32 bytes):
    e0 84 d7 a8 81 88 ff ff 80 2c 67 b1 81 88 ff ff  .........,g.....
    00 40 c5 9b 81 88 ff ff 00 00 00 00 00 00 00 00  .@..............
  backtrace:
    \[\<00000000c8f01748\>\] napi\_skb\_cache\_get+0xd4/0x150
    \[\<0000000041c7fc09\>\] \_\_napi\_build\_skb+0x15/0x50
    \[\<00000000431c7079\>\] \_\_napi\_alloc\_skb+0x26e/0x540
    \[\<000000003ecfa30e\>\] napi\_get\_frags+0x59/0x140
    \[\<0000000099b2199e\>\] tun\_get\_user+0x183d/0x3bb0 \[tun\]
    \[\<000000008a5adef0\>\] tun\_chr\_write\_iter+0xc0/0x1b1 \[tun\]
    \[\<0000000049993ff4\>\] do\_iter\_readv\_writev+0x19f/0x320
    \[\<000000008f338ea2\>\] do\_iter\_write+0x135/0x630
    \[\<000000008a3377a4\>\] vfs\_writev+0x12e/0x440
    \[\<00000000a6b5639a\>\] do\_writev+0x104/0x280
    \[\<00000000ccf065d8\>\] do\_syscall\_64+0x3b/0x90
    \[\<00000000d776e329\>\] entry\_SYSCALL\_64\_after\_hwframe+0x63/0xcd

The issue occurs in the following scenarios:
tun\_get\_user()
  napi\_gro\_frags()
    napi\_frags\_finish()
      case GRO\_NORMAL:
        gro\_normal\_one()
          list\_add\_tail(&skb-\>list, &napi-\>rx\_list);
          \<-- While napi-\>rx\_count \< READ\_ONCE(gro\_normal\_batch),
          \<-- gro\_normal\_list() is not called, napi-\>rx\_list is not empty
  \<-- not ask to complete the gro work, will cause memory leaks in
  \<-- following tun\_napi\_del()
...
tun\_napi\_del()
  netif\_napi\_del()
    \_\_netif\_napi\_del()
    \<-- &napi-\>rx\_list is not empty, which caused memory leaks

To fix, add napi\_complete() after napi\_gro\_frags().

## Affected and fixed versions

- Linux: \>= 90e33d45940793def6f773b2d528e9f3c84ffdc7, \< 223ef6a94e52331a6a7ef31e59921e0e82d2d40a; \>= 90e33d45940793def6f773b2d528e9f3c84ffdc7, \< a4f73f6adc53fd7a3f9771cbc89a03ef39b0b755; \>= 90e33d45940793def6f773b2d528e9f3c84ffdc7, \< 3401f964028ac941425b9b2c8ff8a022539ef44a; \>= 90e33d45940793def6f773b2d528e9f3c84ffdc7, \< d7569302a7a52a9305d2fb054df908ff985553bb; \>= 90e33d45940793def6f773b2d528e9f3c84ffdc7, \< 8b12a020b20a78f62bedc50f26db3bf4fadf8cb9; \>= 90e33d45940793def6f773b2d528e9f3c84ffdc7, \< 1118b2049d77ca0b505775fc1a8d1909cf19a7ec (cvelist)
- Linux: 4.15 (cvelist)

## Mitigation

- Upgrade Linux to 1118b2049d77ca0b505775fc1a8d1909cf19a7ec or later.

## Check your systems with an agent

Paste this into a coding agent:

```text
Check whether anything I run is affected by CVE-2022-49871. Work read-only: do not install, upgrade, delete or change anything.

Details: https://flawdb.com/CVE-2022-49871.md
Affected: Linux >= 90e33d45940793def6f773b2d528e9f3c84ffdc7, < 223ef6a94e52331a6a7ef31e59921e0e82d2d40a; >= 90e33d45940793def6f773b2d528e9f3c84ffdc7, < a4f73f6adc53fd7a3f9771cbc89a03ef39b0b755; >= 90e33d45940793def6f773b2d528e9f3c84ffdc7, < 3401f964028ac941425b9b2c8ff8a022539ef44a; >= 90e33d45940793def6f773b…
Fixed in: Linux 223ef6a94e52331a6a7ef31e59921e0e82d2d40a, Linux 3401f964028ac941425b9b2c8ff8a022539ef44a, Linux 8b12a020b20a78f62bedc50f26db3bf4fadf8cb9, Linux 1118b2049d77ca0b505775fc1a8d1909cf19a7ec

Steps:
1. Search this machine and project for Linux: dependency manifests and lockfiles, installed packages, container images and running services.
2. For each match, note the installed version and whether it is inside the affected range.
3. Report a table: location, installed version, affected (yes / no / unsure), evidence. If affected, say which fixed version or mitigation from the details link applies, but don't apply it.
```

## FAQ

### Is CVE-2022-49871 being exploited?

There is no confirmed exploitation: CVE-2022-49871 is not in the CISA Known Exploited Vulnerabilities catalog. No public exploit code is known. EPSS estimates a 0.29% chance of exploitation in the next 30 days (as of 2026-11-26).

### How serious is CVE-2022-49871?

Medium: CVSS 5.5 (v3.1, scored by CNA). Not remotely exploitable (local or adjacent access needed).

### Which versions are affected by CVE-2022-49871?

Linux \>= 90e33d45940793def6f773b2d528e9f3c84ffdc7, \< 223ef6a94e52331a6a7ef31e59921e0e82d2d40a; \>= 90e33d45940793def6f773b2d528e9f3c84ffdc7, \< a4f73f6adc53fd7a3f9771cbc89a03ef39b0b755; \>= 90e33d45940793def6f773b2d528e9f3c84ffdc7, \< 3401f964028ac941425b9b2c8ff8a022539ef44a; \>= 90e33d45940793def6f773b2d528e9f3c84ffdc7, \< d7569302a7a52a9305d2fb054df908ff985553bb; \>= 90e33d45940793def6f773b2d528e9f3c84ffdc7, \< 8b12a020b20a78f62bedc50f26db3bf4fadf8cb9; \>= 90e33d45940793def6f773b2d528e9f3c84ffdc7, \< 1118b2049d77ca0b505775fc1a8d1909cf19a7ec; Linux 4.15.

### Is there a fix for CVE-2022-49871?

Yes. Fixed in Linux 223ef6a94e52331a6a7ef31e59921e0e82d2d40a, Linux 3401f964028ac941425b9b2c8ff8a022539ef44a, Linux 8b12a020b20a78f62bedc50f26db3bf4fadf8cb9, Linux 1118b2049d77ca0b505775fc1a8d1909cf19a7ec. Upgrade Linux to 1118b2049d77ca0b505775fc1a8d1909cf19a7ec or later.

### How do I check if I'm affected by CVE-2022-49871?

Find where you use the affected software (dependency lockfiles, installed packages, container images, servers) and compare the installed version with the affected range above. The agent prompt on this page does this read-only.

## References

- patch: <https://git.kernel.org/stable/c/223ef6a94e52331a6a7ef31e59921e0e82d2d40a>
- patch: <https://git.kernel.org/stable/c/a4f73f6adc53fd7a3f9771cbc89a03ef39b0b755>
- patch: <https://git.kernel.org/stable/c/3401f964028ac941425b9b2c8ff8a022539ef44a>
- patch: <https://git.kernel.org/stable/c/d7569302a7a52a9305d2fb054df908ff985553bb>
- patch: <https://git.kernel.org/stable/c/8b12a020b20a78f62bedc50f26db3bf4fadf8cb9>
- patch: <https://git.kernel.org/stable/c/1118b2049d77ca0b505775fc1a8d1909cf19a7ec>

## Attribution

- CVE Program: CVE® is a registered trademark of The MITRE Corporation. CVE records © 1999–2026 The MITRE Corporation. <https://www.cve.org/Legal/TermsOfUse>
- NVD: This product uses data from the NVD API but is not endorsed or certified by the NVD. <https://nvd.nist.gov/vuln/detail/CVE-2022-49871>

HTML: <https://flawdb.com/CVE-2022-49871> · JSON: <https://flawdb.com/api/v1/entries/CVE-2022-49871>
