{
  "schema_version": "1.6.1",
  "id": "RPI-CVE-2024-50215",
  "modified": "2026-10-09T11:39:44Z",
  "upstream": [
    "CVE-2024-50215"
  ],
  "published": "2024-11-09T10:15:51Z",
  "summary": "nvmet-auth: assign dh_key to NULL after kfree_sensitive",
  "details": "In the Linux kernel, the following vulnerability has been resolved:\n\nnvmet-auth: assign dh_key to NULL after kfree_sensitive\n\nctrl->dh_key might be used across multiple calls to nvmet_setup_dhgroup()\nfor the same controller. So it's better to nullify it after release on\nerror path in order to avoid double free later in nvmet_destroy_auth().\n\nFound by Linux Verification Center (linuxtesting.org) with Svace.",
  "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.116",
            "compiled_filter": false
          }
        }
      }
    }
  ],
  "references": [
    {
      "type": "ADVISORY",
      "url": "https://www.cve.org/CVERecord?id=CVE-2024-50215"
    },
    {
      "type": "FIX",
      "url": "https://git.kernel.org/stable/c/c94e965f766321641ec38e4eece9ce8884543244"
    },
    {
      "type": "FIX",
      "url": "https://git.kernel.org/stable/c/c60af16e1d6cc2237d58336546d6adfc067b6b8f"
    },
    {
      "type": "FIX",
      "url": "https://git.kernel.org/stable/c/e61bd51e44409495d75847e9230736593e4c8710"
    },
    {
      "type": "FIX",
      "url": "https://git.kernel.org/stable/c/d2f551b1f72b4c508ab9298419f6feadc3b5d791"
    }
  ],
  "database_specific": {
    "source": "https://git.kernel.org/pub/scm/linux/security/vulns.git",
    "upstream_modified": "2026-08-05T11:52:36Z",
    "severity": {
      "source": "kernel CNA",
      "cvss_v3_score": 8.1,
      "cvss_v3_severity": "High",
      "scenario": "AV:N - `nvmet_setup_dhgroup()` executes on behalf of remote NVMe-oF fabric commands \u2014 the admin Connect command (`nvmet_execute_admin_connect()`) and the AUTH_Send DH-HMAC-CHAP NEGOTIATE restart \u2014 delivered by nvmet-tcp on TCP/4420 (or RDMA/FC) from an arbitrary remote initiator. No local access to the target is needed to drive the vulnerable function.\nAC:H - Two preconditions lie entirely outside the attacker's control: `ctrl->dh_gid` must diverge from `host->dhchap_dhgroup_id` (the negotiate loop can only re-assign `dh_gid` to its existing value, so this requires an administrator changing `dhchap_dhgroup` via configfs between two setups), and `crypto_kpp_set_secret()` must fail, which happens only on a small GFP_KERNEL/MPI allocation failure or default-RNG failure that the kernel does not produce without OOM-killing first.\nPR:N - The code path is the authentication setup itself and runs before DH-HMAC-CHAP completes (`sq->authenticated == false`); the only credential involved is the host NQN, a non-secret identifier the attacker chooses in the Connect payload. No prior authentication or account on the target is required.\nUI:N - No victim action participates in the attack \u2014 the attacker alone issues Connect and AUTH_Send commands and later disconnects to drive `nvmet_ctrl_free()` \u2192 `nvmet_destroy_auth()`. The DH-group configfs setting is pre-existing system configuration, not user interaction.\nS:U - The double free corrupts kernel slab state within the kernel's own security authority; no VM, IOMMU, or sandbox boundary is crossed.\nC:H - A double free of the 256\u20131024 byte `ctrl->dh_key` in a general-purpose kmalloc cache lets the same slab object be handed out twice; with the heap grooming the remote peer already has on the target (`kmalloc(tl, GFP_KERNEL)` with attacker-chosen `tl` in `nvmet_execute_auth_send()`), this yields a UAF-style read primitive over adjacent/overlapping kernel objects, including the DH private key material itself.\nI:H - The same aliased-allocation primitive gives an attacker-controlled write into an object another kernel subsystem believes it owns, corrupting SLUB freelist metadata and enabling control-flow hijacking in the classic double-free exploitation pattern.\nA:H - Even unexploited, the second `kfree_sensitive()` on the dangling pointer trips SLUB double-free detection (BUG/panic with `slub_debug` or `panic_on_oops`) or corrupts the freelist into a later fatal oops, taking down the storage target."
    }
  }
}
