linux/include/video
Rajat Gupta 8de779dc40 fbdev: udlfb: add vm_ops to dlfb_ops_mmap to prevent use-after-free
dlfb_ops_mmap() uses remap_pfn_range() to map vmalloc framebuffer pages
to userspace but sets no vm_ops on the VMA. This means the kernel cannot
track active mmaps. When dlfb_realloc_framebuffer() replaces the backing
buffer via FBIOPUT_VSCREENINFO, existing mmap PTEs are not invalidated.
On USB disconnect, dlfb_ops_destroy() calls vfree() on the old pages
while userspace PTEs still reference them, resulting in a use-after-free:
the process retains read/write access to freed kernel pages.

Add vm_operations_struct with open/close callbacks that maintain an
atomic mmap_count on struct dlfb_data. In dlfb_realloc_framebuffer(),
check mmap_count and return -EBUSY if the buffer is currently mapped,
preventing buffer replacement while userspace holds stale PTEs.

Tested with PoC using dummy_hcd + raw_gadget USB device emulation.

Signed-off-by: Rajat Gupta <rajgupt@qti.qualcomm.com>
Acked-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: stable@vger.kernel.org
Signed-off-by: Helge Deller <deller@gmx.de>
2026-05-04 10:35:55 +02:00
..
atmel_lcdc.h
aty128.h
broadsheetfb.h
cirrus.h
cmdline.h video/cmdline: Hide __video_get_options() behind CONFIG_FB_CORE 2024-01-23 10:11:34 +01:00
cvisionppc.h
display_timing.h
edid.h sysfb: Move edid_info into sysfb_primary_display 2025-12-16 14:12:44 +01:00
gbe.h
hecubafb.h
ili9320.h
imx-ipu-image-convert.h fbdev: ipu-v3: clean up kernel-doc warnings 2026-04-28 14:18:51 +02:00
imx-ipu-v3.h gpu: ipu-v3 ipu-cpmem: Remove unused functions 2025-03-01 11:29:03 +02:00
kyro.h fbdev: kyro: Remove unused declarations 2023-08-15 23:39:33 +02:00
mach64.h fbdev: atyfb: Remove unused PCI vendor ID 2025-05-31 10:24:01 +02:00
maxinefb.h
metronomefb.h
mipi_display.h drm/dsi: rename MIPI_DCS_SET_PARTIAL_AREA to MIPI_DCS_SET_PARTIAL_ROWS 2019-11-07 14:59:56 +02:00
mmp_disp.h fbdev: mmp: Constify struct mmp_overlay_ops 2024-06-25 14:40:01 +02:00
neomagic.h
newport.h
nomodeset.h drm: Move nomodeset kernel parameter to drivers/video 2022-11-16 13:26:12 +01:00
of_display_timing.h video: of_display_timing.h: include errno.h 2022-07-06 17:16:20 +02:00
of_videomode.h
omapfb_dss.h fbdev: omapfb: use new of_graph functions 2024-10-24 16:35:48 -05:00
omapvrfb.h
permedia2.h
pixel_format.h drm/vesadrm: Support DRM_FORMAT_C8 2025-08-26 09:54:20 +02:00
platform_lcd.h backlight: platform_lcd: Remove match_fb from struct plat_lcd_data 2024-09-30 16:49:42 +01:00
pm3fb.h
pmag-ba-fb.h
pmagb-b-fb.h
pxa168fb.h
radeon.h video: fbdev: radeon: Fix spelling typo in comment 2022-05-26 13:38:59 +02:00
s1d13xxxfb.h
sa1100fb.h
samsung_fimd.h drm/exynos: fimd: add BGR support for exynos4/5 2022-03-04 17:13:52 +09:00
sh_mobile_lcdc.h
sisfb.h fbdev/sisfb: Unexport symbols 2025-06-16 09:08:06 +02:00
sstfb.h video: fbdev: sstfb: Updated logging to fix set but not used warnings 2020-11-30 20:04:59 +01:00
sticore.h video/sticore: Remove info field from STI struct 2024-01-12 12:38:37 +01:00
tdfx.h
tgafb.h
trident.h
udlfb.h fbdev: udlfb: add vm_ops to dlfb_ops_mmap to prevent use-after-free 2026-05-04 10:35:55 +02:00
uvesafb.h fbdev: uvesafb: Remove uvesafb_exec() prototype from include/video/uvesafb.h 2023-10-16 23:19:34 +02:00
vga.h video/vga: Add VGA_IS0_R 2026-01-23 05:20:28 +02:00
videomode.h