summaryrefslogtreecommitdiff
path: root/drivers/video/fbdev/core
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2026-08-21 09:49:54 -0700
committerLinus Torvalds <torvalds@linux-foundation.org>2026-08-21 09:49:54 -0700
commit531ed942bb0df04f6747983fecdedce76a22d07f (patch)
tree90b0e9425a115c48f32d2f65ba02aa1574d7c47d /drivers/video/fbdev/core
parent4e69c1856bfd9ffb7e9d335a25842fa211628929 (diff)
parentd463633d63e6aa10384683bf39971a4b00780c56 (diff)
Merge tag 'fbdev-for-7.3-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/deller/linux-fbdev
Pull fbdev updates from Helge Deller: "The usual bunch of many small fixes in various fbdev drivers, but more interestingly the Vodoo3/4/5 cards will now be initialized even without PC BIOS support and vintage Atari computers gain more color depths and console acceleration on SuperVidel's SuperBlitter chips. New features: - Allow Vodoo3/4/5 card to be initialized without PC-BIOS (Daniel Palmer) - Add support for SuperVidel's SuperBlitter (Miro Kropacek) - Add further video bit depths (Miro Kropacek) - Detect default graphics card for console output on sticon/parisc (Helge Deller) Fixes: - kyro: Validate overlay viewport coordinates (Danila Chernetsov) - platinumfb: add error checking for ioremap calls (BingKun Yue) - ssd1307fb: damage callback fixes (Hui Su) - maxine: fix 64-bit build error and code cleanups (Randy Dunlap) - omapfb: panel-dsi-cm: initialize lock before registering display (Runyu Xiao) - core: Clamp total_size to smem_len in read/write functions (Mingyu Wang) - uvesafb, tdxfb: failure path cleanups (Myeonghun Pak) - udlfb: validate DisplayLink vendor descriptor items before usage (Pengpeng Hou) Cleanups: - Convert multiple drivers to managed PCI and ioremap API (Shixiong Ou) - Remove redundant dev_err() from multiple drivers (Pan Chuang) - omap2: do not copy isr table (Andreas Kemnade) - pvr2fb: correct user pointer annotation and sentinel initializer (Florian Fuchs) - mb862xxfb: silence possibly unused functions (Helge Deller) - au1100fb: drop unneeded semicolon (Julia Lawall) - clps711x-fb: remove unreachable code (Karl Mehltretter) - viafb: refactor strcpy call (Ajith P V) - sstfb: add missing MODULE_DEVICE_TABLE() (Pengpeng Hou) - mb862xx: replace dead Kconfig select with dependency (Julian Braha) Documentation fixes: - fonts: fixup font.h kernel-doc warnings (Randy Dunlap)" * tag 'fbdev-for-7.3-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/deller/linux-fbdev: (43 commits) fbdev: atafb: Add support for SuperVidel's SuperBlitter fbdev: atafb: Add support for further video bit depths on atafb:external fbdev: atafb: Give atafb proper parent fbdev: omapfb: panel-dsi-cm: initialize lock before registering display fbdev: viafb: refactor strcpy and viafb_name fbdev: platinumfb: add error checking for ioremap calls fbdev: maxine: use MODULE_LICENSE() unconditionally fbdev: maxine: fix maxinefb_init() return value fbdev: maxine: fix 64-bit build error fbdev: maxine: elide an unused function fbdev: maxine: make functions static fbdev: atyfb: Convert to managed PCI and ioremap API fbdev: matrox: Convert to managed PCI and ioremap API fbdev: savage: Convert to managed PCI and ioremap API fbdev: nvidia: Convert to managed PCI and ioremap API fbdev: aty128fb: Convert to managed PCI and ioremap API fbdev: clps711x-fb: Remove unreachable unregister_framebuffer() call fbdev: mb862xxfb: Silence possibly unused functions sticon/parisc: Detect default STI graphics card for console output fbdev: ssd1307fb: defer I2C transfers from damage callbacks ...
Diffstat (limited to 'drivers/video/fbdev/core')
-rw-r--r--drivers/video/fbdev/core/fb_io_fops.c16
-rw-r--r--drivers/video/fbdev/core/fb_sys_fops.c16
2 files changed, 32 insertions, 0 deletions
diff --git a/drivers/video/fbdev/core/fb_io_fops.c b/drivers/video/fbdev/core/fb_io_fops.c
index 7d16513690c3..545886cb3eeb 100644
--- a/drivers/video/fbdev/core/fb_io_fops.c
+++ b/drivers/video/fbdev/core/fb_io_fops.c
@@ -24,6 +24,14 @@ ssize_t fb_io_read(struct fb_info *info, char __user *buf, size_t count, loff_t
if (total_size == 0)
total_size = info->fix.smem_len;
+ /*
+ * Security Hardening: Defend against buggy legacy drivers that may
+ * calculate a malformed screen_size. Clamp total_size to the actual
+ * hardware mapped memory limit (smem_len) to prevent OOB access.
+ */
+ if (info->fix.smem_len && total_size > info->fix.smem_len)
+ total_size = info->fix.smem_len;
+
if (p >= total_size)
return 0;
@@ -96,6 +104,14 @@ ssize_t fb_io_write(struct fb_info *info, const char __user *buf, size_t count,
if (total_size == 0)
total_size = info->fix.smem_len;
+ /*
+ * Security Hardening: Defend against buggy legacy drivers that may
+ * calculate a malformed screen_size. Clamp total_size to the actual
+ * hardware mapped memory limit (smem_len) to prevent OOB access.
+ */
+ if (info->fix.smem_len && total_size > info->fix.smem_len)
+ total_size = info->fix.smem_len;
+
if (p > total_size)
return -EFBIG;
diff --git a/drivers/video/fbdev/core/fb_sys_fops.c b/drivers/video/fbdev/core/fb_sys_fops.c
index be96b3b3942e..e97cf02f7c70 100644
--- a/drivers/video/fbdev/core/fb_sys_fops.c
+++ b/drivers/video/fbdev/core/fb_sys_fops.c
@@ -35,6 +35,14 @@ ssize_t fb_sys_read(struct fb_info *info, char __user *buf, size_t count,
if (total_size == 0)
total_size = info->fix.smem_len;
+ /*
+ * Security Hardening: Defend against buggy legacy drivers that may
+ * calculate a malformed screen_size. Clamp total_size to the actual
+ * hardware mapped memory limit (smem_len) to prevent OOB access.
+ */
+ if (info->fix.smem_len && total_size > info->fix.smem_len)
+ total_size = info->fix.smem_len;
+
if (p >= total_size)
return 0;
@@ -80,6 +88,14 @@ ssize_t fb_sys_write(struct fb_info *info, const char __user *buf,
if (total_size == 0)
total_size = info->fix.smem_len;
+ /*
+ * Security Hardening: Defend against buggy legacy drivers that may
+ * calculate a malformed screen_size. Clamp total_size to the actual
+ * hardware mapped memory limit (smem_len) to prevent OOB access.
+ */
+ if (info->fix.smem_len && total_size > info->fix.smem_len)
+ total_size = info->fix.smem_len;
+
if (p > total_size)
return -EFBIG;