{
  "schema_version": "1.6.1",
  "id": "RPI-CVE-2025-40231",
  "modified": "2026-10-07T14:35:31Z",
  "upstream": [
    "CVE-2025-40231"
  ],
  "published": "2025-12-04T15:33:57Z",
  "summary": "vsock: fix lock inversion in vsock_assign_transport()",
  "details": "In the Linux kernel, the following vulnerability has been resolved:\n\nvsock: fix lock inversion in vsock_assign_transport()\n\nSyzbot reported a potential lock inversion deadlock between\nvsock_register_mutex and sk_lock-AF_VSOCK when vsock_linger() is called.\n\nThe issue was introduced by commit 687aa0c5581b (\"vsock: Fix\ntransport_* TOCTOU\") which added vsock_register_mutex locking in\nvsock_assign_transport() around the transport->release() call, that can\ncall vsock_linger(). vsock_assign_transport() can be called with sk_lock\nheld. vsock_linger() calls sk_wait_event() that temporarily releases and\nre-acquires sk_lock. During this window, if another thread hold\nvsock_register_mutex while trying to acquire sk_lock, a circular\ndependency is created.\n\nFix this by releasing vsock_register_mutex before calling\ntransport->release() and vsock_deassign_transport(). This is safe\nbecause we don't need to hold vsock_register_mutex while releasing the\nold transport, and we ensure the new transport won't disappear by\nobtaining a module reference first via try_module_get().",
  "affected": [
    {
      "package": {
        "ecosystem": "Raspberry Pi OS:12",
        "name": "linux"
      },
      "versions": [
        "1:6.12.47-1+rpt1~bookworm"
      ],
      "ecosystem_specific": {
        "binaries": [
          {
            "binary_name": "linux-image-6.12.47+rpt-rpi-2712",
            "binary_version": "1:6.12.47-1+rpt1~bookworm"
          },
          {
            "binary_name": "linux-image-6.12.47+rpt-rpi-v8",
            "binary_version": "1:6.12.47-1+rpt1~bookworm"
          },
          {
            "binary_name": "linux-image-6.12.47+rpt-rpi-v8-rt",
            "binary_version": "1:6.12.47-1+rpt1~bookworm"
          }
        ]
      },
      "database_specific": {
        "per_version": {
          "1:6.12.47-1+rpt1~bookworm": {
            "linux_commit": "359f37f0faefb712add32a39f98751aea67d5c1f",
            "upstream_version": "6.12.47",
            "assessment": "commit ancestry (strak rule)",
            "upstream_fixed": "6.12.56"
          }
        }
      }
    },
    {
      "package": {
        "ecosystem": "Raspberry Pi OS:13",
        "name": "linux"
      },
      "versions": [
        "1:6.12.47-1+rpt1"
      ],
      "ecosystem_specific": {
        "binaries": [
          {
            "binary_name": "linux-image-6.12.47+rpt-rpi-2712",
            "binary_version": "1:6.12.47-1+rpt1"
          },
          {
            "binary_name": "linux-image-6.12.47+rpt-rpi-v8",
            "binary_version": "1:6.12.47-1+rpt1"
          },
          {
            "binary_name": "linux-image-6.12.47+rpt-rpi-v8-rt",
            "binary_version": "1:6.12.47-1+rpt1"
          }
        ]
      },
      "database_specific": {
        "per_version": {
          "1:6.12.47-1+rpt1": {
            "linux_commit": "359f37f0faefb712add32a39f98751aea67d5c1f",
            "upstream_version": "6.12.47",
            "assessment": "commit ancestry (strak rule)",
            "upstream_fixed": "6.12.56"
          }
        }
      }
    }
  ],
  "references": [
    {
      "type": "ADVISORY",
      "url": "https://www.cve.org/CVERecord?id=CVE-2025-40231"
    },
    {
      "type": "FIX",
      "url": "https://git.kernel.org/stable/c/ce4f856c64f0bc30e29302a0ce41f4295ca391c5"
    },
    {
      "type": "FIX",
      "url": "https://git.kernel.org/stable/c/09bba278ccde25a14b6e5088a9e65a8717d0cccf"
    },
    {
      "type": "FIX",
      "url": "https://git.kernel.org/stable/c/b44182c116778feaa05da52a426aeb9da1878dcf"
    },
    {
      "type": "FIX",
      "url": "https://git.kernel.org/stable/c/42ed0784d11adebf748711e503af0eb9f1e6d81d"
    },
    {
      "type": "FIX",
      "url": "https://git.kernel.org/stable/c/251caee792a21eb0b781aab91362b422c945e162"
    },
    {
      "type": "FIX",
      "url": "https://git.kernel.org/stable/c/a2a4346eea8b4cb75037dbcb20b98cb454324f80"
    },
    {
      "type": "FIX",
      "url": "https://git.kernel.org/stable/c/f7c877e7535260cc7a21484c994e8ce7e8cb6780"
    }
  ],
  "database_specific": {
    "source": "https://git.kernel.org/pub/scm/linux/security/vulns.git",
    "upstream_modified": "2026-05-24T06:48:58Z"
  }
}
