CVE-2026-139646: crypto: ccp - fix SFS ioctl race against device teardown
In the Linux kernel, the following vulnerability has been resolved:
crypto: ccp - fix SFS ioctl race against device teardown
sfsioctl() reads pspmaster->sfsdata and caches it in sfsdev before taking sfsioctlmutex, while sfsdevdestroy() frees sfsdev->page and sfsdev->commandbuf with no locking at all and only clears psp->sfsdata afterwards. A call to sfsioctl() that reads sfsdata just before sfsdevdestroy() runs will still acquire the mutex and go on to use the now-freed command buffer in sendsfscmd().
Have both functions take sfsioctlmutex before touching psp->sfsdata, so a call that is already using sfsdev completes before teardown can free it, and a call arriving after teardown sees sfsdata cleared and returns -ENODEV instead of racing it.
Affected Software
Remediation
Recommended actions to resolve this vulnerability, in priority order.
- Compensating control
In sfs_ioctl() and sfs_dev_destroy(), acquire sfs_ioctl_mutex before accessing psp->sfs_data or sfs_dev->command_buf; clear sfs_data during teardown so calls arriving afterward return -ENODEV.
Event History
Frequently Asked Questions
Who is exposed to this race condition?
Systems using the Linux kernel CCP SFS ioctl path are exposed when an ioctl can run concurrently with teardown of the associated SFS device. The provided data does not identify specific hardware, kernel versions, or configuration defaults.
What must occur for the vulnerability to be triggered?
An sfs_ioctl() call must read and retain the SFS device pointer immediately before sfs_dev_destroy() tears down that device. The ioctl can then acquire the mutex and use a command buffer that teardown has already freed.
What behavior indicates the race has been fixed?
Teardown and ioctl operations both take sfs_ioctl_mutex before accessing psp->sfs_data. An ioctl already using the device completes before its buffers are freed, while an ioctl arriving after teardown sees cleared sfs_data and returns -ENODEV.