{
  "schema_version": "1.6.1",
  "id": "RPI-CVE-2025-40168",
  "modified": "2026-10-09T11:39:44Z",
  "upstream": [
    "CVE-2025-40168"
  ],
  "published": "2025-11-12T10:47:16Z",
  "summary": "smc: Use __sk_dst_get() and dst_dev_rcu() in smc_clc_prfx_match().",
  "details": "In the Linux kernel, the following vulnerability has been resolved:\n\nsmc: Use __sk_dst_get() and dst_dev_rcu() in smc_clc_prfx_match().\n\nsmc_clc_prfx_match() is called from smc_listen_work() and\nnot under RCU nor RTNL.\n\nUsing sk_dst_get(sk)->dev could trigger UAF.\n\nLet's use __sk_dst_get() and dst_dev_rcu().\n\nNote that the returned value of smc_clc_prfx_match() is not\nused in the caller.",
  "severity": [
    {
      "type": "CVSS_V3",
      "score": "CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:H/A:H"
    }
  ],
  "affected": [
    {
      "package": {
        "ecosystem": "Raspberry Pi OS:12",
        "name": "linux"
      },
      "versions": [
        "1:6.1.47-1+rpt4"
      ],
      "ecosystem_specific": {
        "binaries": [
          {
            "binary_name": "linux-image-6.1.0-rpi3-rpi-2712",
            "binary_version": "1:6.1.47-1+rpt4"
          },
          {
            "binary_name": "linux-image-6.1.0-rpi3-rpi-v6",
            "binary_version": "1:6.1.47-1+rpt4"
          },
          {
            "binary_name": "linux-image-6.1.0-rpi3-rpi-v7",
            "binary_version": "1:6.1.47-1+rpt4"
          },
          {
            "binary_name": "linux-image-6.1.0-rpi3-rpi-v7l",
            "binary_version": "1:6.1.47-1+rpt4"
          },
          {
            "binary_name": "linux-image-6.1.0-rpi3-rpi-v8",
            "binary_version": "1:6.1.47-1+rpt4"
          }
        ]
      },
      "database_specific": {
        "per_version": {
          "1:6.1.47-1+rpt4": {
            "linux_commit": "655fc658a15ae7a6f37103754adb39ba52a9a14e",
            "upstream_version": "6.1.47",
            "assessment": "commit ancestry (strak rule)",
            "upstream_fixed": "6.1.187",
            "compiled_filter": false
          }
        }
      }
    }
  ],
  "references": [
    {
      "type": "ADVISORY",
      "url": "https://www.cve.org/CVERecord?id=CVE-2025-40168"
    },
    {
      "type": "FIX",
      "url": "https://git.kernel.org/stable/c/3f119c37aa293af41400cccb3d89fab8dcf774b0"
    },
    {
      "type": "FIX",
      "url": "https://git.kernel.org/stable/c/4f5f52a5842937f945582a93cb9daed9ea526fee"
    },
    {
      "type": "FIX",
      "url": "https://git.kernel.org/stable/c/326e5cf301d0bec0a672aa834d8254c4f9df6255"
    },
    {
      "type": "FIX",
      "url": "https://git.kernel.org/stable/c/d26e80f7fb62d77757b67a1b94e4ac756bc9c658"
    },
    {
      "type": "FIX",
      "url": "https://git.kernel.org/stable/c/235f81045c008169cc4e1955b4a64e118eebe61b"
    }
  ],
  "database_specific": {
    "source": "https://git.kernel.org/pub/scm/linux/security/vulns.git",
    "upstream_modified": "2026-09-02T13:01:47Z",
    "severity": {
      "source": "kernel CNA",
      "cvss_v3_score": 8.1,
      "cvss_v3_severity": "High",
      "scenario": "AV:N - The vulnerable read is performed by the SMC listen worker while parsing a CLC Proposal message received over TCP from a remote peer (smc_listen_work \u2192 smc_listen_find_device \u2192 smc_listen_prfx_check \u2192 smc_clc_prfx_match), and the peer controls the fields that select and drive the code path. Any host running an AF_SMC listener is exposed to unauthenticated remote connections.\nAC:H - The attacker fully controls one side of the race (when the CLC Proposal arrives and thus when the stale dst->dev is dereferenced), but the other side requires the route's net_device to be concurrently torn down via dst_dev_put()/free_netdev(), which a remote attacker cannot induce or time.\nPR:N - The CLC handshake is the first exchange on the connection and SMC performs no authentication before smc_clc_prfx_match() runs, so an unauthenticated remote attacker reaches the bug with no credentials of any kind.\nUI:N - Triggering requires only that the attacker complete a TCP handshake with the SMC option and send a CLC Proposal; no action by any local user or administrator is needed.\nS:U - The use-after-free is confined to kernel memory (the net_device slab and the in_dev/inet6_dev structures it points at) within the kernel's own security authority; no VM, IOMMU, or sandbox boundary is crossed.\nC:H - The freed net_device is dereferenced and its ifa_list/addr_list walked, and since a reclaimed slab can be groomed with attacker-controlled data this yields an arbitrary kernel-memory read primitive; the match/no-match outcome is additionally returned to the peer as SMC_CLC_DECL_DIFFPREFIX, forming a remotely observable oracle on freed memory contents.\nI:H - A use-after-free of a net_device is a heap-corruption primitive: the reclaimed object's contents are attacker-influencable via heap spraying and the code follows pointers out of it, which can be groomed into an arbitrary write and control-flow hijack.\nA:H - Dereferencing the freed net_device and walking a bogus in_dev/inet6_dev address list reliably produces a kernel oops, panic, or an unbounded list walk, crashing the system."
    }
  }
}
