{"id":"CVE-2026-139646","state":"PUBLISHED","title":"crypto: ccp - fix SFS ioctl race against device teardown","description":"In the Linux kernel, the following vulnerability has been resolved:\n\ncrypto: ccp - fix SFS ioctl race against device teardown\n\nsfs_ioctl() reads psp_master->sfs_data and caches it in sfs_dev before\ntaking sfs_ioctl_mutex, while sfs_dev_destroy() frees sfs_dev->page\nand sfs_dev->command_buf with no locking at all and only clears\npsp->sfs_data afterwards. A call to sfs_ioctl() that reads sfs_data\njust before sfs_dev_destroy() runs will still acquire the mutex and\ngo on to use the now-freed command buffer in send_sfs_cmd().\n\nHave both functions take sfs_ioctl_mutex before touching\npsp->sfs_data, so a call that is already using sfs_dev completes\nbefore teardown can free it, and a call arriving after teardown sees\nsfs_data cleared and returns -ENODEV instead of racing it.","publishedAt":"2026-11-30T13:36:40.715Z","updatedAt":"2026-11-30T13:36:40.715Z","severity":null,"assigner":"Linux","products":["Linux Linux"],"affected":[{"vendor":"Linux","product":"Linux","defaultStatus":"unaffected","versions":[{"version":"648dbccc03a000cd64c2a9d86012d98053545e64","status":"affected","lessThan":"54a7e3828df45fdb85ea5a1e79a94d4e95b78823","versionType":"git"},{"version":"648dbccc03a000cd64c2a9d86012d98053545e64","status":"affected","lessThan":"6beb23aa2ec4c64f477d1c8e419c7e7da7046f26","versionType":"git"},{"version":"648dbccc03a000cd64c2a9d86012d98053545e64","status":"affected","lessThan":"de4929b47683ed22d8c05f68d2d0f0cfd95b90a1","versionType":"git"}],"repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","programFiles":["drivers/crypto/ccp/sfs.c"]},{"vendor":"Linux","product":"Linux","defaultStatus":"affected","versions":[{"version":"6.18","status":"affected"},{"version":"0","status":"unaffected","lessThan":"6.18","versionType":"semver"},{"version":"6.18.65","status":"unaffected","lessThanOrEqual":"6.18.*","versionType":"semver"},{"version":"7.3.6","status":"unaffected","lessThanOrEqual":"7.3.*","versionType":"semver"},{"version":"7.4-rc1","status":"unaffected","lessThanOrEqual":"*","versionType":"original_commit_for_fix"}],"repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","programFiles":["drivers/crypto/ccp/sfs.c"]}],"references":["https://git.kernel.org/stable/c/54a7e3828df45fdb85ea5a1e79a94d4e95b78823","https://git.kernel.org/stable/c/6beb23aa2ec4c64f477d1c8e419c7e7da7046f26","https://git.kernel.org/stable/c/de4929b47683ed22d8c05f68d2d0f0cfd95b90a1"],"weaknesses":[],"ingestedAt":"2026-11-30T13:54:04.526Z","source":{"repository":"CVEProject/cvelistV5","path":"cves/2026/139xxx/CVE-2026-139646.json","commit":"8c2c22940a0de21d18737df980299c0488d5dc73","baselineCommit":"556c9d3a8cd17e218bb8e452ba7cd619a384ff47"},"raw":{"dataType":"CVE_RECORD","dataVersion":"5.2","cveMetadata":{"cveId":"CVE-2026-139646","state":"PUBLISHED","datePublished":"2026-11-30T13:36:40.715Z","dateUpdated":"2026-11-30T13:36:40.715Z","assignerShortName":"Linux","assignerOrgId":"416baaa9-dc9f-4396-8d5f-8c081fb06d67","dateReserved":"2026-11-30T13:22:15.945Z"},"containers":{"cna":{"title":"crypto: ccp - fix SFS ioctl race against device teardown","descriptions":[{"lang":"en","value":"In the Linux kernel, the following vulnerability has been resolved:\n\ncrypto: ccp - fix SFS ioctl race against device teardown\n\nsfs_ioctl() reads psp_master->sfs_data and caches it in sfs_dev before\ntaking sfs_ioctl_mutex, while sfs_dev_destroy() frees sfs_dev->page\nand sfs_dev->command_buf with no locking at all and only clears\npsp->sfs_data afterwards. A call to sfs_ioctl() that reads sfs_data\njust before sfs_dev_destroy() runs will still acquire the mutex and\ngo on to use the now-freed command buffer in send_sfs_cmd().\n\nHave both functions take sfs_ioctl_mutex before touching\npsp->sfs_data, so a call that is already using sfs_dev completes\nbefore teardown can free it, and a call arriving after teardown sees\nsfs_data cleared and returns -ENODEV instead of racing it."}],"affected":[{"vendor":"Linux","product":"Linux","defaultStatus":"unaffected","versions":[{"version":"648dbccc03a000cd64c2a9d86012d98053545e64","status":"affected","lessThan":"54a7e3828df45fdb85ea5a1e79a94d4e95b78823","versionType":"git"},{"version":"648dbccc03a000cd64c2a9d86012d98053545e64","status":"affected","lessThan":"6beb23aa2ec4c64f477d1c8e419c7e7da7046f26","versionType":"git"},{"version":"648dbccc03a000cd64c2a9d86012d98053545e64","status":"affected","lessThan":"de4929b47683ed22d8c05f68d2d0f0cfd95b90a1","versionType":"git"}],"repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","programFiles":["drivers/crypto/ccp/sfs.c"]},{"vendor":"Linux","product":"Linux","defaultStatus":"affected","versions":[{"version":"6.18","status":"affected"},{"version":"0","status":"unaffected","lessThan":"6.18","versionType":"semver"},{"version":"6.18.65","status":"unaffected","lessThanOrEqual":"6.18.*","versionType":"semver"},{"version":"7.3.6","status":"unaffected","lessThanOrEqual":"7.3.*","versionType":"semver"},{"version":"7.4-rc1","status":"unaffected","lessThanOrEqual":"*","versionType":"original_commit_for_fix"}],"repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","programFiles":["drivers/crypto/ccp/sfs.c"]}],"references":[{"url":"https://git.kernel.org/stable/c/54a7e3828df45fdb85ea5a1e79a94d4e95b78823"},{"url":"https://git.kernel.org/stable/c/6beb23aa2ec4c64f477d1c8e419c7e7da7046f26"},{"url":"https://git.kernel.org/stable/c/de4929b47683ed22d8c05f68d2d0f0cfd95b90a1"}],"providerMetadata":{"shortName":"Linux","orgId":"416baaa9-dc9f-4396-8d5f-8c081fb06d67","dateUpdated":"2026-11-30T13:36:40.715Z"},"cpeApplicability":[{"nodes":[{"operator":"OR","negate":false,"cpeMatch":[{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionStartIncluding":"6.18","versionEndExcluding":"6.18.65"},{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionStartIncluding":"6.18","versionEndExcluding":"7.3.6"},{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionStartIncluding":"6.18","versionEndExcluding":"7.4-rc1"}]}]}],"x_generator":{"engine":"bippy-1.2.0"}}}}}