summaryrefslogtreecommitdiff
path: root/include/linux
diff options
context:
space:
mode:
authorYuanZhe Liu <25031212351@stu.xidian.edu.cn>2026-11-02 17:29:25 +0800
committerHelge Deller <deller@gmx.de>2026-11-19 17:57:11 +0100
commitae14fe6f367a9779e108449b4af41791bd6aaa47 (patch)
treecf21237d4438284ab94b4c5c703ff0a5f4028169 /include/linux
parente8645fe7419828fd95a90171149c565c1bb72911 (diff)
fbdev: smscufx: allocate the size advertised in smem_len
ufx_realloc_framebuffer() allocates line_length * yres bytes but records PAGE_ALIGN(line_length * yres) in info->fix.smem_len. ufx_ops_set_par() clears the framebuffer by writing smem_len bytes, so the write runs past the end of the vmalloc() allocation whenever the mode size is not page aligned: BUG: KASAN: vmalloc-out-of-bounds in ufx_ops_set_par Write of size 2 at addr ffffc90005518600 Call Trace: ufx_ops_set_par ufx_usb_probe usb_probe_interface This runs from the probe path, before any client can open the device: with the fallback mode of 800x600 at 16 bpp the framebuffer is 960000 bytes and PAGE_ALIGN() adds 2560 bytes that were never allocated. Allocate the page aligned size that is published in smem_len instead, so the buffer covers every byte the driver and the framebuffer core can reach through smem_start and smem_len. Fixes: 3c8a63e22a08 ("Add support for SMSC UFX6000/7000 USB display adapters") Signed-off-by: YuanZhe Liu <25031212351@stu.xidian.edu.cn> Cc: stable@vger.kernel.org Signed-off-by: Helge Deller <deller@gmx.de>
Diffstat (limited to 'include/linux')
0 files changed, 0 insertions, 0 deletions