Skip to content
Heist/ feed
Back to feed
UnratedFix available

vsock: fix lock inversion in vsock_assign_transport()

Type: advisorySources: OSV

In the Linux kernel, the following vulnerability has been resolved: vsock: fix lock inversion in vsock_assign_transport() Syzbot reported a potential lock inversion deadlock between vsock_register_mutex and sk_lock-AF_VSOCK when vsock_linger() is called. The issue was introduced by commit 687aa0c5581b ("vsock: Fix transport_* TOCTOU") which added vsock_register_mutex locking in vsock_assign_transport() around the transport->release() call, that can call vsock_linger(). vsock_assign_transport() can be called with sk_lock held. vsock_linger() calls sk_wait_event() that temporarily releases and re-acquires sk_lock. During this window, if another thread hold vsock_register_mutex while trying to acquire sk_lock, a circular dependency is created. Fix this by releasing vsock_register_mutex before calling transport->release() and vsock_deassign_transport(). This is safe because we don't need to hold vsock_register_mutex while releasing the old transport, and we ensure the new transport won't disappear by obtaining a module reference first via try_module_get().

Products
Kernel
Affected versions
Not specified
Fixed versions
5.10.246, 5.15.196, 6.1.158, 6.12.56, 6.17.6, 6.6.115
CVEs
CVE-2025-40231
Confirmed fixed CVEs
Not specified
Updated in this feed
5 Nov 2026, 03:02 UTC · Revision 1

Source evidence

vsock: fix lock inversion in vsock_assign_transport()

core-osv · Original source

Published 4 Dec 2025, 15:31 UTC

In the Linux kernel, the following vulnerability has been resolved: vsock: fix lock inversion in vsock_assign_transport() Syzbot reported a potential lock inversion deadlock between vsock_register_mutex and sk_lock-AF_VSOCK when vsock_linger() is called. The issue was introduced by commit 687aa0c5581b ("vsock: Fix transport_* TOCTOU") which added vsock_register_mutex locking in vsock_assign_transport() around the transport->release() call, that can call vsock_linger(). vsock_assign_transport() can be called with sk_lock held. vsock_linger() calls sk_wait_event() that temporarily releases and re-acquires sk_lock. During this window, if another thread hold vsock_register_mutex while trying to acquire sk_lock, a circular dependency is created. Fix this by releasing vsock_register_mutex before calling transport->release() and vsock_deassign_transport(). This is safe because we don't need to hold vsock_register_mutex while releasing the old transport, and we ensure the new transport won't disappear by obtaining a module reference first via try_module_get().

osv:CVE-2025-40231

Kernel

Fixed versions: 5.10.246, 5.15.196, 6.1.158, 6.6.115, 6.12.56, 6.17.6

