From: Thomas Zimmermann <tzimmermann@suse.de>
To: Helge Deller <deller@gmx.de>,
Albin Babu Varghese <albinbabuvarghese20@gmail.com>,
Simona Vetter <simona@ffwll.ch>
Cc: syzbot+48b0652a95834717f190@syzkaller.appspotmail.com,
linux-fbdev@vger.kernel.org, dri-devel@lists.freedesktop.org,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH v2] fbdev: Add bounds checking in bit_putcs to fix vmalloc-out-of-bounds
Date: Thu, 15 Oct 2026 11:07:35 +0200 [thread overview]
Message-ID: <b8b52ffd-ecec-4fba-b432-ba32135c2f99@suse.de> (raw)
In-Reply-To: <b4af6e84-6555-4629-8291-fc4c2c99390b@gmx.de>
Hi
Am 04.10.25 um 02:43 schrieb Helge Deller:
> On 10/3/25 09:32, Albin Babu Varghese wrote:
>> Add bounds checking to prevent writes past framebuffer boundaries when
>> rendering text near screen edges. Return early if the Y position is
>> off-screen
>> and clip image height to screen boundary. Break from the rendering
>> loop if the
>> X position is off-screen. When clipping image width to fit the
>> screen, update
>> the character count to match the clipped width to prevent buffer size
>> mismatches.
>>
>> Without the character count update, bit_putcs_aligned and
>> bit_putcs_unaligned
>> receive mismatched parameters where the buffer is allocated for the
>> clipped
>> width but cnt reflects the original larger count, causing
>> out-of-bounds writes.
>>
>> Reported-by: syzbot+48b0652a95834717f190@syzkaller.appspotmail.com
>> Closes: https://syzkaller.appspot.com/bug?extid=48b0652a95834717f190
>> Suggested-by: Helge Deller <deller@gmx.de>
>> Tested-by: syzbot+48b0652a95834717f190@syzkaller.appspotmail.com
>> Signed-off-by: Albin Babu Varghese <albinbabuvarghese20@gmail.com>
>> ---
>> Changes in v2:
>> - Partially render when height exceeding screen boundaries instead of
>> skipping
>> - Update character count when width is clipped to prevent buffer
>> mismatch
>>
>> Link to v1:
>> https://lore.kernel.org/all/20250927075010.119671-1-albinbabuvarghese20@gmail.com/
>>
>> ---
>> drivers/video/fbdev/core/bitblit.c | 20 ++++++++++++++++++++
>> 1 file changed, 20 insertions(+)
>
> applied.
This patch mangles fbcon output on fbdev HW drivers. It's reproducible
on matroxfb and sisfb. Reverting the change restores these driver's
functionality.
Fbcon from within DRM's fbdev emulation works.
Best regards
Thomas
>
> Thanks!
> Helge
>
--
--
Thomas Zimmermann
Graphics Driver Developer
SUSE Software Solutions Germany GmbH
Frankenstr. 146, 90461 Nürnberg, Germany, www.suse.com
GF: Stefan Gaiser, Jochen Jaser, Abhinav Puri, (HRB 36809, AG Nürnberg)
prev parent reply other threads:[~2026-10-15 9:07 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-10-03 7:32 [PATCH v2] fbdev: Add bounds checking in bit_putcs to fix vmalloc-out-of-bounds Albin Babu Varghese
2025-10-04 0:43 ` Helge Deller
2025-10-16 1:45 ` Albin Babu Varghese
2026-10-15 9:07 ` Thomas Zimmermann [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=b8b52ffd-ecec-4fba-b432-ba32135c2f99@suse.de \
--to=tzimmermann@suse.de \
--cc=albinbabuvarghese20@gmail.com \
--cc=deller@gmx.de \
--cc=dri-devel@lists.freedesktop.org \
--cc=linux-fbdev@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=simona@ffwll.ch \
--cc=syzbot+48b0652a95834717f190@syzkaller.appspotmail.com \
/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