CVE-2022-49803 netdevsim: Fix memory leak of nsim_dev->fa_cookie
A memory leak in the Linux kernel netdevsim driver allows local attackers to exhaust system memory, potentially causing a denial of service.
- Exploited in the wild
- Not known
- Login needed
- Any signed-in user
- Attackable
- Local or same network only
- Victim action needed
- Not needed
- Fix
- Available
What is CVE-2022-49803?
CVE-2022-49803 is a medium-severity memory corruption vulnerability in Linux kernel, published on 1 May 2025. It can only be exploited from the same machine or local network, with no action from the victim.
Official description
In the Linux kernel, the following vulnerability has been resolved:
netdevsim: Fix memory leak of nsim_dev->fa_cookie
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>] nsim_dev_trap_fa_cookie_write+0xc1/0x210 [netdevsim] [<0000000093d78e77>] full_proxy_write+0xf3/0x180 [<000000005a662c16>] vfs_write+0x1c5/0xaf0 [<000000007aabf84a>] ksys_write+0xed/0x1c0 [<000000005f1d2e47>] do_syscall_64+0x3b/0x90 [<000000006001c6ec>] entry_SYSCALL_64_after_hwframe+0x63/0xcd
The issue occurs in the following scenarios:
nsim_dev_trap_fa_cookie_write() kmalloc() fa_cookie nsim_dev->fa_cookie = fa_cookie .. nsim_drv_remove()
The fa_cookie allocked in nsim_dev_trap_fa_cookie_write() is not freed. To fix, add kfree(nsim_dev->fa_cookie) to nsim_drv_remove().
Weakness: CWE-401
Which versions are affected by CVE-2022-49803?
It affects 1 product.
Products include Linux kernel.
How do I fix CVE-2022-49803?
Apply the vendor's patch.
Upgrade to the fixed version. Memory-safe languages, compiler hardening and fuzzing prevent most new cases. More about Memory corruption.
Is CVE-2022-49803 being exploited?
There is no known exploitation of CVE-2022-49803 in the wild and no public exploit code.
Other vulnerabilities in Linux kernel
Sources
Also known as AZL-69785, DEBIAN-CVE-2022-49803, GHSA-whrx-8qvw-6p89, ROOT-OS-DEBIAN-11-CVE-2022-49803, ROOT-OS-UBUNTU-2204-CVE-2022-49803, UBUNTU-CVE-2022-49803.