Skip to content
Heist/ feed
Back to feed
UnratedFix available

net: Fix null-ptr-deref by sock_lock_init_class_and_name() and rmmod.

Type: advisorySources: OSV

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

Products
Kernel
Affected versions
Not specified
Fixed versions
5.10.245, 5.15.194, 5.4.300, 6.1.153, 6.12.24, 6.13.12, 6.14.3, 6.6.107
CVEs
CVE-2025-23143
Confirmed fixed CVEs
Not specified
Updated in this feed
2 Nov 2026, 19:46 UTC · Revision 1

Source evidence

net: Fix null-ptr-deref by sock_lock_init_class_and_name() and rmmod.

core-osv · Original source

Published 1 May 2025, 12:55 UTC

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

osv:CVE-2025-23143

Kernel

Fixed versions: 5.4.300, 5.10.245, 5.15.194, 6.1.153, 6.6.107, 6.12.24, 6.13.12, 6.14.3

Complete source record
{
  "id": "f50c2ce4c1e66bdc5f81f81e860bf4e680d67c700cf04a70b4f3b2ba9fcac018",
  "url": "https://osv.dev/vulnerability/CVE-2025-23143",
  "method": "structured",
  "payload": {
    "kind": "advisory",
    "title": "net: Fix null-ptr-deref by sock_lock_init_class_and_name() and rmmod.",
    "summary": "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",
    "evidence": "osv:CVE-2025-23143",
    "products": [
      {
        "name": {
          "value": "Kernel",
          "evidence": "/affected/1/package/name"
        },
        "prerequisites": [],
        "fixed_versions": [
          {
            "value": "5.4.300",
            "evidence": "/affected/1/ranges"
          },
          {
            "value": "5.10.245",
            "evidence": "/affected/1/ranges"
          },
          {
            "value": "5.15.194",
            "evidence": "/affected/1/ranges"
          },
          {
            "value": "6.1.153",
            "evidence": "/affected/1/ranges"
          },
          {
            "value": "6.6.107",
            "evidence": "/affected/1/ranges"
          },
          {
            "value": "6.12.24",
            "evidence": "/affected/1/ranges"
          },
          {
            "value": "6.13.12",
            "evidence": "/affected/1/ranges"
          },
          {
            "value": "6.14.3",
            "evidence": "/affected/1/ranges"
          }
        ],
        "affected_versions": []
      }
    ],
    "severity": "unknown",
    "structured": {
      "id": "CVE-2025-23143",
      "aliases": [
        "CVE-2025-23143"
      ],
      "affected": [
        {
          "ranges": [
            {
              "repo": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git",
              "type": "GIT",
              "events": [
                {
                  "introduced": "ed07536ed6731775219c1df7fa26a7588753e693"
                },
                {
                  "fixed": "83083c5fc7cf9b0f136a42f26aba60da380f3601"
                },
                {
                  "fixed": "b7489b753667bc9245958a4896c9419743083c27"
                },
                {
                  "fixed": "d51e47e2ab6ef10a317d576075cf625cdbf96426"
                },
                {
                  "fixed": "feda73ad44a5cc80f6bf796bb1099a3fe71576d4"
                },
                {
                  "fixed": "905d43b8ad2436c240f844acb3ebcc7a99b8ebf1"
                },
                {
                  "fixed": "5f7f6abd92b6c8dc8f19625ef93c3a18549ede04"
                },
                {
                  "fixed": "c11247a21aab4b50a23c8b696727d7483de2f1e1"
                },
                {
                  "fixed": "2155802d3313d7b8365935c6b8d6edc0ddd7eb94"
                },
                {
                  "fixed": "0bb2f7a1ad1f11d861f58e5ee5051c8974ff9569"
                }
              ]
            }
          ],
          "database_specific": {
            "source": "https://storage.googleapis.com/cve-osv-conversion/osv-output/CVE-2025-23143.json"
          }
        },
        {
          "ranges": [
            {
              "type": "ECOSYSTEM",
              "events": [
                {
                  "introduced": "2.6.20"
                },
                {
                  "fixed": "5.4.300"
                }
              ]
            },
            {
              "type": "ECOSYSTEM",
              "events": [
                {
                  "introduced": "5.5.0"
                },
                {
                  "fixed": "5.10.245"
                }
              ]
            },
            {
              "type": "ECOSYSTEM",
              "events": [
                {
                  "introduced": "5.11.0"
                },
                {
                  "fixed": "5.15.194"
                }
              ]
            },
            {
              "type": "ECOSYSTEM",
              "events": [
                {
                  "introduced": "5.16.0"
                },
                {
                  "fixed": "6.1.153"
                }
              ]
            },
            {
              "type": "ECOSYSTEM",
              "events": [
                {
                  "introduced": "6.2.0"
                },
                {
                  "fixed": "6.6.107"
                }
              ]
            },
            {
              "type": "ECOSYSTEM",
              "events": [
                {
                  "introduced": "6.7.0"
                },
                {
                  "fixed": "6.12.24"
                }
              ]
            },
            {
              "type": "ECOSYSTEM",
              "events": [
                {
                  "introduced": "6.13.0"
                },
                {
                  "fixed": "6.13.12"
                }
              ]
            },
            {
              "type": "ECOSYSTEM",
              "events": [
                {
                  "introduced": "6.14.0"
                },
                {
                  "fixed": "6.14.3"
                }
              ]
            }
          ],
          "package": {
            "name": "Kernel",
            "ecosystem": "Linux"
          },
          "database_specific": {
            "source": "https://storage.googleapis.com/cve-osv-conversion/osv-output/CVE-2025-23143.json"
          }
        }
      ],
      "modified": "2026-10-28T02:30:23.253565576Z",
      "provider": "osv",
      "references": [
        "https://cert-portal.siemens.com/productcert/html/ssa-019113.html",
        "https://cert-portal.siemens.com/productcert/html/ssa-032379.html",
        "https://cert-portal.siemens.com/productcert/html/ssa-457936.html",
        "https://git.kernel.org/stable/c/0bb2f7a1ad1f11d861f58e5ee5051c8974ff9569",
        "https://git.kernel.org/stable/c/2155802d3313d7b8365935c6b8d6edc0ddd7eb94",
        "https://git.kernel.org/stable/c/5f7f6abd92b6c8dc8f19625ef93c3a18549ede04",
        "https://git.kernel.org/stable/c/83083c5fc7cf9b0f136a42f26aba60da380f3601",
        "https://git.kernel.org/stable/c/905d43b8ad2436c240f844acb3ebcc7a99b8ebf1",
        "https://git.kernel.org/stable/c/b7489b753667bc9245958a4896c9419743083c27",
        "https://git.kernel.org/stable/c/c11247a21aab4b50a23c8b696727d7483de2f1e1",
        "https://git.kernel.org/stable/c/d51e47e2ab6ef10a317d576075cf625cdbf96426",
        "https://git.kernel.org/stable/c/feda73ad44a5cc80f6bf796bb1099a3fe71576d4",
        "https://lists.debian.org/debian-lts-announce/2025/10/msg00008.html",
        "https://github.com/CVEProject/cvelistV5/tree/main/cves/2025/23xxx/CVE-2025-23143.json",
        "https://nvd.nist.gov/vuln/detail/CVE-2025-23143",
        "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git"
      ],
      "provider_metadata": {
        "cna_assigner": "Linux",
        "osv_generated_from": "https://github.com/CVEProject/cvelistV5/tree/main/cves/2025/23xxx/CVE-2025-23143.json"
      }
    },
    "related_cves": [
      {
        "value": "CVE-2025-23143",
        "evidence": "/id"
      }
    ],
    "security_relevant": true,
    "severity_evidence": null
  },
  "source_id": "core-osv",
  "document_id": 489368,
  "published_at": "2025-05-01T12:55:33.348+00:00"
}