{"id":"CVE-2026-68179","state":"PUBLISHED","title":"misc: nsm: only unlock nsm_dev on post-lock error paths","description":"In the Linux kernel, the following vulnerability has been resolved:\n\nmisc: nsm: only unlock nsm_dev on post-lock error paths\n\nnsm_dev_ioctl() jumps to the common out label even when the initial\ncopy_from_user() fails before nsm->lock has been taken.  The error path\nthen blindly unlocks a mutex that was never acquired.\n\nThis issue was found by our static analysis tool and then manually\nreviewed against the current tree.\n\nThe grounded PoC kept the miscdevice ioctl entry and the pre-lock\ncopy_from_user(&raw, argp, _IOC_SIZE(cmd)) failure path by issuing\nNSM_IOCTL_RAW with an invalid user pointer.  That failure reaches the\nshared out label before mutex_lock(&nsm->lock).  Lockdep reported:\n\n  WARNING: bad unlock balance detected!\n  exploit/193 is trying to release lock (&global_nsm.lock) at:\n  nsm_dev_ioctl+0x5f/0xcf [vuln_msv]\n  but there are no more locks to release!\n  no locks held by exploit/193.\n\nReturn immediately on the pre-lock copy_from_user() failure and keep the\ncommon unlock label for the post-lock paths only.","publishedAt":"2026-08-10T11:59:50.667Z","updatedAt":"2026-10-19T20:58:56.123Z","severity":{"score":8.4,"label":"High","version":"3.1","vector":"CVSS:3.1/AV:L/AC:L/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":"b9873755a6c8ccfce79094c4dce9efa3ecb1a749","status":"affected","lessThan":"4aa3f7d48e91eb74a363c1b4d7dbdd28f5b341fb","versionType":"git"},{"version":"b9873755a6c8ccfce79094c4dce9efa3ecb1a749","status":"affected","lessThan":"8f068342096b027181b168d91fef7ac7a2c64b25","versionType":"git"},{"version":"b9873755a6c8ccfce79094c4dce9efa3ecb1a749","status":"affected","lessThan":"f318f5a872cb9096536e759b23ae5c9873bb80ed","versionType":"git"},{"version":"b9873755a6c8ccfce79094c4dce9efa3ecb1a749","status":"affected","lessThan":"ce1fed11d18e163baf7f875152a33bf80f625c1a","versionType":"git"}],"repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","programFiles":["drivers/misc/nsm.c"]},{"vendor":"Linux","product":"Linux","defaultStatus":"affected","versions":[{"version":"6.8","status":"affected"},{"version":"0","status":"unaffected","lessThan":"6.8","versionType":"semver"},{"version":"6.12.101","status":"unaffected","lessThanOrEqual":"6.12.*","versionType":"semver"},{"version":"6.18.42","status":"unaffected","lessThanOrEqual":"6.18.*","versionType":"semver"},{"version":"7.1.6","status":"unaffected","lessThanOrEqual":"7.1.*","versionType":"semver"},{"version":"7.2","status":"unaffected","lessThanOrEqual":"*","versionType":"original_commit_for_fix"}],"repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","programFiles":["drivers/misc/nsm.c"]}],"references":["https://git.kernel.org/stable/c/4aa3f7d48e91eb74a363c1b4d7dbdd28f5b341fb","https://git.kernel.org/stable/c/8f068342096b027181b168d91fef7ac7a2c64b25","https://git.kernel.org/stable/c/f318f5a872cb9096536e759b23ae5c9873bb80ed","https://git.kernel.org/stable/c/ce1fed11d18e163baf7f875152a33bf80f625c1a"],"weaknesses":["CWE-675"],"ingestedAt":"2026-10-29T20:12:49.727Z","source":{"repository":"CVEProject/cvelistV5","path":"cves/2026/68xxx/CVE-2026-68179.json","commit":"556c9d3a8cd17e218bb8e452ba7cd619a384ff47"},"raw":{"dataType":"CVE_RECORD","dataVersion":"5.2","cveMetadata":{"cveId":"CVE-2026-68179","state":"PUBLISHED","datePublished":"2026-08-10T11:59:50.667Z","dateUpdated":"2026-10-19T20:58:56.123Z","assignerShortName":"Linux","assignerOrgId":"416baaa9-dc9f-4396-8d5f-8c081fb06d67","dateReserved":"2026-07-30T09:28:09.373Z"},"containers":{"cna":{"title":"misc: nsm: only unlock nsm_dev on post-lock error paths","descriptions":[{"lang":"en","value":"In the Linux kernel, the following vulnerability has been resolved:\n\nmisc: nsm: only unlock nsm_dev on post-lock error paths\n\nnsm_dev_ioctl() jumps to the common out label even when the initial\ncopy_from_user() fails before nsm->lock has been taken.  The error path\nthen blindly unlocks a mutex that was never acquired.\n\nThis issue was found by our static analysis tool and then manually\nreviewed against the current tree.\n\nThe grounded PoC kept the miscdevice ioctl entry and the pre-lock\ncopy_from_user(&raw, argp, _IOC_SIZE(cmd)) failure path by issuing\nNSM_IOCTL_RAW with an invalid user pointer.  That failure reaches the\nshared out label before mutex_lock(&nsm->lock).  Lockdep reported:\n\n  WARNING: bad unlock balance detected!\n  exploit/193 is trying to release lock (&global_nsm.lock) at:\n  nsm_dev_ioctl+0x5f/0xcf [vuln_msv]\n  but there are no more locks to release!\n  no locks held by exploit/193.\n\nReturn immediately on the pre-lock copy_from_user() failure and keep the\ncommon unlock label for the post-lock paths only."}],"affected":[{"vendor":"Linux","product":"Linux","defaultStatus":"unaffected","versions":[{"version":"b9873755a6c8ccfce79094c4dce9efa3ecb1a749","status":"affected","lessThan":"4aa3f7d48e91eb74a363c1b4d7dbdd28f5b341fb","versionType":"git"},{"version":"b9873755a6c8ccfce79094c4dce9efa3ecb1a749","status":"affected","lessThan":"8f068342096b027181b168d91fef7ac7a2c64b25","versionType":"git"},{"version":"b9873755a6c8ccfce79094c4dce9efa3ecb1a749","status":"affected","lessThan":"f318f5a872cb9096536e759b23ae5c9873bb80ed","versionType":"git"},{"version":"b9873755a6c8ccfce79094c4dce9efa3ecb1a749","status":"affected","lessThan":"ce1fed11d18e163baf7f875152a33bf80f625c1a","versionType":"git"}],"repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","programFiles":["drivers/misc/nsm.c"]},{"vendor":"Linux","product":"Linux","defaultStatus":"affected","versions":[{"version":"6.8","status":"affected"},{"version":"0","status":"unaffected","lessThan":"6.8","versionType":"semver"},{"version":"6.12.101","status":"unaffected","lessThanOrEqual":"6.12.*","versionType":"semver"},{"version":"6.18.42","status":"unaffected","lessThanOrEqual":"6.18.*","versionType":"semver"},{"version":"7.1.6","status":"unaffected","lessThanOrEqual":"7.1.*","versionType":"semver"},{"version":"7.2","status":"unaffected","lessThanOrEqual":"*","versionType":"original_commit_for_fix"}],"repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","programFiles":["drivers/misc/nsm.c"]}],"references":[{"url":"https://git.kernel.org/stable/c/4aa3f7d48e91eb74a363c1b4d7dbdd28f5b341fb"},{"url":"https://git.kernel.org/stable/c/8f068342096b027181b168d91fef7ac7a2c64b25"},{"url":"https://git.kernel.org/stable/c/f318f5a872cb9096536e759b23ae5c9873bb80ed"},{"url":"https://git.kernel.org/stable/c/ce1fed11d18e163baf7f875152a33bf80f625c1a"}],"metrics":[{"cvssV3_1":{"version":"3.1","vectorString":"CVSS:3.1/AV:L/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H","baseScore":8.4,"baseSeverity":"HIGH"},"scenarios":[{"lang":"en","value":"AV:L - The flaw is reached only via the local ioctl syscall on /dev/nsm (open plus ioctl through vfs_ioctl to nsm_dev_ioctl); it is not exposed through any network protocol or remote service.\nAC:L - An attacker can reliably trigger the pre-lock copy_from_user failure with an invalid userspace pointer and can control the race by issuing concurrent ioctl or /dev/hwrng reads against the same nsm->lock.\nPR:N - The driver registers /dev/nsm as mode 0666 and performs no capability or permission checks in nsm_dev_ioctl, so any local process can open the device and issue NSM_IOCTL_RAW without elevated privileges.\nUI:N - Exploitation requires only the attacker issuing a crafted ioctl with an invalid argument pointer; no victim interaction, mounting, or other user action is needed.\nS:U - Impact is confined to corruption and privilege within the guest Nitro Enclave kernel; it does not cross into the hypervisor, parent instance, or another VM security boundary.\nC:H - Unlocking a mutex not held by the caller can clear owner while another context still holds nsm->lock, permitting concurrent unsynchronized access to shared nsm_msg buffers and virtio response data.\nI:H - Premature mutex release enables overlapping virtqueue operations and corruption of shared kernel message state, a memory-safety defect that can be leveraged for arbitrary kernel integrity compromise.\nA:H - The bug triggers lockdep bad-unlock warnings and kernel oops, and concurrent unsynchronized virtio access can panic, hang, or otherwise deny service to the enclave."}]}],"providerMetadata":{"shortName":"Linux","orgId":"416baaa9-dc9f-4396-8d5f-8c081fb06d67","dateUpdated":"2026-08-17T05:00:20.666Z"},"cpeApplicability":[{"nodes":[{"operator":"OR","negate":false,"cpeMatch":[{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionStartIncluding":"6.8","versionEndExcluding":"6.12.101"},{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionStartIncluding":"6.8","versionEndExcluding":"6.18.42"},{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionStartIncluding":"6.8","versionEndExcluding":"7.1.6"},{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionStartIncluding":"6.8","versionEndExcluding":"7.2"}]}]}],"x_generator":{"engine":"bippy-1.2.0"}},"adp":[{"title":"CISA ADP Vulnrichment","metrics":[{"other":{"type":"ssvc","content":{"id":"CVE-2026-68179","role":"CISA Coordinator","options":[{"Exploitation":"none"},{"Automatable":"no"},{"Technical Impact":"total"}],"version":"2.0.3","timestamp":"2026-10-16T15:45:31.753016Z"}}}],"problemTypes":[{"descriptions":[{"cweId":"CWE-675","lang":"en","type":"CWE","description":"CWE-675 Multiple Operations on Resource in Single-Operation Context"}]}],"providerMetadata":{"shortName":"CISA-ADP","orgId":"134c704f-9b21-4f2e-91b3-4a467353bcc0","dateUpdated":"2026-10-19T20:58:56.123Z"}}]}}}