linux/drivers/video/fbdev/core
Thomas Zimmermann 9b2f5ef00e fbcon: Fix OOB access in font allocation
Commit 1a194e6c8e ("fbcon: fix integer overflow in fbcon_do_set_font")
introduced an out-of-bounds access by storing data and allocation sizes
in the same variable. Restore the old size calculation and use the new
variable 'alloc_size' for the allocation.

Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
Fixes: 1a194e6c8e ("fbcon: fix integer overflow in fbcon_do_set_font")
Reported-by: Jani Nikula <jani.nikula@linux.intel.com>
Closes: https://gitlab.freedesktop.org/drm/i915/kernel/-/issues/15020
Closes: https://gitlab.freedesktop.org/drm/xe/kernel/-/issues/6201
Cc: Samasth Norway Ananda <samasth.norway.ananda@oracle.com>
Cc: Thomas Zimmermann <tzimmermann@suse.de>
Cc: George Kennedy <george.kennedy@oracle.com>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: Simona Vetter <simona@ffwll.ch>
Cc: Helge Deller <deller@gmx.de>
Cc: "Ville Syrjälä" <ville.syrjala@linux.intel.com>
Cc: Sam Ravnborg <sam@ravnborg.org>
Cc: Qianqiang Liu <qianqiang.liu@163.com>
Cc: Shixiong Ou <oushixiong@kylinos.cn>
Cc: Kees Cook <kees@kernel.org>
Cc: <stable@vger.kernel.org> # v5.9+
Cc: Zsolt Kajtar <soci@c64.rulez.org>
Reviewed-by: Lucas De Marchi <lucas.demarchi@intel.com>
Reviewed-by: Qianqiang Liu <qianqiang.liu@163.com>
Link: https://lore.kernel.org/r/20250922134619.257684-1-tzimmermann@suse.de
2025-09-23 11:36:14 +02:00
..
Kconfig fbdev fixes and cleanups for 6.17-rc1: 2025-08-02 09:58:11 -07:00
Makefile fbdev: Rename FB_SYS_FOPS token to FB_SYSMEM_FOPS 2023-11-29 12:20:42 +01:00
bitblit.c fbcon: Use correct erase colour for clearing in fbcon 2025-03-26 22:39:19 +01:00
cfbcopyarea.c fbdev: Include <linux/export.h> 2025-06-16 09:06:19 +02:00
cfbfillrect.c fbdev: Include <linux/export.h> 2025-06-16 09:06:19 +02:00
cfbimgblt.c fbdev: Include <linux/export.h> 2025-06-16 09:06:19 +02:00
cfbmem.h fbdev: Refactoring the fbcon packed pixel drawing routines 2025-03-26 22:39:21 +01:00
fb_backlight.c backlight: Replace fb events with a dedicated function call 2025-04-10 10:39:03 +01:00
fb_chrdev.c fbdev: Remove default file-I/O implementations 2023-11-29 12:20:53 +01:00
fb_cmdline.c fbdev: Handle video= parameter in video/cmdline.c 2023-02-20 14:56:48 +01:00
fb_copyarea.h fbdev: Refactoring the fbcon packed pixel drawing routines 2025-03-26 22:39:21 +01:00
fb_ddc.c fbdev: Include <linux/export.h> 2025-06-16 09:06:19 +02:00
fb_defio.c fbdev: Include <linux/export.h> 2025-06-16 09:06:19 +02:00
fb_draw.h fbdev: Refactoring the fbcon packed pixel drawing routines 2025-03-26 22:39:21 +01:00
fb_fillrect.h fbdev: Refactoring the fbcon packed pixel drawing routines 2025-03-26 22:39:21 +01:00
fb_imageblit.h fbdev: Refactoring the fbcon packed pixel drawing routines 2025-03-26 22:39:21 +01:00
fb_info.c fbdev: Track display blanking state 2025-04-10 10:38:57 +01:00
fb_internal.h fbdev/core: Move logo functions into separate source file 2023-09-11 15:12:35 +02:00
fb_io_fops.c fbdev: Include <linux/export.h> 2025-06-16 09:06:19 +02:00
fb_logo.c fbdev/core: Remove empty internal helpers from fb_logo.c 2023-09-11 15:12:37 +02:00
fb_notify.c
fb_procfs.c fbdev/core: Move procfs code to separate file 2023-06-27 09:58:51 +02:00
fb_sys_fops.c fbdev: Include <linux/export.h> 2025-06-16 09:06:19 +02:00
fbcmap.c fbdev: Include <linux/export.h> 2025-06-16 09:06:19 +02:00
fbcon.c fbcon: Fix OOB access in font allocation 2025-09-23 11:36:14 +02:00
fbcon.h fbcon: Use correct erase colour for clearing in fbcon 2025-03-26 22:39:19 +01:00
fbcon_ccw.c fbcon: Use correct erase colour for clearing in fbcon 2025-03-26 22:39:19 +01:00
fbcon_cw.c fbcon: Use correct erase colour for clearing in fbcon 2025-03-26 22:39:19 +01:00
fbcon_rotate.c
fbcon_rotate.h
fbcon_ud.c fbcon: Use correct erase colour for clearing in fbcon 2025-03-26 22:39:19 +01:00
fbcvt.c fbdev: core: fbcvt: avoid division by 0 in fb_cvt_hperiod() 2025-05-31 10:24:02 +02:00
fbmem.c fbdev: fix potential buffer overflow in do_register_framebuffer() 2025-07-27 19:56:51 +02:00
fbmon.c video: Make CONFIG_FIRMWARE_EDID generally available 2025-06-16 11:00:28 +02:00
fbsysfs.c fbdev: Track display blanking state 2025-04-10 10:38:57 +01:00
modedb.c fbdev: Include <linux/export.h> 2025-06-16 09:06:19 +02:00
softcursor.c
svgalib.c fbdev fixes and cleanups for 6.17-rc1: 2025-08-02 09:58:11 -07:00
syscopyarea.c fbdev: Include <linux/export.h> 2025-06-16 09:06:19 +02:00
sysfillrect.c fbdev: Include <linux/export.h> 2025-06-16 09:06:19 +02:00
sysimgblt.c fbdev: Include <linux/export.h> 2025-06-16 09:06:19 +02:00
sysmem.h fbdev: Refactoring the fbcon packed pixel drawing routines 2025-03-26 22:39:21 +01:00
tileblit.c fbcon: Use correct erase colour for clearing in fbcon 2025-03-26 22:39:19 +01:00