cbcvebase.
CVE-2025-23143
published 2025-05-01

CVE-2025-23143: 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…

PriorityP423medium5.5CVSS 3.1
AVLACLPRLUINSUCNINAH
EPSS
0.20%
10.1th percentile
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_l

Affected

35 ranges· showing 25
VendorProductVersion rangeFixed in
debiandebian_linux
debianlinux< linux 6.1.153-1 (bookworm)linux 6.1.153-1 (bookworm)
debianlinux-6.1< linux 6.1.153-1 (bookworm)linux 6.1.153-1 (bookworm)
linuxlinux
linuxlinux>= ed07536ed6731775219c1df7fa26a7588753e693 < 83083c5fc7cf9b0f136a42f26aba60da380f360183083c5fc7cf9b0f136a42f26aba60da380f3601
linuxlinux>= ed07536ed6731775219c1df7fa26a7588753e693 < b7489b753667bc9245958a4896c9419743083c27b7489b753667bc9245958a4896c9419743083c27
linuxlinux>= ed07536ed6731775219c1df7fa26a7588753e693 < d51e47e2ab6ef10a317d576075cf625cdbf96426d51e47e2ab6ef10a317d576075cf625cdbf96426
linuxlinux>= ed07536ed6731775219c1df7fa26a7588753e693 < feda73ad44a5cc80f6bf796bb1099a3fe71576d4feda73ad44a5cc80f6bf796bb1099a3fe71576d4
linuxlinux>= ed07536ed6731775219c1df7fa26a7588753e693 < 905d43b8ad2436c240f844acb3ebcc7a99b8ebf1905d43b8ad2436c240f844acb3ebcc7a99b8ebf1
linuxlinux>= ed07536ed6731775219c1df7fa26a7588753e693 < 5f7f6abd92b6c8dc8f19625ef93c3a18549ede045f7f6abd92b6c8dc8f19625ef93c3a18549ede04
linuxlinux>= ed07536ed6731775219c1df7fa26a7588753e693 < c11247a21aab4b50a23c8b696727d7483de2f1e1c11247a21aab4b50a23c8b696727d7483de2f1e1
linuxlinux>= ed07536ed6731775219c1df7fa26a7588753e693 < 2155802d3313d7b8365935c6b8d6edc0ddd7eb942155802d3313d7b8365935c6b8d6edc0ddd7eb94
linuxlinux>= ed07536ed6731775219c1df7fa26a7588753e693 < 0bb2f7a1ad1f11d861f58e5ee5051c8974ff95690bb2f7a1ad1f11d861f58e5ee5051c8974ff9569
linuxlinux_kernel
linuxlinux_kernel>= 0 < 5.10.247-15.10.247-1
linuxlinux_kernel>= 0 < 6.1.153-16.1.153-1
linuxlinux_kernel>= 0 < 6.12.25-16.12.25-1
linuxlinux_kernel>= 0 < 6.12.25-16.12.25-1
linuxlinux_kernel>= 0 < 5.15.0-170.1805.15.0-170.180
linuxlinux_kernel>= 0 < 6.8.0-106.1066.8.0-106.106
linuxlinux_kernel>= 0 < 6.14.0-22.226.14.0-22.22
linuxlinux_kernel>= 2.6.20 < 5.4.3005.4.300
linuxlinux_kernel>= 5.11 < 5.15.1945.15.194
linuxlinux_kernel>= 5.16 < 6.1.1536.1.153
linuxlinux_kernel>= 5.5 < 5.10.2455.10.245

CVSS provenance

nvdv3.15.5MEDIUMCVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:N/I:N/A:H
osv7.8HIGH
vendor_ubuntu7.8HIGH
vendor_debian5.5MEDIUM
vendor_msrc5.5MEDIUM
vendor_redhat5.5MEDIUM
Stop checking back — get the weekly exploitation signal.

Every Monday: what got weaponized or added to CISA KEV in the last seven days — each CVE cross-linked to its PoC, Nuclei template, and detection rule. Free, one email a week, unsubscribe in one click.