fpga: dfl-afu: validate DMA mapping length in afu_dma_map_region()
Linux
Affected versions
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
|
Linux
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
|
≥ fa8dda1edef9ebc3af467c644c5533ac97171e12 · < 59070040fd12e0b78d7b4d341d9f9a183237c5ff| No fix yet |
| Linux Linux |
|
|
In the Linux kernel, the following vulnerability has been resolved:
fpga: dfl-afu: validate DMA mapping length in afu_dma_map_region()
afu_ioctl_dma_map() accepts a 64-bit length from userspace via DFL_FPGA_PORT_DMA_MAP ioctl without an upper bound check. The value is passed to afu_dma_pin_pages() where npages is derived as length >> PAGE_SHIFT and passed to pin_user_pages_fast() which takes int nr_pages, causing implicit truncation if length is very large.
Validate map.length at the ioctl entry point before calling afu_dma_map_region(), rejecting values whose page count exceeds INT_MAX.
From the CVE record · Linux
The Linux kernel’s dfl-afu DMA mapping ioctl accepts a userspace-supplied length without an upper bound check. A local user able to call the ioctl can supply a very large length, causing the page count to be truncated when passed to pin_user_pages_fast(). The input does not specify an authentication requirement or any additional user interaction.
Engineers running Linux kernels with the dfl-afu component should check whether their kernel includes the length validation; affected versions are not specified.