# CVE-2025-23143: net: Fix null-ptr-deref by sock\_lock\_init\_class\_and\_name() and rmmod.

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

- **Severity:** MEDIUM 5.5
- **CVSS:** 5.5 (v3.1, NVD) `CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:N/I:N/A:H`
- **CVSS metrics:** Attack vector: Local; Attack complexity: Low; Privileges required: Low; User interaction: None; Scope: Unchanged; Confidentiality impact: None; Integrity impact: None; Availability impact: High
- **Exploited in the wild:** Not in CISA KEV
- **Public exploit / PoC:** None known
- **Remote exploitation:** Not remotely exploitable (local or adjacent access needed)
- **EPSS:** 0.32% (percentile 17, 2026-11-26)
- **CWE:** CWE-476
- **Published:** 2025-05-01T12:55:33.348Z
- **Modified:** 2026-11-10T13:17:43.627Z

## Who should check

- Anyone running Linux \>= ed07536ed6731775219c1df7fa26a7588753e693, \< 83083c5fc7cf9b0f136a42f26aba60da380f3601; \>= ed07536ed6731775219c1df7fa26a7588753e693, \< b7489b753667bc9245958a4896c9419743083c27; \>= ed07536ed6731775219c1df7fa26a7588753e693, \< d51e47e2ab6ef10a317d576075cf625cdbf96426; \>= ed07536ed6731775219c1df7fa26a7588753e693, \< feda73ad44a5cc80f6bf796bb1099a3fe71576d4; \>= ed07536ed6731775219c1df7fa26a7588753e693, \< 905d43b8ad2436c240f844acb3ebcc7a99b8ebf1; \>= ed07536ed6731775219c1df7fa26a7588753e693, \< 5f7f6abd92b6c8dc8f19625ef93c3a18549ede04; \>= ed07536ed6731775219c1df7fa26a7588753e693, \< c11247a21aab4b50a23c8b696727d7483de2f1e1; \>= ed07536ed6731775219c1df7fa26a7588753e693, \< 2155802d3313d7b8365935c6b8d6edc0ddd7eb94; \>= ed07536ed6731775219c1df7fa26a7588753e693, \< 0bb2f7a1ad1f11d861f58e5ee5051c8974ff9569
- Anyone running Linux 2.6.20

## Description

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

net: Fix null-ptr-deref by sock\_lock\_init\_class\_and\_name() and rmmod.

When I ran the repro \[0\] and waited a few seconds, I observed two
LOCKDEP splats: a warning immediately followed by a null-ptr-deref. \[1\]

Reproduction Steps:

  1) Mount CIFS
  2) Add an iptables rule to drop incoming FIN packets for CIFS
  3) Unmount CIFS
  4) Unload the CIFS module
  5) Remove the iptables rule

At step 3), the CIFS module calls sock\_release() for the underlying
TCP socket, and it returns quickly.  However, the socket remains in
FIN\_WAIT\_1 because incoming FIN packets are dropped.

At this point, the module's refcnt is 0 while the socket is still
alive, so the following rmmod command succeeds.

  \# ss -tan
  State      Recv-Q Send-Q Local Address:Port  Peer Address:Port
  FIN-WAIT-1 0      477        10.0.2.15:51062   10.0.0.137:445

  \# lsmod \| grep cifs
  cifs                 1159168  0

This highlights a discrepancy between the lifetime of the CIFS module
and the underlying TCP socket.  Even after CIFS calls sock\_release()
and it returns, the TCP socket does not die immediately in order to
close the connection gracefully.

While this is generally fine, it causes an issue with LOCKDEP because
CIFS assigns a different lock class to the TCP socket's sk-\>sk\_lock
using sock\_lock\_init\_class\_and\_name().

Once an incoming packet is processed for the socket or a timer fires,
sk-\>sk\_lock is acquired.

Then, LOCKDEP checks the lock context in check\_wait\_context(), where
hlock\_class() is called to retrieve the lock class.  However, since
the module has already been unloaded, hlock\_class() logs a warning
and returns NULL, triggering the null-ptr-deref.

If LOCKDEP is enabled, we must ensure that a module calling
sock\_lock\_init\_class\_and\_name() (CIFS, NFS, etc) cannot be unloaded
while such a socket is still alive to prevent this issue.

Let's hold the module reference in sock\_lock\_init\_class\_and\_name()
and release it when the socket is freed in sk\_prot\_free().