Complete source record
{
  "id": "59f1c6e6e021a64cc570a209b74882df66cb2a3276604dc940aa48ef95fe400b",
  "url": "https://osv.dev/vulnerability/CVE-2025-40231",
  "method": "structured",
  "payload": {
    "kind": "advisory",
    "title": "vsock: fix lock inversion in vsock_assign_transport()",
    "summary": "In the Linux kernel, the following vulnerability has been resolved: vsock: fix lock inversion in vsock_assign_transport() Syzbot reported a potential lock inversion deadlock between vsock_register_mutex and sk_lock-AF_VSOCK when vsock_linger() is called. The issue was introduced by commit 687aa0c5581b (\"vsock: Fix transport_* TOCTOU\") which added vsock_register_mutex locking in vsock_assign_transport() around the transport->release() call, that can call vsock_linger(). vsock_assign_transport() can be called with sk_lock held. vsock_linger() calls sk_wait_event() that temporarily releases and re-acquires sk_lock. During this window, if another thread hold vsock_register_mutex while trying to acquire sk_lock, a circular dependency is created. Fix this by releasing vsock_register_mutex before calling transport->release() and vsock_deassign_transport(). This is safe because we don't need to hold vsock_register_mutex while releasing the old transport, and we ensure the new transport won't disappear by obtaining a module reference first via try_module_get().",
    "evidence": "osv:CVE-2025-40231",
    "products": [
      {
        "name": {
          "value": "Kernel",
          "evidence": "/affected/1/package/name"
        },
        "prerequisites": [],
        "fixed_versions": [
          {
            "value": "5.10.246",
            "evidence": "/affected/1/ranges"
          },
          {
            "value": "5.15.196",
            "evidence": "/affected/1/ranges"
          },
          {
            "value": "6.1.158",
            "evidence": "/affected/1/ranges"
          },
          {
            "value": "6.6.115",
            "evidence": "/affected/1/ranges"
          },
          {
            "value": "6.12.56",
            "evidence": "/affected/1/ranges"
          },
          {
            "value": "6.17.6",
            "evidence": "/affected/1/ranges"
          }
        ],
        "affected_versions": []
      }
    ],
    "severity": "unknown",
    "structured": {
      "id": "CVE-2025-40231",
      "aliases": [
        "CVE-2025-40231"
      ],
      "affected": [
        {
          "ranges": [
            {
              "repo": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git",
              "type": "GIT",
              "events": [
                {
                  "introduced": "8667e8d0eb46bc54fdae30ba2f4786407d3d88eb"
                },
                {
                  "fixed": "ce4f856c64f0bc30e29302a0ce41f4295ca391c5"
                }
              ]
            },
            {
              "repo": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git",
              "type": "GIT",
              "events": [
                {
                  "introduced": "36a439049b34cca0b3661276049b84a1f76cc21a"
                },
                {
                  "fixed": "09bba278ccde25a14b6e5088a9e65a8717d0cccf"
                }
              ]
            },
            {
              "repo": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git",
              "type": "GIT",
              "events": [
                {
                  "introduced": "9ce53e744f18e73059d3124070e960f3aa9902bf"
                },
                {
                  "fixed": "b44182c116778feaa05da52a426aeb9da1878dcf"
                }
              ]
            },
            {
              "repo": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git",
              "type": "GIT",
              "events": [
                {
                  "introduced": "9d24bb6780282b0255b9929abe5e8f98007e2c6e"
                },
                {
                  "fixed": "42ed0784d11adebf748711e503af0eb9f1e6d81d"
                }
              ]
            },
            {
              "repo": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git",
              "type": "GIT",
              "events": [
                {
                  "introduced": "ae2c712ba39c7007de63cb0c75b51ce1caaf1da5"
                },
                {
                  "fixed": "251caee792a21eb0b781aab91362b422c945e162"
                }
              ]
            },
            {
              "repo": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git",
              "type": "GIT",
              "events": [
                {
                  "introduced": "687aa0c5581b8d4aa87fd92973e4ee576b550cdf"
                },
                {
                  "fixed": "a2a4346eea8b4cb75037dbcb20b98cb454324f80"
                },
                {
                  "fixed": "f7c877e7535260cc7a21484c994e8ce7e8cb6780"
                }
              ]
            },
            {
              "repo": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git",
              "type": "GIT",
              "events": [
                {
                  "introduced": "5.10.240"
                },
                {
                  "fixed": "5.10.246"
                }
              ]
            },
            {
              "repo": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git",
              "type": "GIT",
              "events": [
                {
                  "introduced": "5.15.189"
                },
                {
                  "fixed": "5.15.196"
                }
              ]
            },
            {
              "repo": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git",
              "type": "GIT",
              "events": [
                {
                  "introduced": "6.1.146"
                },
                {
                  "fixed": "6.1.158"
                }
              ]
            },
            {
              "repo": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git",
              "type": "GIT",
              "events": [
                {
                  "introduced": "6.6.99"
                },
                {
                  "fixed": "6.6.115"
                }
              ]
            },
            {
              "repo": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git",
              "type": "GIT",
              "events": [
                {
                  "introduced": "6.12.39"
                },
                {
                  "fixed": "6.12.56"
                }
              ]
            },
            {
              "repo": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git",
              "type": "GIT",
              "events": [
                {
                  "introduced": "6.15.7"
                },
                {
                  "fixed": "6.16"
                }
              ]
            },
            {
              "repo": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git",
              "type": "GIT",
              "events": [
                {
                  "introduced": "7b73bddf54777fb62d4d8c7729d0affe6df04477"
                }
              ]
            }
          ],
          "versions": [
            "v5.10.245",
            "v5.10.244",
            "v5.10.243",
            "v5.10.242",
            "v5.10.241",
            "v5.10.240",
            "v5.15.195",
            "v5.15.194",
            "v5.15.193",
            "v5.15.192",
            "v5.15.191",
            "v5.15.190",
            "v5.15.189",
            "v6.1.157",
            "v6.1.156",
            "v6.1.155",
            "v6.1.154",
            "v6.1.153",
            "v6.1.152",
            "v6.1.151",
            "v6.1.150",
            "v6.1.149",
            "v6.1.148",
            "v6.1.147",
            "v6.1.146",
            "v6.6.114",
            "v6.6.113",
            "v6.6.112",
            "v6.6.111",
            "v6.6.110",
            "v6.6.109",
            "v6.6.108",
            "v6.6.107",
            "v6.6.106",
            "v6.6.105",
            "v6.6.104",
            "v6.6.103",
            "v6.6.102",
            "v6.6.101",
            "v6.6.100",
            "v6.6.99",
            "v6.12.55",
            "v6.12.54",
            "v6.12.53",
            "v6.12.52",
            "v6.12.51",
            "v6.12.50",
            "v6.12.49",
            "v6.12.48",
            "v6.12.47",
            "v6.12.46",
            "v6.12.45",
            "v6.12.44",
            "v6.12.43",
            "v6.12.42",
            "v6.12.41",
            "v6.12.40",
            "v6.12.39",
            "v6.15.11",
            "v6.15.10",
            "v6.15.9",
            "v6.15.8",
            "v6.15.7"
          ],
          "database_specific": {
            "source": "https://storage.googleapis.com/cve-osv-conversion/osv-output/CVE-2025-40231.json"
          }
        },
        {
          "ranges": [
            {
              "type": "ECOSYSTEM",
              "events": [
                {
                  "introduced": "0"
                },
                {
                  "fixed": "5.10.246"
                }
              ]
            },
            {
              "type": "ECOSYSTEM",
              "events": [
                {
                  "introduced": "5.11.0"
                },
                {
                  "fixed": "5.15.196"
                }
              ]
            },
            {
              "type": "ECOSYSTEM",
              "events": [
                {
                  "introduced": "5.16.0"
                },
                {
                  "fixed": "6.1.158"
                }
              ]
            },
            {
              "type": "ECOSYSTEM",
              "events": [
                {
                  "introduced": "6.2.0"
                },
                {
                  "fixed": "6.6.115"
                }
              ]
            },
            {
              "type": "ECOSYSTEM",
              "events": [
                {
                  "introduced": "6.7.0"
                },
                {
                  "fixed": "6.12.56"
                }
              ]
            },
            {
              "type": "ECOSYSTEM",
              "events": [
                {
                  "introduced": "6.13.0"
                },
                {
                  "fixed": "6.17.6"
                }
              ]
            }
          ],
          "package": {
            "name": "Kernel",
            "ecosystem": "Linux"
          },
          "database_specific": {
            "source": "https://storage.googleapis.com/cve-osv-conversion/osv-output/CVE-2025-40231.json"
          }
        }
      ],
      "modified": "2026-10-28T02:30:41.994103713Z",
      "provider": "osv",
      "references": [
        "https://git.kernel.org/stable/c/09bba278ccde25a14b6e5088a9e65a8717d0cccf",
        "https://git.kernel.org/stable/c/251caee792a21eb0b781aab91362b422c945e162",
        "https://git.kernel.org/stable/c/42ed0784d11adebf748711e503af0eb9f1e6d81d",
        "https://git.kernel.org/stable/c/a2a4346eea8b4cb75037dbcb20b98cb454324f80",
        "https://git.kernel.org/stable/c/b44182c116778feaa05da52a426aeb9da1878dcf",
        "https://git.kernel.org/stable/c/ce4f856c64f0bc30e29302a0ce41f4295ca391c5",
        "https://git.kernel.org/stable/c/f7c877e7535260cc7a21484c994e8ce7e8cb6780",
        "https://github.com/CVEProject/cvelistV5/tree/main/cves/2025/40xxx/CVE-2025-40231.json",
        "https://nvd.nist.gov/vuln/detail/CVE-2025-40231",
        "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/40xxx/CVE-2025-40231.json"
      }
    },
    "related_cves": [
      {
        "value": "CVE-2025-40231",
        "evidence": "/id"
      }
    ],
    "security_relevant": true,
    "severity_evidence": null
  },
  "source_id": "core-osv",
  "document_id": 509704,
  "published_at": "2025-12-04T15:31:22.199+00:00"
}