CVE-2022-49803: netdevsim: Fix memory leak of nsim_dev->fa_cookie

Published May 1, 2025
·
Updated

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

netdevsim: Fix memory leak of nsimdev->facookie

kmemleak reports this issue:

unreferenced object 0xffff8881bac872d0 (size 8): comm "sh", pid 58603, jiffies 4481524462 (age 68.065s) hex dump (first 8 bytes): 04 00 00 00 de ad be ef ........ backtrace: [<00000000c80b8577>] kmalloc+0x49/0x150 [<000000005292b8c6>] nsimdevtrapfacookiewrite+0xc1/0x210 [netdevsim] [<0000000093d78e77>] fullproxywrite+0xf3/0x180 [<000000005a662c16>] vfswrite+0x1c5/0xaf0 [<000000007aabf84a>] ksyswrite+0xed/0x1c0 [<000000005f1d2e47>] dosyscall64+0x3b/0x90 [<000000006001c6ec>] entrySYSCALL64afterhwframe+0x63/0xcd

The issue occurs in the following scenarios:

nsimdevtrapfacookiewrite() kmalloc() facookie nsimdev->facookie = facookie .. nsimdrvremove()

The facookie allocked in nsimdevtrapfacookiewrite() is not freed. To fix, add kfree(nsimdev->facookie) to nsimdrvremove().

Affected Software

7 affected components
Linux Linux kernel
Linux Linux kernel>=5.7<6.0.10
Linux Linux kernel=6.1-rc1
Linux Linux kernel=6.1-rc2
Linux Linux kernel=6.1-rc3
Linux Linux kernel=6.1-rc4
Linux Linux kernel=6.1-rc5

Remediation

Recommended actions to resolve this vulnerability, in priority order.

  1. Operational

    Apply the kernel fix: add `kfree(nsim_dev->fa_cookie)` to `nsim_drv_remove()` to free the `fa_cookie` allocated in `nsim_dev_trap_fa_cookie_write()` (reported by kmemleak as `netdevsim: Fix memory leak of nsim_dev->fa_cookie`).

Event History

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

Frequently Asked Questions

1

Who is exposed to this issue?

Systems using the Linux kernel netdevsim component are exposed when a trap FA cookie is written through nsim_dev_trap_fa_cookie_write() and the simulated device is later removed.

2

What does an attacker or user need to do to trigger the leak?

A local user with the privileges needed to write the netdevsim trap FA cookie interface can trigger an allocation of fa_cookie. Removing the netdevsim device afterward leaves that allocation unfreed in affected kernels.

3

What is the impact of successful exploitation?

The issue is a kernel memory leak of the allocated fa_cookie object. Repeated triggering can consume kernel memory and affect system availability.

4

What can be done if the fix cannot be applied immediately?

Avoid writing the netdevsim trap FA cookie interface, or avoid using and removing netdevsim devices after such writes. Restrict local access to the relevant netdevsim interfaces.

5

How can administrators identify the issue?

Kernel memory-leak detection may report an unreferenced allocation originating from nsim_dev_trap_fa_cookie_write(), with a backtrace through __kmalloc and full_proxy_write. The leak occurs when the netdevsim device removal path does not free nsim_dev->fa_cookie.

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