# CVE-2025-23143: net: Fix null-ptr-deref by sock_lock_init_class_and_name() and rmmod.

CVE-2025-23143 is fixed in 52 products on 1 platform, first by DEBIAN-CVE-2025-23143, released May 1, 2025. It is not reported as exploited. Patch Radar priority: Routine.

- Web page: https://patchblox.com/security/cve/CVE-2025-23143
- Priority: Routine
- CVSS: 6.4 (Moderate)
- EPSS: 0.0022
- CISA KEV: not listed
- Exploited (vendor report): no
- Publicly disclosed: no
- Published: May 1, 2025
- Weakness: NULL Pointer Dereference
- Vendor advisory: https://msrc.microsoft.com/update-guide/vulnerability/CVE-2025-23143

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

## Where it's fixed

| Platform | Product | Fixed in | Fix | Released |
|---|---|---|---|---|
| Linux | bpftool amzn 2023 | 1:6.1.153-175.280.amzn2023 | [ALAS2023-2025-1210](https://patchblox.com/security/data/fix/linux/alas2023-2025-1210.md) | Sep 24, 2025 |
| Linux | bpftool ol 8 | 0:5.15.0-315.196.5.1.el9uek | [ELSA-2025-28048](https://patchblox.com/security/data/fix/linux/elsa-2025-28048.md) | Dec 12, 2025 |
| Linux | bpftool ol 9 | 0:5.15.0-315.196.5.1.el9uek | [ELSA-2025-28048](https://patchblox.com/security/data/fix/linux/elsa-2025-28048.md) | Dec 12, 2025 |
| Linux | bpftool-debuginfo amzn 2023 | 1:6.1.153-175.280.amzn2023 | [ALAS2023-2025-1210](https://patchblox.com/security/data/fix/linux/alas2023-2025-1210.md) | Sep 24, 2025 |
| Linux | kernel amzn 2023 | 1:6.1.153-175.280.amzn2023 | [ALAS2023-2025-1210](https://patchblox.com/security/data/fix/linux/alas2023-2025-1210.md) | Sep 24, 2025 |
| Linux | kernel-debuginfo amzn 2023 | 1:6.1.153-175.280.amzn2023 | [ALAS2023-2025-1210](https://patchblox.com/security/data/fix/linux/alas2023-2025-1210.md) | Sep 24, 2025 |
| Linux | kernel-debuginfo-common-aarch64 amzn 2023 | 1:6.1.153-175.280.amzn2023 | [ALAS2023-2025-1210](https://patchblox.com/security/data/fix/linux/alas2023-2025-1210.md) | Sep 24, 2025 |
| Linux | kernel-debuginfo-common-x86_64 amzn 2023 | 1:6.1.153-175.280.amzn2023 | [ALAS2023-2025-1210](https://patchblox.com/security/data/fix/linux/alas2023-2025-1210.md) | Sep 24, 2025 |
| Linux | kernel-devel amzn 2023 | 1:6.1.153-175.280.amzn2023 | [ALAS2023-2025-1210](https://patchblox.com/security/data/fix/linux/alas2023-2025-1210.md) | Sep 24, 2025 |
| Linux | kernel-headers amzn 2023 | 1:6.1.153-175.280.amzn2023 | [ALAS2023-2025-1210](https://patchblox.com/security/data/fix/linux/alas2023-2025-1210.md) | Sep 24, 2025 |
| Linux | kernel-libbpf amzn 2023 | 1:6.1.153-175.280.amzn2023 | [ALAS2023-2025-1210](https://patchblox.com/security/data/fix/linux/alas2023-2025-1210.md) | Sep 24, 2025 |
| Linux | kernel-libbpf-debuginfo amzn 2023 | 1:6.1.153-175.280.amzn2023 | [ALAS2023-2025-1210](https://patchblox.com/security/data/fix/linux/alas2023-2025-1210.md) | Sep 24, 2025 |
| Linux | kernel-libbpf-devel amzn 2023 | 1:6.1.153-175.280.amzn2023 | [ALAS2023-2025-1210](https://patchblox.com/security/data/fix/linux/alas2023-2025-1210.md) | Sep 24, 2025 |
| Linux | kernel-libbpf-static amzn 2023 | 1:6.1.153-175.280.amzn2023 | [ALAS2023-2025-1210](https://patchblox.com/security/data/fix/linux/alas2023-2025-1210.md) | Sep 24, 2025 |
| Linux | kernel-livepatch-6.1.153-175.280 amzn 2023 | 1:1.0-0.amzn2023 | [ALAS2023-2025-1210](https://patchblox.com/security/data/fix/linux/alas2023-2025-1210.md) | Sep 24, 2025 |
| Linux | kernel-livepatch-6.12.25-32.101 amzn 2023 | 1.0-0.amzn2023 | [ALAS2023-2025-995](https://patchblox.com/security/data/fix/linux/alas2023-2025-995.md) | Jun 3, 2025 |
| Linux | kernel-modules-extra amzn 2023 | 1:6.1.153-175.280.amzn2023 | [ALAS2023-2025-1210](https://patchblox.com/security/data/fix/linux/alas2023-2025-1210.md) | Sep 24, 2025 |
| Linux | kernel-modules-extra-common amzn 2023 | 1:6.1.153-175.280.amzn2023 | [ALAS2023-2025-1210](https://patchblox.com/security/data/fix/linux/alas2023-2025-1210.md) | Sep 24, 2025 |
| Linux | kernel-tools amzn 2023 | 1:6.1.153-175.280.amzn2023 | [ALAS2023-2025-1210](https://patchblox.com/security/data/fix/linux/alas2023-2025-1210.md) | Sep 24, 2025 |
| Linux | kernel-tools-debuginfo amzn 2023 | 1:6.1.153-175.280.amzn2023 | [ALAS2023-2025-1210](https://patchblox.com/security/data/fix/linux/alas2023-2025-1210.md) | Sep 24, 2025 |
| Linux | kernel-tools-devel amzn 2023 | 1:6.1.153-175.280.amzn2023 | [ALAS2023-2025-1210](https://patchblox.com/security/data/fix/linux/alas2023-2025-1210.md) | Sep 24, 2025 |
| Linux | kernel-uek ol 8 | 0:5.15.0-315.196.5.1.el9uek | [ELSA-2025-28048](https://patchblox.com/security/data/fix/linux/elsa-2025-28048.md) | Dec 12, 2025 |
| Linux | kernel-uek ol 9 | 0:5.15.0-315.196.5.1.el9uek | [ELSA-2025-28048](https://patchblox.com/security/data/fix/linux/elsa-2025-28048.md) | Dec 12, 2025 |
| Linux | kernel-uek-container ol 8 | 0:5.15.0-315.196.5.1.el9uek | [ELSA-2025-28048](https://patchblox.com/security/data/fix/linux/elsa-2025-28048.md) | Dec 12, 2025 |
| Linux | kernel-uek-container ol 9 | 0:5.15.0-315.196.5.1.el9uek | [ELSA-2025-28048](https://patchblox.com/security/data/fix/linux/elsa-2025-28048.md) | Dec 12, 2025 |
| Linux | kernel-uek-container-debug ol 8 | 0:5.15.0-315.196.5.1.el9uek | [ELSA-2025-28048](https://patchblox.com/security/data/fix/linux/elsa-2025-28048.md) | Dec 12, 2025 |
| Linux | kernel-uek-container-debug ol 9 | 0:5.15.0-315.196.5.1.el9uek | [ELSA-2025-28048](https://patchblox.com/security/data/fix/linux/elsa-2025-28048.md) | Dec 12, 2025 |
| Linux | kernel-uek-core ol 8 | 0:5.15.0-315.196.5.1.el9uek | [ELSA-2025-28048](https://patchblox.com/security/data/fix/linux/elsa-2025-28048.md) | Dec 12, 2025 |
| Linux | kernel-uek-core ol 9 | 0:5.15.0-315.196.5.1.el9uek | [ELSA-2025-28048](https://patchblox.com/security/data/fix/linux/elsa-2025-28048.md) | Dec 12, 2025 |
| Linux | kernel-uek-debug ol 8 | 0:5.15.0-315.196.5.1.el9uek | [ELSA-2025-28048](https://patchblox.com/security/data/fix/linux/elsa-2025-28048.md) | Dec 12, 2025 |
| Linux | kernel-uek-debug ol 9 | 0:5.15.0-315.196.5.1.el9uek | [ELSA-2025-28048](https://patchblox.com/security/data/fix/linux/elsa-2025-28048.md) | Dec 12, 2025 |
| Linux | kernel-uek-debug-core ol 8 | 0:5.15.0-315.196.5.1.el9uek | [ELSA-2025-28048](https://patchblox.com/security/data/fix/linux/elsa-2025-28048.md) | Dec 12, 2025 |
| Linux | kernel-uek-debug-core ol 9 | 0:5.15.0-315.196.5.1.el9uek | [ELSA-2025-28048](https://patchblox.com/security/data/fix/linux/elsa-2025-28048.md) | Dec 12, 2025 |
| Linux | kernel-uek-debug-devel ol 8 | 0:5.15.0-315.196.5.1.el9uek | [ELSA-2025-28048](https://patchblox.com/security/data/fix/linux/elsa-2025-28048.md) | Dec 12, 2025 |
| Linux | kernel-uek-debug-devel ol 9 | 0:5.15.0-315.196.5.1.el9uek | [ELSA-2025-28048](https://patchblox.com/security/data/fix/linux/elsa-2025-28048.md) | Dec 12, 2025 |
| Linux | kernel-uek-debug-modules ol 8 | 0:5.15.0-315.196.5.1.el9uek | [ELSA-2025-28048](https://patchblox.com/security/data/fix/linux/elsa-2025-28048.md) | Dec 12, 2025 |
| Linux | kernel-uek-debug-modules ol 9 | 0:5.15.0-315.196.5.1.el9uek | [ELSA-2025-28048](https://patchblox.com/security/data/fix/linux/elsa-2025-28048.md) | Dec 12, 2025 |
| Linux | kernel-uek-debug-modules-extra ol 8 | 0:5.15.0-315.196.5.1.el9uek | [ELSA-2025-28048](https://patchblox.com/security/data/fix/linux/elsa-2025-28048.md) | Dec 12, 2025 |
| Linux | kernel-uek-debug-modules-extra ol 9 | 0:5.15.0-315.196.5.1.el9uek | [ELSA-2025-28048](https://patchblox.com/security/data/fix/linux/elsa-2025-28048.md) | Dec 12, 2025 |
| Linux | kernel-uek-devel ol 8 | 0:5.15.0-315.196.5.1.el9uek | [ELSA-2025-28048](https://patchblox.com/security/data/fix/linux/elsa-2025-28048.md) | Dec 12, 2025 |
| Linux | kernel-uek-devel ol 9 | 0:5.15.0-315.196.5.1.el9uek | [ELSA-2025-28048](https://patchblox.com/security/data/fix/linux/elsa-2025-28048.md) | Dec 12, 2025 |
| Linux | kernel-uek-doc ol 8 | 0:5.15.0-315.196.5.1.el9uek | [ELSA-2025-28048](https://patchblox.com/security/data/fix/linux/elsa-2025-28048.md) | Dec 12, 2025 |
| Linux | kernel-uek-doc ol 9 | 0:5.15.0-315.196.5.1.el9uek | [ELSA-2025-28048](https://patchblox.com/security/data/fix/linux/elsa-2025-28048.md) | Dec 12, 2025 |
| Linux | kernel-uek-modules ol 8 | 0:5.15.0-315.196.5.1.el9uek | [ELSA-2025-28048](https://patchblox.com/security/data/fix/linux/elsa-2025-28048.md) | Dec 12, 2025 |
| Linux | kernel-uek-modules ol 9 | 0:5.15.0-315.196.5.1.el9uek | [ELSA-2025-28048](https://patchblox.com/security/data/fix/linux/elsa-2025-28048.md) | Dec 12, 2025 |
| Linux | kernel-uek-modules-extra ol 8 | 0:5.15.0-315.196.5.1.el9uek | [ELSA-2025-28048](https://patchblox.com/security/data/fix/linux/elsa-2025-28048.md) | Dec 12, 2025 |
| Linux | kernel-uek-modules-extra ol 9 | 0:5.15.0-315.196.5.1.el9uek | [ELSA-2025-28048](https://patchblox.com/security/data/fix/linux/elsa-2025-28048.md) | Dec 12, 2025 |
| Linux | kernel-uek-tools ol 8 | 0:5.4.17-2136.350.3.1.el7uek | [ELSA-2025-28049](https://patchblox.com/security/data/fix/linux/elsa-2025-28049.md) | Dec 12, 2025 |
| Linux | kernel-uek64k ol 8 | 0:5.15.0-315.196.5.1.el9uek | [ELSA-2025-28048](https://patchblox.com/security/data/fix/linux/elsa-2025-28048.md) | Dec 12, 2025 |
| Linux | kernel-uek64k ol 9 | 0:5.15.0-315.196.5.1.el9uek | [ELSA-2025-28048](https://patchblox.com/security/data/fix/linux/elsa-2025-28048.md) | Dec 12, 2025 |
| Linux | kernel-uek64k-core ol 8 | 0:5.15.0-315.196.5.1.el9uek | [ELSA-2025-28048](https://patchblox.com/security/data/fix/linux/elsa-2025-28048.md) | Dec 12, 2025 |
| Linux | kernel-uek64k-core ol 9 | 0:5.15.0-315.196.5.1.el9uek | [ELSA-2025-28048](https://patchblox.com/security/data/fix/linux/elsa-2025-28048.md) | Dec 12, 2025 |
| Linux | kernel-uek64k-devel ol 8 | 0:5.15.0-315.196.5.1.el9uek | [ELSA-2025-28048](https://patchblox.com/security/data/fix/linux/elsa-2025-28048.md) | Dec 12, 2025 |
| Linux | kernel-uek64k-devel ol 9 | 0:5.15.0-315.196.5.1.el9uek | [ELSA-2025-28048](https://patchblox.com/security/data/fix/linux/elsa-2025-28048.md) | Dec 12, 2025 |
| Linux | kernel-uek64k-modules ol 8 | 0:5.15.0-315.196.5.1.el9uek | [ELSA-2025-28048](https://patchblox.com/security/data/fix/linux/elsa-2025-28048.md) | Dec 12, 2025 |
| Linux | kernel-uek64k-modules ol 9 | 0:5.15.0-315.196.5.1.el9uek | [ELSA-2025-28048](https://patchblox.com/security/data/fix/linux/elsa-2025-28048.md) | Dec 12, 2025 |
| Linux | kernel-uek64k-modules-extra ol 8 | 0:5.15.0-315.196.5.1.el9uek | [ELSA-2025-28048](https://patchblox.com/security/data/fix/linux/elsa-2025-28048.md) | Dec 12, 2025 |
| Linux | kernel-uek64k-modules-extra ol 9 | 0:5.15.0-315.196.5.1.el9uek | [ELSA-2025-28048](https://patchblox.com/security/data/fix/linux/elsa-2025-28048.md) | Dec 12, 2025 |
| Linux | kernel6.12 amzn 2023 | 6.12.25-32.101.amzn2023 | [ALAS2023-2025-995](https://patchblox.com/security/data/fix/linux/alas2023-2025-995.md) | Jun 3, 2025 |
| Linux | kernel6.12-debuginfo amzn 2023 | 6.12.25-32.101.amzn2023 | [ALAS2023-2025-995](https://patchblox.com/security/data/fix/linux/alas2023-2025-995.md) | Jun 3, 2025 |
| Linux | kernel6.12-debuginfo-common-aarch64 amzn 2023 | 6.12.25-32.101.amzn2023 | [ALAS2023-2025-995](https://patchblox.com/security/data/fix/linux/alas2023-2025-995.md) | Jun 3, 2025 |
| Linux | kernel6.12-debuginfo-common-x86_64 amzn 2023 | 6.12.25-32.101.amzn2023 | [ALAS2023-2025-995](https://patchblox.com/security/data/fix/linux/alas2023-2025-995.md) | Jun 3, 2025 |
| Linux | kernel6.12-modules-extra amzn 2023 | 6.12.25-32.101.amzn2023 | [ALAS2023-2025-995](https://patchblox.com/security/data/fix/linux/alas2023-2025-995.md) | Jun 3, 2025 |
| Linux | linux Debian 12.15 (bookworm) | 6.1.153-1 | [DEBIAN-CVE-2025-23143](https://patchblox.com/security/data/fix/linux/debian-cve-2025-23143.md) | May 1, 2025 |
| Linux | linux Debian 13.5 (trixie) | 6.12.25-1 | [DEBIAN-CVE-2025-23143](https://patchblox.com/security/data/fix/linux/debian-cve-2025-23143.md) | May 1, 2025 |
| Linux | linux Debian 14 | 6.12.25-1 | [DEBIAN-CVE-2025-23143](https://patchblox.com/security/data/fix/linux/debian-cve-2025-23143.md) | May 1, 2025 |
| Linux | perf amzn 2023 | 1:6.1.153-175.280.amzn2023 | [ALAS2023-2025-1210](https://patchblox.com/security/data/fix/linux/alas2023-2025-1210.md) | Sep 24, 2025 |
| Linux | perf-debuginfo amzn 2023 | 1:6.1.153-175.280.amzn2023 | [ALAS2023-2025-1210](https://patchblox.com/security/data/fix/linux/alas2023-2025-1210.md) | Sep 24, 2025 |
| Linux | perf6.12 amzn 2023 | 6.12.25-32.101.amzn2023 | [ALAS2023-2025-995](https://patchblox.com/security/data/fix/linux/alas2023-2025-995.md) | Jun 3, 2025 |
| Linux | perf6.12-debuginfo amzn 2023 | 6.12.25-32.101.amzn2023 | [ALAS2023-2025-995](https://patchblox.com/security/data/fix/linux/alas2023-2025-995.md) | Jun 3, 2025 |
| Linux | python3-perf amzn 2023 | 1:6.1.153-175.280.amzn2023 | [ALAS2023-2025-1210](https://patchblox.com/security/data/fix/linux/alas2023-2025-1210.md) | Sep 24, 2025 |
| Linux | python3-perf-debuginfo amzn 2023 | 1:6.1.153-175.280.amzn2023 | [ALAS2023-2025-1210](https://patchblox.com/security/data/fix/linux/alas2023-2025-1210.md) | Sep 24, 2025 |
| Linux | python3-perf6.12 amzn 2023 | 6.12.25-32.101.amzn2023 | [ALAS2023-2025-995](https://patchblox.com/security/data/fix/linux/alas2023-2025-995.md) | Jun 3, 2025 |
| Linux | python3-perf6.12-debuginfo amzn 2023 | 6.12.25-32.101.amzn2023 | [ALAS2023-2025-995](https://patchblox.com/security/data/fix/linux/alas2023-2025-995.md) | Jun 3, 2025 |

---

Data as of 2026-11-09T01:18:40Z UTC. Source: Patchblox Patch Radar (https://patchblox.com/security/patch-radar). Patchblox finds out-of-date software on Windows, macOS and Linux and updates it through release rings: https://patchblox.com/demo

Free to use with attribution: show "Data: Patchblox Patch Radar" with a link to https://patchblox.com/security/patch-radar. Terms, including what needs a written agreement: https://patchblox.com/security/patch-radar/use-the-data

Product names, logos and trademarks shown on Patch Radar belong to their respective owners. They are used only to identify the software each security fix applies to and to help readers find their platform. Their use does not imply any affiliation with, or endorsement by, those owners, and Patchblox is not affiliated with any of them.