Note that sock\_lock\_init() clears sk-\>sk\_owner for svc\_create\_socket()
that calls sock\_lock\_init\_class\_and\_name() for a listening socket,
which clones a socket by sk\_clone\_lock() without GFP\_ZERO.

\[0\]:
CIFS\_SERVER="10.0.0.137"
CIFS\_PATH="//${CIFS\_SERVER}/Users/Administrator/Desktop/CIFS\_TEST"
DEV="enp0s3"
CRED="/root/WindowsCredential.txt"

MNT=$(mktemp -d /tmp/XXXXXX)
mount -t cifs ${CIFS\_PATH} ${MNT} -o vers=3.0,credentials=${CRED},cache=none,echo\_interval=1

iptables -A INPUT -s ${CIFS\_SERVER} -j DROP

for i in $(seq 10);
do
    umount ${MNT}
    rmmod cifs
    sleep 1
done

rm -r ${MNT}

iptables -D INPUT -s ${CIFS\_SERVER} -j DROP

\[1\]:
DEBUG\_LOCKS\_WARN\_ON(1)
WARNING: CPU: 10 PID: 0 at kernel/locking/lockdep.c:234 hlock\_class (kernel/locking/lockdep.c:234 kernel/locking/lockdep.c:223)
Modules linked in: cifs\_arc4 nls\_ucs2\_utils cifs\_md4 \[last unloaded: cifs\]
CPU: 10 UID: 0 PID: 0 Comm: swapper/10 Not tainted 6.14.0 \#36
Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS rel-1.16.0-0-gd239552ce722-prebuilt.qemu.org 04/01/2014
RIP: 0010:hlock\_class (kernel/locking/lockdep.c:234 kernel/locking/lockdep.c:223)
...
Call Trace:
 \<IRQ\>
 \_\_lock\_acquire (kernel/locking/lockdep.c:4853 kernel/locking/lockdep.c:5178)
 lock\_acquire (kernel/locking/lockdep.c:469 kernel/locking/lockdep.c:5853 kernel/locking/lockdep.c:5816)
 \_raw\_spin\_lock\_nested (kernel/locking/spinlock.c:379)
 tcp\_v4\_rcv (./include/linux/skbuff.h:1678 ./include/net/tcp.h:2547 net/ipv4/tcp\_ipv4.c:2350)
...

BUG: kernel NULL pointer dereference, address: 00000000000000c4
 PF: supervisor read access in kernel mode
 PF: error\_code(0x0000) - not-present page
PGD 0
Oops: Oops: 0000 \[\#1\] PREEMPT SMP NOPTI
CPU: 10 UID: 0 PID: 0 Comm: swapper/10 Tainted: G        W          6.14.0 \#36
Tainted: \[W\]=WARN
Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS rel-1.16.0-0-gd239552ce722-prebuilt.qemu.org 04/01/2014
RIP: 0010:\_\_lock\_acquire (kernel/
---truncated---

## Affected and fixed versions

- Linux: \>= ed07536ed6731775219c1df7fa26a7588753e693, \< 83083c5fc7cf9b0f136a42f26aba60da380f3601; \>= ed07536ed6731775219c1df7fa26a7588753e693, \< b7489b753667bc9245958a4896c9419743083c27; \>= ed07536ed6731775219c1df7fa26a7588753e693, \< d51e47e2ab6ef10a317d576075cf625cdbf96426; \>= ed07536ed6731775219c1df7fa26a7588753e693, \< feda73ad44a5cc80f6bf796bb1099a3fe71576d4; \>= ed07536ed6731775219c1df7fa26a7588753e693, \< 905d43b8ad2436c240f844acb3ebcc7a99b8ebf1; \>= ed07536ed6731775219c1df7fa26a7588753e693, \< 5f7f6abd92b6c8dc8f19625ef93c3a18549ede04; \>= ed07536ed6731775219c1df7fa26a7588753e693, \< c11247a21aab4b50a23c8b696727d7483de2f1e1; \>= ed07536ed6731775219c1df7fa26a7588753e693, \< 2155802d3313d7b8365935c6b8d6edc0ddd7eb94; \>= ed07536ed6731775219c1df7fa26a7588753e693, \< 0bb2f7a1ad1f11d861f58e5ee5051c8974ff9569 (cvelist)
- Linux: 2.6.20 (cvelist)

## Mitigation

- Upgrade Linux to 0bb2f7a1ad1f11d861f58e5ee5051c8974ff9569 or later.

## Check your systems with an agent

Paste this into a coding agent:

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

Details: https://flawdb.com/CVE-2025-23143.md
Affected: Linux >= ed07536ed6731775219c1df7fa26a7588753e693, < 83083c5fc7cf9b0f136a42f26aba60da380f3601; >= ed07536ed6731775219c1df7fa26a7588753e693, < b7489b753667bc9245958a4896c9419743083c27; >= ed07536ed6731775219c1df7fa26a7588753e693, < d51e47e2ab6ef10a317d576075cf625cdbf96426; >= ed07536ed6731775219c1df…
Fixed in: Linux 83083c5fc7cf9b0f136a42f26aba60da380f3601, Linux 905d43b8ad2436c240f844acb3ebcc7a99b8ebf1, Linux 5f7f6abd92b6c8dc8f19625ef93c3a18549ede04, Linux 2155802d3313d7b8365935c6b8d6edc0ddd7eb94, Linux 0bb2f7a1ad1f11d861f58e5ee5051c8974ff9569

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-2025-23143 being exploited?

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

### How serious is CVE-2025-23143?

Medium: CVSS 5.5 (v3.1, scored by NVD). Not remotely exploitable (local or adjacent access needed).

### Which versions are affected by CVE-2025-23143?

Linux \>= ed07536ed6731775219c1df7fa26a7588753e693, \< 83083c5fc7cf9b0f136a42f26aba60da380f3601; \>= ed07536ed6731775219c1df7fa26a7588753e693, \< b7489b753667bc9245958a4896c9419743083c27; \>= ed07536ed6731775219c1df7fa26a7588753e693, \< d51e47e2ab6ef10a317d576075cf625cdbf96426; \>= ed07536ed6731775219c1df7fa26a7588753e693, \< feda73ad44a5cc80f6bf796bb1099a3fe71576d4; \>= ed07536ed6731775219c1df7fa26a7588753e693, \< 905d43b8ad2436c240f844acb3ebcc7a99b8ebf1; \>= ed07536ed6731775219c1df7fa26a7588753e693, \< 5f7f6abd92b6c8dc8f19625ef93c3a18549ede04; \>= ed07536ed6731775219c1df7fa26a7588753e693, \< c11247a21aab4b50a23c8b696727d7483de2f1e1; \>= ed07536ed6731775219c1df7fa26a7588753e693, \< 2155802d3313d7b8365935c6b8d6edc0ddd7eb94; \>= ed07536ed6731775219c1df7fa26a7588753e693, \< 0bb2f7a1ad1f11d861f58e5ee5051c8974ff9569; Linux 2.6.20.

### Is there a fix for CVE-2025-23143?

Yes. Fixed in Linux 83083c5fc7cf9b0f136a42f26aba60da380f3601, Linux 905d43b8ad2436c240f844acb3ebcc7a99b8ebf1, Linux 5f7f6abd92b6c8dc8f19625ef93c3a18549ede04, Linux 2155802d3313d7b8365935c6b8d6edc0ddd7eb94, Linux 0bb2f7a1ad1f11d861f58e5ee5051c8974ff9569. Upgrade Linux to 0bb2f7a1ad1f11d861f58e5ee5051c8974ff9569 or later.

### How do I check if I'm affected by CVE-2025-23143?

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/83083c5fc7cf9b0f136a42f26aba60da380f3601>
- patch: <https://git.kernel.org/stable/c/b7489b753667bc9245958a4896c9419743083c27>
- patch: <https://git.kernel.org/stable/c/d51e47e2ab6ef10a317d576075cf625cdbf96426>
- patch: <https://git.kernel.org/stable/c/feda73ad44a5cc80f6bf796bb1099a3fe71576d4>
- patch: <https://git.kernel.org/stable/c/905d43b8ad2436c240f844acb3ebcc7a99b8ebf1>
- patch: <https://git.kernel.org/stable/c/5f7f6abd92b6c8dc8f19625ef93c3a18549ede04>
- patch: <https://git.kernel.org/stable/c/c11247a21aab4b50a23c8b696727d7483de2f1e1>
- patch: <https://git.kernel.org/stable/c/2155802d3313d7b8365935c6b8d6edc0ddd7eb94>
- patch: <https://git.kernel.org/stable/c/0bb2f7a1ad1f11d861f58e5ee5051c8974ff9569>
- other: <https://lists.debian.org/debian-lts-announce/2025/10/msg00008.html>
- other: <https://cert-portal.siemens.com/productcert/html/ssa-032379.html>
- other: <https://cert-portal.siemens.com/productcert/html/ssa-019113.html>
- other: <https://cert-portal.siemens.com/productcert/html/ssa-457936.html>

## 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-2025-23143>

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