# CVE-2025-21884: net: better track kernel sockets lifetime

- Severity: High 7.8 (CVSS:3.1, scored by Linux) `CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/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.22%, higher than 12% of CVEs (2026-12-01)
- Published: 2025-03-27T14:57:12.486Z
- Modified: 2026-10-15T22:18:10.910Z
- SSVC (CISA-ADP): exploitation none, automatable no, technical impact total
- Assigned by: Linux

## Description

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

net: better track kernel sockets lifetime

While kernel sockets are dismantled during pernet_operations->exit(),
their freeing can be delayed by any tx packets still held in qdisc
or device queues, due to skb_set_owner_w() prior calls.

This then trigger the following warning from ref_tracker_dir_exit() [1]

To fix this, make sure that kernel sockets own a reference on net->passive.

Add sk_net_refcnt_upgrade() helper, used whenever a kernel socket
is converted to a refcounted one.

[1]

[  136.263918][   T35] ref_tracker: net notrefcnt@ffff8880638f01e0 has 1/2 users at
[  136.263918][   T35]      sk_alloc+0x2b3/0x370
[  136.263918][   T35]      inet6_create+0x6ce/0x10f0
[  136.263918][   T35]      __sock_create+0x4c0/0xa30
[  136.263918][   T35]      inet_ctl_sock_create+0xc2/0x250
[  136.263918][   T35]      igmp6_net_init+0x39/0x390
[  136.263918][   T35]      ops_init+0x31e/0x590
[  136.263918][   T35]      setup_net+0x287/0x9e0
[  136.263918][   T35]      copy_net_ns+0x33f/0x570
[  136.263918][   T35]      create_new_namespaces+0x425/0x7b0
[  136.263918][   T35]      unshare_nsproxy_namespaces+0x124/0x180
[  136.263918][   T35]      ksys_unshare+0x57d/0xa70
[  136.263918][   T35]      __x64_sys_unshare+0x38/0x40
[  136.263918][   T35]      do_syscall_64+0xf3/0x230
[  136.263918][   T35]      entry_SYSCALL_64_after_hwframe+0x77/0x7f
[  136.263918][   T35]
[  136.343488][   T35] ref_tracker: net notrefcnt@ffff8880638f01e0 has 1/2 users at
[  136.343488][   T35]      sk_alloc+0x2b3/0x370
[  136.343488][   T35]      inet6_create+0x6ce/0x10f0
[  136.343488][   T35]      __sock_create+0x4c0/0xa30
[  136.343488][   T35]      inet_ctl_sock_create+0xc2/0x250
[  136.343488][   T35]      ndisc_net_init+0xa7/0x2b0
[  136.343488][   T35]      ops_init+0x31e/0x590
[  136.343488][   T35]      setup_net+0x287/0x9e0
[  136.343488][   T35]      copy_net_ns+0x33f/0x570
[  136.343488][   T35]      create_new_namespaces+0x425/0x7b0
[  136.343488][   T35]      unshare_nsproxy_namespaces+0x124/0x180
[  136.343488][   T35]      ksys_unshare+0x57d/0xa70
[  136.343488][   T35]      __x64_sys_unshare+0x38/0x40
[  136.343488][   T35]      do_syscall_64+0xf3/0x230
[  136.343488][   T35]      entry_SYSCALL_64_after_hwframe+0x77/0x7f

(As written by CVE List.)

## Affected

- Linux Linux: from 0cafd77dcd032d1687efaba5598cf07bce85997f before 2668e038800b946d269f96ec1b258c01930a242c; from 0cafd77dcd032d1687efaba5598cf07bce85997f before 4ceb0bd4ffd009821b585ce6a8033b12b59fb5fb; from 0cafd77dcd032d1687efaba5598cf07bce85997f before c31a732fac46b00b95b78fcc9c37cb48dd6f2e0c; from 0cafd77dcd032d1687efaba5598cf07bce85997f before 5c70eb5c593d64d93b178905da215a9fd288a4b5; 6.2 (not affected: before 6.2; from 6.6.103 up to 6.6.*; from 6.12.43 up to 6.12.*; from 6.13.6 up to 6.13.*; from 6.14 up to *)
- linux linux_kernel: from 6.2 before 6.6.103; from 6.7 before 6.12.43; from 6.13 before 6.13.6; 6.14

## Every score

- Linux: CVSS:3.1 7.8 High `CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H`
- NVD: CVSS:3.1 5.5 Medium `CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:N/I:N/A:H`

## References

- <https://git.kernel.org/stable/c/2668e038800b946d269f96ec1b258c01930a242c> (patch)
- <https://git.kernel.org/stable/c/4ceb0bd4ffd009821b585ce6a8033b12b59fb5fb> (patch)
- <https://git.kernel.org/stable/c/c31a732fac46b00b95b78fcc9c37cb48dd6f2e0c> (patch)
- <https://git.kernel.org/stable/c/5c70eb5c593d64d93b178905da215a9fd288a4b5> (patch)

## Sources

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

---

Page: https://cve.day/CVE-2025-21884 · Whole record: https://cve.day/CVE-2025-21884.json · Rebuilt by cve.day 2026-11-25T22:58:55.614Z
