From: Helge Deller <deller@gmx.de>
To: YuanZhe Liu <25031212351@stu.xidian.edu.cn>,
Steve Glendinning <steve.glendinning@shawell.net>
Cc: linux-fbdev@vger.kernel.org, dri-devel@lists.freedesktop.org,
linux-kernel@vger.kernel.org, Bin Yu <byu@xidian.edu.cn>,
Cheng Wen <wencheng@xidian.edu.cn>
Subject: Re: [PATCH] fbdev: smscufx: allocate the size advertised in smem_len
Date: Wed, 18 Nov 2026 20:16:17 +0100 [thread overview]
Message-ID: <d40ce597-6c87-4272-b70b-e964531f9fc9@gmx.de> (raw)
In-Reply-To: <20261102092925.18027-1-25031212351@stu.xidian.edu.cn>
On 11/2/26 10:29, YuanZhe Liu wrote:
> 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")
> Cc: stable@vger.kernel.org
> ---
> drivers/video/fbdev/smscufx.c | 5 +++--
> 1 file changed, 3 insertions(+), 2 deletions(-)
applied.
Thanks!
Helge
prev parent reply other threads:[~2026-11-18 19:16 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-02 9:29 [PATCH] fbdev: smscufx: allocate the size advertised in smem_len YuanZhe Liu
2026-11-18 19:16 ` Helge Deller [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=d40ce597-6c87-4272-b70b-e964531f9fc9@gmx.de \
--to=deller@gmx.de \
--cc=25031212351@stu.xidian.edu.cn \
--cc=byu@xidian.edu.cn \
--cc=dri-devel@lists.freedesktop.org \
--cc=linux-fbdev@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=steve.glendinning@shawell.net \
--cc=wencheng@xidian.edu.cn \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox