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

- Severity: Medium 5.5 (CVSS:3.1, scored by NVD) `CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:N/I:N/A:H`
- Known to be exploited: not in CISA's catalogue, which lists only what CISA has confirmed
- Likelihood of exploitation in the next 30 days (EPSS): 0.21%, higher than 11% of CVEs (2026-12-01)
- Published: 2025-05-01T14:09:30.971Z
- Modified: 2026-11-05T20:17:12.897Z
- Weaknesses: CWE-401
- SSVC (CISA-ADP): exploitation none, automatable no, technical impact partial
- Assigned by: Linux

## 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().

(As written by CVE List.)

## Affected

- Linux Linux: from d3cbb907ae57fe5da314b51d949b617b538bdeae before 7d79725a7073d86b9185f87718e22f3d65115801; from d3cbb907ae57fe5da314b51d949b617b538bdeae before 6d463ddd0107d4188229d996dcdd45c99bad8af7; from d3cbb907ae57fe5da314b51d949b617b538bdeae before 207edad5717e0a5709ce8467f0eff41c607835c9; from d3cbb907ae57fe5da314b51d949b617b538bdeae before 064bc7312bd09a48798418663090be0c776183db; 5.7 (not affected: before 5.7; from 5.10.260 up to 5.10.*; from 5.15.209 up to 5.15.*; from 6.0.10 up to 6.0.*; from 6.1 up to *)
- linux linux_kernel: from 5.7 before 6.0.10; 6.1

## References

- <https://git.kernel.org/stable/c/7d79725a7073d86b9185f87718e22f3d65115801>
- <https://git.kernel.org/stable/c/6d463ddd0107d4188229d996dcdd45c99bad8af7>
- <https://git.kernel.org/stable/c/207edad5717e0a5709ce8467f0eff41c607835c9> (patch)
- <https://git.kernel.org/stable/c/064bc7312bd09a48798418663090be0c776183db> (patch)

## Sources

- CVE List: [CVE-2022-49803](https://www.cve.org/CVERecord?id=CVE-2022-49803), CVE Terms of Use, modified 2026-11-05
- NVD: [CVE-2022-49803](https://nvd.nist.gov/vuln/detail/CVE-2022-49803), Public domain, modified 2026-11-05

---

Page: https://cve.day/CVE-2022-49803 · Whole record: https://cve.day/CVE-2022-49803.json · Rebuilt by cve.day 2026-11-25T22:58:20.878Z
