diff options
| author | Abdifatah Suruur <suruurism@gmail.com> | 2026-09-29 12:48:44 +0300 |
|---|---|---|
| committer | Alex Williamson <alex@shazbot.org> | 2026-09-29 13:30:56 -0600 |
| commit | 9c5cd385d295fa8621dff0e9f6063e3f6ff24159 (patch) | |
| tree | 706519e21d66cddafe3b61a98608522368a62757 /tools/perf/scripts/python | |
| parent | 25fd8b27ee8d4f59cc2ad99cf67aef4570b82096 (diff) | |
| download | linux-next-9c5cd385d295fa8621dff0e9f6063e3f6ff24159.tar.gz linux-next-9c5cd385d295fa8621dff0e9f6063e3f6ff24159.zip | |
vfio/cdx: prevent read-only region mappings from becoming writable
vfio_cdx_mmap() rejects writable mappings of regions without the WRITE
flag, but leaves VM_MAYWRITE set. Userspace can map such a region
read-only and then upgrade the mapping to writable with mprotect(),
writing to MMIO regions the device marks read-only.
Clear VM_MAYWRITE for regions without the WRITE flag, as i915 does for
its read-only objects and as fixed in drm/vc4 (CVE-2026-68445),
drm/panthor (CVE-2024-53071) and commit a5edadbae57e ("ptp: vmclock:
prevent read-only mappings from becoming writable").
Note this is defensive hardening: no in-tree cdx device currently
publishes a region without the WRITE flag. The guard costs nothing and
keeps the mmap() interface honest if a read-only region ever appears.
Fixes: 234489ac56130 ("vfio/cdx: add support for CDX bus")
Signed-off-by: Abdifatah Suruur <suruurism@gmail.com>
Link: https://lore.kernel.org/r/20260929094848.7439-4-suruurism@gmail.com
Signed-off-by: Alex Williamson <alex@shazbot.org>
Diffstat (limited to 'tools/perf/scripts/python')
0 files changed, 0 insertions, 0 deletions
