md: scope memalloc_noio to allocation critical sections
Linux
Affected versions
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
| No fix yet |
| Linux Linux |
|
Linux
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
| No fix yet |
| Linux Linux |
|
|
In the Linux kernel, the following vulnerability has been resolved:
md: scope memalloc_noio to allocation critical sections
Storing a memalloc_noio_save() token in mddev->noio_flags lets one task save the token and another task restore it. With concurrent suspend sysfs writes, task A can enter PF_MEMALLOC_NOIO, return to userspace still in that scope, and later task B can restore A's saved token.
Avoid tying the token lifetime to mddev. Keep mddev_suspend() and mddev_resume() only responsible for array suspension, and enter PF_MEMALLOC_NOIO only in the MD paths that allocate memory after the array has been suspended. Restore the token before resuming the array.
A reproducer repeatedly writes suspend_lo and suspend_hi from concurrent workers and checks each worker's /proc/self/stat flags before and after the sysfs write.
From the CVE record · Linux
The Linux kernel's md component can leave a task in PF_MEMALLOC_NOIO after it returns to userspace. This can occur when local workers concurrently write the suspend_lo and suspend_hi sysfs entries, causing one task to restore another task's saved token. Exploitation requires the ability to write those sysfs entries; the input does not specify authentication requirements.
Teams running the Linux kernel's md component should check their systems; affected versions were not provided.