CVE-2022-49871: net: tun: Fix memory leaks of napi_get_frags

Published May 1, 2025
·
Updated

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

net: tun: Fix memory leaks of napigetfrags

kmemleak reports after running testprogs:

unreferenced object 0xffff8881b1672dc0 (size 232): comm "testprogs", 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>] napiskbcacheget+0xd4/0x150 [<0000000041c7fc09>] napibuildskb+0x15/0x50 [<00000000431c7079>] napiallocskb+0x26e/0x540 [<000000003ecfa30e>] napigetfrags+0x59/0x140 [<0000000099b2199e>] tungetuser+0x183d/0x3bb0 [tun] [<000000008a5adef0>] tunchrwriteiter+0xc0/0x1b1 [tun] [<0000000049993ff4>] doiterreadvwritev+0x19f/0x320 [<000000008f338ea2>] doiterwrite+0x135/0x630 [<000000008a3377a4>] vfswritev+0x12e/0x440 [<00000000a6b5639a>] dowritev+0x104/0x280 [<00000000ccf065d8>] dosyscall64+0x3b/0x90 [<00000000d776e329>] entrySYSCALL64afterhwframe+0x63/0xcd

The issue occurs in the following scenarios: tungetuser() napigrofrags() napifragsfinish() case GRONORMAL: gronormalone() listaddtail(&skb->list, &napi->rxlist); <-- While napi->rxcount < READONCE(gronormalbatch), <-- gronormallist() is not called, napi->rxlist is not empty <-- not ask to complete the gro work, will cause memory leaks in <-- following tunnapidel() ... tunnapidel() netifnapidel() netifnapidel() <-- &napi->rxlist is not empty, which caused memory leaks

To fix, add napicomplete() after napigrofrags().

Affected Software

10 affected components
Linux Linux kernel
Linux Linux kernel>=4.15<4.19.267
Linux Linux kernel>=4.20<5.4.225
Linux Linux kernel>=5.5<5.10.155
Linux Linux kernel>=5.11<5.15.79
Linux Linux kernel>=5.16<6.0.9
Linux Linux kernel=6.1-rc1
Linux Linux kernel=6.1-rc2
Linux Linux kernel=6.1-rc3
Linux Linux kernel=6.1-rc4

Event History

May 1, 2025
CVE Published
via MITRE·02:10 PM
Data Sourced
via MITRE·02:10 PM
Description
Data Sourced
via NVD·03:16 PM
RemedyDescriptionSeverityWeaknessAffected Software

Frequently Asked Questions

1

What is the severity of CVE-2022-49871?

CVE-2022-49871 is classified as a high-severity vulnerability due to its impact on memory management within the Linux kernel.

2

How do I fix CVE-2022-49871?

To resolve CVE-2022-49871, update to the latest version of the Linux kernel where this vulnerability has been patched.

3

What type of vulnerability is CVE-2022-49871?

CVE-2022-49871 is a memory leak vulnerability affecting the net subsystem of the Linux kernel.

4

Which versions of the Linux kernel are affected by CVE-2022-49871?

CVE-2022-49871 affects specific versions of the Linux kernel prior to the fixed releases that address this memory leak issue.

5

What are the potential consequences of CVE-2022-49871?

The potential consequences of CVE-2022-49871 include increased memory usage and possible denial of service due to resource exhaustion.

Contact

SecAlerts Pty Ltd.
132 Wickham Terrace
Fortitude Valley,
QLD 4006, Australia
info@secalerts.co
By using SecAlerts services, you agree to our services end-user license agreement. This website is safeguarded by reCAPTCHA and governed by the Google Privacy Policy and Terms of Service. All names, logos, and brands of products are owned by their respective owners, and any usage of these names, logos, and brands for identification purposes only does not imply endorsement. If you possess any content that requires removal, please get in touch with us.
© 2026 SecAlerts Pty Ltd.
ABN: 70 645 966 203, ACN: 645 966 203