{"id":"CVE-2024-50215","state":"PUBLISHED","title":"nvmet-auth: assign dh_key to NULL after kfree_sensitive","description":"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.","publishedAt":"2024-11-09T10:14:27.043Z","updatedAt":"2026-08-05T11:42:33.611Z","severity":{"score":8.1,"label":"High","version":"3.1","vector":"CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:H/A:H","source":"Linux"},"assigner":"Linux","products":["Linux Linux"],"affected":[{"vendor":"Linux","product":"Linux","defaultStatus":"unaffected","versions":[{"version":"7a277c37d3522e9b2777d762bbbcecafae2b1f8d","status":"affected","lessThan":"c94e965f766321641ec38e4eece9ce8884543244","versionType":"git"},{"version":"7a277c37d3522e9b2777d762bbbcecafae2b1f8d","status":"affected","lessThan":"c60af16e1d6cc2237d58336546d6adfc067b6b8f","versionType":"git"},{"version":"7a277c37d3522e9b2777d762bbbcecafae2b1f8d","status":"affected","lessThan":"e61bd51e44409495d75847e9230736593e4c8710","versionType":"git"},{"version":"7a277c37d3522e9b2777d762bbbcecafae2b1f8d","status":"affected","lessThan":"d2f551b1f72b4c508ab9298419f6feadc3b5d791","versionType":"git"}],"repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","programFiles":["drivers/nvme/target/auth.c"]},{"vendor":"Linux","product":"Linux","defaultStatus":"affected","versions":[{"version":"6.0","status":"affected"},{"version":"0","status":"unaffected","lessThan":"6.0","versionType":"semver"},{"version":"6.1.116","status":"unaffected","lessThanOrEqual":"6.1.*","versionType":"semver"},{"version":"6.6.60","status":"unaffected","lessThanOrEqual":"6.6.*","versionType":"semver"},{"version":"6.11.7","status":"unaffected","lessThanOrEqual":"6.11.*","versionType":"semver"},{"version":"6.12","status":"unaffected","lessThanOrEqual":"*","versionType":"original_commit_for_fix"}],"repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","programFiles":["drivers/nvme/target/auth.c"]}],"references":["https://git.kernel.org/stable/c/c94e965f766321641ec38e4eece9ce8884543244","https://git.kernel.org/stable/c/c60af16e1d6cc2237d58336546d6adfc067b6b8f","https://git.kernel.org/stable/c/e61bd51e44409495d75847e9230736593e4c8710","https://git.kernel.org/stable/c/d2f551b1f72b4c508ab9298419f6feadc3b5d791","https://lists.debian.org/debian-lts-announce/2025/01/msg00001.html"],"weaknesses":["CWE-415"],"ingestedAt":"2026-10-29T20:07:56.516Z","source":{"repository":"CVEProject/cvelistV5","path":"cves/2024/50xxx/CVE-2024-50215.json","commit":"556c9d3a8cd17e218bb8e452ba7cd619a384ff47"},"raw":{"dataType":"CVE_RECORD","dataVersion":"5.2","cveMetadata":{"cveId":"CVE-2024-50215","state":"PUBLISHED","datePublished":"2024-11-09T10:14:27.043Z","dateUpdated":"2026-08-05T11:42:33.611Z","assignerShortName":"Linux","assignerOrgId":"416baaa9-dc9f-4396-8d5f-8c081fb06d67","dateReserved":"2024-10-21T19:36:19.971Z"},"containers":{"cna":{"title":"nvmet-auth: assign dh_key to NULL after kfree_sensitive","descriptions":[{"lang":"en","value":"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."}],"affected":[{"vendor":"Linux","product":"Linux","defaultStatus":"unaffected","versions":[{"version":"7a277c37d3522e9b2777d762bbbcecafae2b1f8d","status":"affected","lessThan":"c94e965f766321641ec38e4eece9ce8884543244","versionType":"git"},{"version":"7a277c37d3522e9b2777d762bbbcecafae2b1f8d","status":"affected","lessThan":"c60af16e1d6cc2237d58336546d6adfc067b6b8f","versionType":"git"},{"version":"7a277c37d3522e9b2777d762bbbcecafae2b1f8d","status":"affected","lessThan":"e61bd51e44409495d75847e9230736593e4c8710","versionType":"git"},{"version":"7a277c37d3522e9b2777d762bbbcecafae2b1f8d","status":"affected","lessThan":"d2f551b1f72b4c508ab9298419f6feadc3b5d791","versionType":"git"}],"repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","programFiles":["drivers/nvme/target/auth.c"]},{"vendor":"Linux","product":"Linux","defaultStatus":"affected","versions":[{"version":"6.0","status":"affected"},{"version":"0","status":"unaffected","lessThan":"6.0","versionType":"semver"},{"version":"6.1.116","status":"unaffected","lessThanOrEqual":"6.1.*","versionType":"semver"},{"version":"6.6.60","status":"unaffected","lessThanOrEqual":"6.6.*","versionType":"semver"},{"version":"6.11.7","status":"unaffected","lessThanOrEqual":"6.11.*","versionType":"semver"},{"version":"6.12","status":"unaffected","lessThanOrEqual":"*","versionType":"original_commit_for_fix"}],"repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","programFiles":["drivers/nvme/target/auth.c"]}],"references":[{"url":"https://git.kernel.org/stable/c/c94e965f766321641ec38e4eece9ce8884543244"},{"url":"https://git.kernel.org/stable/c/c60af16e1d6cc2237d58336546d6adfc067b6b8f"},{"url":"https://git.kernel.org/stable/c/e61bd51e44409495d75847e9230736593e4c8710"},{"url":"https://git.kernel.org/stable/c/d2f551b1f72b4c508ab9298419f6feadc3b5d791"}],"metrics":[{"cvssV3_1":{"version":"3.1","vectorString":"CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:H/A:H","baseScore":8.1,"baseSeverity":"HIGH"},"scenarios":[{"lang":"en","value":"AV:N - `nvmet_setup_dhgroup()` executes on behalf of remote NVMe-oF fabric commands — the admin Connect command (`nvmet_execute_admin_connect()`) and the AUTH_Send DH-HMAC-CHAP NEGOTIATE restart — 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 — the attacker alone issues Connect and AUTH_Send commands and later disconnects to drive `nvmet_ctrl_free()` → `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–1024 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."}]}],"providerMetadata":{"shortName":"Linux","orgId":"416baaa9-dc9f-4396-8d5f-8c081fb06d67","dateUpdated":"2026-08-05T11:42:33.611Z"},"cpeApplicability":[{"nodes":[{"operator":"OR","negate":false,"cpeMatch":[{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionStartIncluding":"6.0","versionEndExcluding":"6.1.116"},{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionStartIncluding":"6.0","versionEndExcluding":"6.6.60"},{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionStartIncluding":"6.0","versionEndExcluding":"6.11.7"},{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionStartIncluding":"6.0","versionEndExcluding":"6.12"}]}]}],"x_generator":{"engine":"bippy-1.2.0"}},"adp":[{"title":"CISA ADP Vulnrichment","metrics":[{"cvssV3_1":{"scope":"UNCHANGED","version":"3.1","baseScore":7.8,"attackVector":"LOCAL","baseSeverity":"HIGH","vectorString":"CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H","integrityImpact":"HIGH","userInteraction":"NONE","attackComplexity":"LOW","availabilityImpact":"HIGH","privilegesRequired":"LOW","confidentialityImpact":"HIGH"}},{"other":{"type":"ssvc","content":{"id":"CVE-2024-50215","role":"CISA Coordinator","options":[{"Exploitation":"none"},{"Automatable":"no"},{"Technical Impact":"total"}],"version":"2.0.3","timestamp":"2025-10-01T20:17:09.200980Z"}}}],"problemTypes":[{"descriptions":[{"cweId":"CWE-415","lang":"en","type":"CWE","description":"CWE-415 Double Free"}]}],"providerMetadata":{"shortName":"CISA-ADP","orgId":"134c704f-9b21-4f2e-91b3-4a467353bcc0","dateUpdated":"2025-10-01T20:27:05.214Z"}},{"title":"CVE Program Container","references":[{"url":"https://lists.debian.org/debian-lts-announce/2025/01/msg00001.html"}],"providerMetadata":{"shortName":"CVE","orgId":"af854a3a-2127-422b-91ae-364da2661108","dateUpdated":"2025-11-03T22:27:06.690Z"}}]}}}