# CVE-2024-53095: smb: client: Fix use-after-free of network namespace.

> Archived entry. Full-text search covers entries since 2026-11-10; exact IDs work for all years.

- **Severity:** CRITICAL 9.8
- **CVSS:** 9.8 (v3.1, CNA) `CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H`
- **CVSS metrics:** Attack vector: Network; Attack complexity: Low; Privileges required: None; User interaction: None; Scope: Unchanged; Confidentiality impact: High; Integrity impact: High; Availability impact: High
- **Exploited in the wild:** Not in CISA KEV
- **Public exploit / PoC:** None known
- **Remote exploitation:** Remote, no login needed
- **EPSS:** 0.82% (percentile 55, 2026-11-28)
- **CWE:** CWE-416
- **Published:** 2024-11-21T18:17:11.372Z
- **Modified:** 2026-10-30T13:17:43.043Z

## Who should check

- Anyone running Linux \>= 26abe14379f8e2fa3fd1bcf97c9a7ad9364886fe, \< 7e487bbab951f15113edc5061bedf1d4aaf834eb; \>= 26abe14379f8e2fa3fd1bcf97c9a7ad9364886fe, \< e8c71494181153a134c96da28766a57bd1eac8cb; \>= 26abe14379f8e2fa3fd1bcf97c9a7ad9364886fe, \< c7f9282fc27fc36dbaffc8527c723de264a132f8; \>= 26abe14379f8e2fa3fd1bcf97c9a7ad9364886fe, \< ef7134c7fc48e1441b398e55a862232868a6f0a7
- Anyone running Linux 4.2

## Description

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

smb: client: Fix use-after-free of network namespace.

Recently, we got a customer report that CIFS triggers oops while
reconnecting to a server.  \[0\]

The workload runs on Kubernetes, and some pods mount CIFS servers
in non-root network namespaces.  The problem rarely happened, but
it was always while the pod was dying.

The root cause is wrong reference counting for network namespace.

CIFS uses kernel sockets, which do not hold refcnt of the netns that
the socket belongs to.  That means CIFS must ensure the socket is
always freed before its netns; otherwise, use-after-free happens.

The repro steps are roughly:

  1. mount CIFS in a non-root netns
  2. drop packets from the netns
  3. destroy the netns
  4. unmount CIFS

We can reproduce the issue quickly with the script \[1\] below and see
the splat \[2\] if CONFIG\_NET\_NS\_REFCNT\_TRACKER is enabled.

When the socket is TCP, it is hard to guarantee the netns lifetime
without holding refcnt due to async timers.

Let's hold netns refcnt for each socket as done for SMC in commit
9744d2bf1976 ("smc: Fix use-after-free in tcp\_write\_timer\_handler().").

Note that we need to move put\_net() from cifs\_put\_tcp\_session() to
clean\_demultiplex\_info(); otherwise, \_\_sock\_create() still could touch a
freed netns while cifsd tries to reconnect from cifs\_demultiplex\_thread().

Also, maybe\_get\_net() cannot be put just before \_\_sock\_create() because
the code is not under RCU and there is a small chance that the same
address happened to be reallocated to another netns.

\[0\]:
CIFS: VFS: \\\\XXXXXXXXXXX has not responded in 15 seconds. Reconnecting...
CIFS: Serverclose failed 4 times, giving up
Unable to handle kernel paging request at virtual address 14de99e461f84a07
Mem abort info:
  ESR = 0x0000000096000004
  EC = 0x25: DABT (current EL), IL = 32 bits
  SET = 0, FnV = 0
  EA = 0, S1PTW = 0
  FSC = 0x04: level 0 translation fault
Data abort info:
  ISV = 0, ISS = 0x00000004
  CM = 0, WnR = 0
