linux/drivers/accel/qaic
Zack McKevitt aa16b2bc0f accel/qaic: Add overflow check to remap_pfn_range during mmap
The call to remap_pfn_range in qaic_gem_object_mmap is susceptible to
(re)mapping beyond the VMA if the BO is too large. This can cause use
after free issues when munmap() unmaps only the VMA region and not the
additional mappings. To prevent this, check the remaining size of the
VMA before remapping and truncate the remapped length if sg->length is
too large.

Reported-by: Lukas Maar <lukas.maar@tugraz.at>
Fixes: ff13be8303 ("accel/qaic: Add datapath")
Reviewed-by: Karol Wachowski <karol.wachowski@linux.intel.com>
Signed-off-by: Zack McKevitt <zachary.mckevitt@oss.qualcomm.com>
Reviewed-by: Jeff Hugo <jeff.hugo@oss.qualcomm.com>
[jhugo: fix braces from checkpatch --strict]
Signed-off-by: Jeff Hugo <jeff.hugo@oss.qualcomm.com>
Link: https://patch.msgid.link/20260430193858.1178641-1-zachary.mckevitt@oss.qualcomm.com
History 2026-05-12 10:58:18 -06:00
..
Kconfig accel/qaic: Collect crashdump from SSR channel 2025-11-07 11:16:51 -07:00
Makefile accel/qaic: Implement basic SSR handling 2025-11-07 11:01:18 -07:00
mhi_controller.c net: qrtr: Drop the MHI auto_queue feature for IPCR DL channels 2025-12-31 16:24:04 +05:30
mhi_controller.h accel/qaic: Add AIC200 support 2025-01-31 10:08:45 -07:00
qaic.h accel/qaic: Add qaic_ prefix to irq_polling_work 2025-11-07 11:27:46 -07:00
qaic_control.c accel/qaic: Handle DBC deactivation if the owner went away 2026-03-27 10:48:30 -06:00
qaic_data.c accel/qaic: Add overflow check to remap_pfn_range during mmap 2026-05-12 10:58:18 -06:00
qaic_debugfs.c accel/qaic: Fix bootlog initialization ordering 2025-10-14 08:30:39 -06:00
qaic_debugfs.h accel/qaic: mark debugfs stub functions as static inline 2024-04-12 09:53:28 -06:00
qaic_drv.c Convert 'alloc_obj' family to use the new default GFP_KERNEL argument 2026-02-21 17:09:51 -08:00
qaic_ras.c accel/qaic: fix incorrect counter check in RAS message decode 2026-05-01 15:14:25 -06:00
qaic_ras.h accel/qaic: Add Reliability, Accessibility, Serviceability (RAS) 2025-05-30 09:14:35 -06:00
qaic_ssr.c Convert more 'alloc_obj' cases to default GFP_KERNEL arguments 2026-02-21 20:03:00 -08:00
qaic_ssr.h accel/qaic: Collect crashdump from SSR channel 2025-11-07 11:16:51 -07:00
qaic_sysfs.c accel/qaic: Add DMA Bridge Channel(DBC) sysfs and uevents 2025-11-07 10:55:39 -07:00
qaic_timesync.c Convert 'alloc_obj' family to use the new default GFP_KERNEL argument 2026-02-21 17:09:51 -08:00
qaic_timesync.h accel/qaic: Add support for PM callbacks 2025-11-05 15:41:43 -07:00
sahara.c accel/qaic: Update the sahara image table for AIC200 2025-10-27 11:52:09 -06:00
sahara.h accel/qaic: Add Sahara implementation for firmware loading 2024-04-12 09:49:31 -06:00