{
  "schema_version": "1.6.1",
  "id": "RPI-CVE-2025-38325",
  "modified": "2026-10-09T11:39:44Z",
  "upstream": [
    "CVE-2025-38325"
  ],
  "published": "2025-07-10T08:18:24Z",
  "summary": "ksmbd: add free_transport ops in ksmbd connection",
  "details": "In the Linux kernel, the following vulnerability has been resolved:\n\nksmbd: add free_transport ops in ksmbd connection\n\nfree_transport function for tcp connection can be called from smbdirect.\nIt will cause kernel oops. This patch add free_transport ops in ksmbd\nconnection, and add each free_transports for tcp and smbdirect.",
  "severity": [
    {
      "type": "CVSS_V3",
      "score": "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H"
    }
  ],
  "affected": [
    {
      "package": {
        "ecosystem": "Raspberry Pi OS:12",
        "name": "linux"
      },
      "versions": [
        "1:6.12.34-1+rpt1~bookworm"
      ],
      "ecosystem_specific": {
        "binaries": [
          {
            "binary_name": "linux-image-6.12.34+rpt-rpi-2712",
            "binary_version": "1:6.12.34-1+rpt1~bookworm"
          },
          {
            "binary_name": "linux-image-6.12.34+rpt-rpi-v6",
            "binary_version": "1:6.12.34-1+rpt1~bookworm"
          },
          {
            "binary_name": "linux-image-6.12.34+rpt-rpi-v7",
            "binary_version": "1:6.12.34-1+rpt1~bookworm"
          },
          {
            "binary_name": "linux-image-6.12.34+rpt-rpi-v7l",
            "binary_version": "1:6.12.34-1+rpt1~bookworm"
          },
          {
            "binary_name": "linux-image-6.12.34+rpt-rpi-v8",
            "binary_version": "1:6.12.34-1+rpt1~bookworm"
          },
          {
            "binary_name": "linux-image-6.12.34+rpt-rpi-v8-rt",
            "binary_version": "1:6.12.34-1+rpt1~bookworm"
          }
        ]
      },
      "database_specific": {
        "per_version": {
          "1:6.12.34-1+rpt1~bookworm": {
            "linux_commit": "8f77e03530f65209a377d25023e912b288e039cd",
            "upstream_version": "6.12.34",
            "assessment": "commit ancestry (strak rule)",
            "upstream_fixed": "6.12.35"
          }
        }
      }
    },
    {
      "package": {
        "ecosystem": "Raspberry Pi OS:13",
        "name": "linux"
      },
      "versions": [
        "1:6.12.34-1+rpt1"
      ],
      "ecosystem_specific": {
        "binaries": [
          {
            "binary_name": "linux-image-6.12.34+rpt-rpi-2712",
            "binary_version": "1:6.12.34-1+rpt1"
          },
          {
            "binary_name": "linux-image-6.12.34+rpt-rpi-v6",
            "binary_version": "1:6.12.34-1+rpt1"
          },
          {
            "binary_name": "linux-image-6.12.34+rpt-rpi-v7",
            "binary_version": "1:6.12.34-1+rpt1"
          },
          {
            "binary_name": "linux-image-6.12.34+rpt-rpi-v8",
            "binary_version": "1:6.12.34-1+rpt1"
          },
          {
            "binary_name": "linux-image-6.12.34+rpt-rpi-v8-rt",
            "binary_version": "1:6.12.34-1+rpt1"
          }
        ]
      },
      "database_specific": {
        "per_version": {
          "1:6.12.34-1+rpt1": {
            "linux_commit": "8f77e03530f65209a377d25023e912b288e039cd",
            "upstream_version": "6.12.34",
            "assessment": "commit ancestry (strak rule)",
            "upstream_fixed": "6.12.35"
          }
        }
      }
    }
  ],
  "references": [
    {
      "type": "ADVISORY",
      "url": "https://www.cve.org/CVERecord?id=CVE-2025-38325"
    },
    {
      "type": "FIX",
      "url": "https://git.kernel.org/stable/c/52f5a52dc17a4a7b4363ac03fe2c4ef26f020dc6"
    },
    {
      "type": "FIX",
      "url": "https://git.kernel.org/stable/c/3890da762a66191c440b0bd6e3ee45501edbb0c1"
    },
    {
      "type": "FIX",
      "url": "https://git.kernel.org/stable/c/3f3aae77280aad9f5acc6709c596148966f765c7"
    },
    {
      "type": "FIX",
      "url": "https://git.kernel.org/stable/c/a89f5fae998bdc4d0505306f93844c9ae059d50c"
    }
  ],
  "database_specific": {
    "source": "https://git.kernel.org/pub/scm/linux/security/vulns.git",
    "upstream_modified": "2026-08-05T12:19:11Z",
    "severity": {
      "source": "kernel CNA",
      "cvss_v3_score": 9.8,
      "cvss_v3_severity": "Critical",
      "scenario": "AV:N - The vulnerable teardown path belongs to ksmbd's in-kernel SMB Direct transport, whose RDMA CM listener accepts connections from remote peers on port 445 (InfiniBand) / 5445 (iWARP), and is reachable over routable IP via iWARP/RoCEv2 or software providers (siw/rxe). No local access is needed \u2014 a remote peer triggers it by establishing and dropping an SMB Direct connection.\nAC:L - The type confusion is deterministic \u2014 every SMB Direct connection teardown funnels through ksmbd_conn_free() \u2192 ksmbd_free_transport() and fabricates a socket pointer from the status/full_packet_received bytes, with no race or memory-layout precondition. The premature-free variant simply requires holding an oplock/lease at disconnect time, which the attacker fully controls.\nPR:N - Connection setup and teardown happen entirely before SMB2 SESSION_SETUP: the error path in smb_direct_handle_connect_request() and the normal ksmbd_conn_handler_loop() exit both call free_transport() with no credentials verified. An unauthenticated peer that connects and disconnects triggers the confused free.\nUI:N - The attacker drives the entire sequence by opening and closing an SMB Direct connection; no action by any local user or administrator is required beyond ksmbd already serving SMB Direct.\nS:U - The corruption is confined to kernel memory managed by the ksmbd server within the same security authority; no VM, IOMMU, or sandbox boundary is crossed.\nC:H - The type confusion plus the unconditional kfree(t) in the RDMA free_transport() leave conn->transport dangling and double-free the slab object, giving a use-after-free on a large kmalloc allocation that an attacker can reclaim and read back through ksmbd_conn_write()/rdma_read paths, which is leverageable for arbitrary kernel memory disclosure.\nI:H - This is a genuine type confusion combined with a double free and a use-after-free whose reuse ends in an indirect call through freed memory (conn->transport->ops->writev in __smb2_lease_break_noti()), a direct control-flow hijack primitive once the freed object is groomed.\nA:H - Every SMB Direct teardown calls sock_release() on a fabricated pointer built from the status enum, producing a guaranteed kernel oops that kills the ksmbd kthread and leaks its RDMA resources, and panics outright on panic_on_oops configurations common in appliances and embedded deployments."
    }
  }
}