\[14de99e461f84a07\] address between user and kernel address ranges
Internal error: Oops: 0000000096000004 \[\#1\] SMP
Modules linked in: cls\_bpf sch\_ingress nls\_utf8 cifs cifs\_arc4 cifs\_md4 dns\_resolver tcp\_diag inet\_diag veth xt\_state xt\_connmark nf\_conntrack\_netlink xt\_nat xt\_statistic xt\_MASQUERADE xt\_mark xt\_addrtype ipt\_REJECT nf\_reject\_ipv4 nft\_chain\_nat nf\_nat xt\_conntrack nf\_conntrack nf\_defrag\_ipv6 nf\_defrag\_ipv4 xt\_comment nft\_compat nf\_tables nfnetlink overlay nls\_ascii nls\_cp437 sunrpc vfat fat aes\_ce\_blk aes\_ce\_cipher ghash\_ce sm4\_ce\_cipher sm4 sm3\_ce sm3 sha3\_ce sha512\_ce sha512\_arm64 sha1\_ce ena button sch\_fq\_codel loop fuse configfs dmi\_sysfs sha2\_ce sha256\_arm64 dm\_mirror dm\_region\_hash dm\_log dm\_mod dax efivarfs
CPU: 5 PID: 2690970 Comm: cifsd Not tainted 6.1.103-109.184.amzn2023.aarch64 \#1
Hardware name: Amazon EC2 r7g.4xlarge/, BIOS 1.0 11/1/2018
pstate: 00400005 (nzcv daif +PAN -UAO -TCO -DIT -SSBS BTYPE=--)
pc : fib\_rules\_lookup+0x44/0x238
lr : \_\_fib\_lookup+0x64/0xbc
sp : ffff8000265db790
x29: ffff8000265db790 x28: 0000000000000000 x27: 000000000000bd01
x26: 0000000000000000 x25: ffff000b4baf8000 x24: ffff00047b5e4580
x23: ffff8000265db7e0 x22: 0000000000000000 x21: ffff00047b5e4500
x20: ffff0010e3f694f8 x19: 14de99e461f849f7 x18: 0000000000000000
x17: 0000000000000000 x16: 0000000000000000 x15: 0000000000000000
x14: 0000000000000000 x13: 0000000000000000 x12: 3f92800abd010002
x11: 0000000000000001 x10: ffff0010e3f69420 x9 : ffff800008a6f294
x8 : 0000000000000000 x7 : 0000000000000006 x6 : 0000000000000000
x5 : 0000000000000001 x4 : ffff001924354280 x3 : ffff8000265db7e0
x2 : 0000000000000000 x1 : ffff0010e3f694f8 x0 : ffff00047b5e4500
Call trace:
 fib\_rules\_lookup+0x44/0x238
 \_\_fib\_lookup+0x64/0xbc
 ip\_route\_output\_key\_hash\_rcu+0x2c4/0x398
 ip\_route\_output\_key\_hash+0x60/0x8c
 tcp\_v4\_connect+0x290/0x488
 \_\_inet\_stream\_connect+0x108/0x3d0
 inet\_stream\_connect+0x50/0x78
 kernel\_connect+0x6c/0xac
 generic\_ip\_conne
---truncated---

## Affected and fixed versions

- Linux: \>= 26abe14379f8e2fa3fd1bcf97c9a7ad9364886fe, \< 7e487bbab951f15113edc5061bedf1d4aaf834eb; \>= 26abe14379f8e2fa3fd1bcf97c9a7ad9364886fe, \< e8c71494181153a134c96da28766a57bd1eac8cb; \>= 26abe14379f8e2fa3fd1bcf97c9a7ad9364886fe, \< c7f9282fc27fc36dbaffc8527c723de264a132f8; \>= 26abe14379f8e2fa3fd1bcf97c9a7ad9364886fe, \< ef7134c7fc48e1441b398e55a862232868a6f0a7 (cvelist)
- Linux: 4.2 (cvelist)

## Mitigation

- No fix listed yet: follow the vendor advisory.

## Check your systems with an agent

Paste this into a coding agent:

```text
Check whether anything I run is affected by CVE-2024-53095. Work read-only: do not install, upgrade, delete or change anything.

Details: https://flawdb.com/CVE-2024-53095.md
Affected: Linux >= 26abe14379f8e2fa3fd1bcf97c9a7ad9364886fe, < 7e487bbab951f15113edc5061bedf1d4aaf834eb; >= 26abe14379f8e2fa3fd1bcf97c9a7ad9364886fe, < e8c71494181153a134c96da28766a57bd1eac8cb; >= 26abe14379f8e2fa3fd1bcf97c9a7ad9364886fe, < c7f9282fc27fc36dbaffc8527c723de264a132f8; >= 26abe14379f8e2fa3fd1bcf…
Fixed in: Linux 7e487bbab951f15113edc5061bedf1d4aaf834eb

Steps:
1. Search this machine and project for Linux: dependency manifests and lockfiles, installed packages, container images and running services.
2. For each match, note the installed version and whether it is inside the affected range.
3. Report a table: location, installed version, affected (yes / no / unsure), evidence. If affected, say which fixed version or mitigation from the details link applies, but don't apply it.
```

## FAQ

### Is CVE-2024-53095 being exploited?

There is no confirmed exploitation: CVE-2024-53095 is not in the CISA Known Exploited Vulnerabilities catalog. No public exploit code is known. EPSS estimates a 0.82% chance of exploitation in the next 30 days (as of 2026-11-28).

### How serious is CVE-2024-53095?

Critical: CVSS 9.8 (v3.1, scored by CNA). Remote, no login needed.

### Which versions are affected by CVE-2024-53095?

Linux \>= 26abe14379f8e2fa3fd1bcf97c9a7ad9364886fe, \< 7e487bbab951f15113edc5061bedf1d4aaf834eb; \>= 26abe14379f8e2fa3fd1bcf97c9a7ad9364886fe, \< e8c71494181153a134c96da28766a57bd1eac8cb; \>= 26abe14379f8e2fa3fd1bcf97c9a7ad9364886fe, \< c7f9282fc27fc36dbaffc8527c723de264a132f8; \>= 26abe14379f8e2fa3fd1bcf97c9a7ad9364886fe, \< ef7134c7fc48e1441b398e55a862232868a6f0a7; Linux 4.2.

### Is there a fix for CVE-2024-53095?

Yes. Fixed in Linux 7e487bbab951f15113edc5061bedf1d4aaf834eb. No fix listed yet: follow the vendor advisory.

### How do I check if I'm affected by CVE-2024-53095?

Find where you use the affected software (dependency lockfiles, installed packages, container images, servers) and compare the installed version with the affected range above. The agent prompt on this page does this read-only.

## References

- patch: <https://git.kernel.org/stable/c/e8c71494181153a134c96da28766a57bd1eac8cb>
- patch: <https://git.kernel.org/stable/c/c7f9282fc27fc36dbaffc8527c723de264a132f8>
- patch: <https://git.kernel.org/stable/c/ef7134c7fc48e1441b398e55a862232868a6f0a7>
- other: <https://git.kernel.org/stable/c/7e487bbab951f15113edc5061bedf1d4aaf834eb>

## Attribution

- CVE Program: CVE® is a registered trademark of The MITRE Corporation. CVE records © 1999–2026 The MITRE Corporation. <https://www.cve.org/Legal/TermsOfUse>
- NVD: This product uses data from the NVD API but is not endorsed or certified by the NVD. <https://nvd.nist.gov/vuln/detail/CVE-2024-53095>

HTML: <https://flawdb.com/CVE-2024-53095> · JSON: <https://flawdb.com/api/v1/entries/CVE-2024-53095>
