dax/fsdev: use __va(phys) for kaddr in direct_access
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:
dax/fsdev: use __va(phys) for kaddr in direct_access
Use __va(phys) instead of virt_addr + linear_offset for the kaddr return in __fsdev_dax_direct_access(). The previous code added a device-linear byte offset to virt_addr (which is __va of ranges[0]), but for multi-range devices with physical gaps between ranges, this linear arithmetic crosses the gap and produces a wrong kernel virtual address. Using __va(phys) where phys comes from dax_pgoff_to_phys() is correct for any range layout because the direct map translates each physical address independently.
This leaves dev_dax->virt_addr write-only, so remove the field (suggested by Dave Jiang).
From the CVE record · Linux
The Linux kernel’s dax/fsdev direct-access code can return an incorrect kernel virtual address for multi-range devices with physical gaps between ranges. The input does not describe an attack path, authentication requirements, or user interaction.
Engineers running Linux kernels with multi-range DAX devices should check whether their kernel includes the fix; affected versions are not specified.