From: Thomas Zimmermann <tzimmermann@suse.de>
To: CatMe0w <CatMe0w@live.cn>, Helge Deller <deller@gmx.de>,
Simona Vetter <simona@ffwll.ch>,
Albin Babu Varghese <albinbabuvarghese20@gmail.com>
Cc: dri-devel@lists.freedesktop.org, linux-fbdev@vger.kernel.org,
linux-kernel@vger.kernel.org, stable@vger.kernel.org
Subject: Re: [PATCH] fbdev: bitblit: Fix glyph clipping when fbcon pans
Date: Tue, 20 Oct 2026 13:40:44 +0200 [thread overview]
Message-ID: <d2490a35-df4e-450f-955a-0491529a3772@suse.de> (raw)
In-Reply-To: <TYYP301MB1525C03FE71D47908263EBFCF69A2@TYYP301MB1525.JPNP301.PROD.OUTLOOK.COM>
Hi
Am 17.10.26 um 10:53 schrieb CatMe0w:
> Commit 3637d34b35b2 ("fbdev: Add bounds checking in bit_putcs to fix
> vmalloc-out-of-bounds") made bit_putcs() clip glyphs to var.yres. When
> fbcon scrolls by panning, it draws text rows up to var.yres_virtual,
> so after the first pan most new text is not drawn until the next full
> redraw. This affects fbdev drivers that set FBINFO_HWACCEL_YPAN or
> FBINFO_HWACCEL_YWRAP, such as vesafb with the ypan option, when
> CONFIG_FRAMEBUFFER_CONSOLE_LEGACY_ACCELERATION=y.
>
> Clip to GETVYRES() instead, which fbcon_ud.c and fbcon_ccw.c already
> use as the drawing area height. When fbcon does not pan, GETVYRES()
> returns var.yres, keeping the existing bound. When fbcon pans, it
> returns var.yres_virtual, which the framebuffer memory must cover
> anyway for panning to work.
>
> Fixes: 3637d34b35b2 ("fbdev: Add bounds checking in bit_putcs to fix vmalloc-out-of-bounds")
> Cc: stable@vger.kernel.org
> Signed-off-by: CatMe0w <CatMe0w@live.cn>
This patch restores fbcon on my test system with sisfb.
Tested-by: Thomas Zimmermann <tzimmermann@suse.de>
Reported-by: Thomas Zimmermann <tzimmermann@suse.de>
Closes:
https://lore.kernel.org/linux-fbdev/b8b52ffd-ecec-4fba-b432-ba32135c2f99@suse.de/
Best regards
Thomas
> ---
> drivers/video/fbdev/core/bitblit.c | 7 +++++--
> 1 file changed, 5 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/video/fbdev/core/bitblit.c b/drivers/video/fbdev/core/bitblit.c
> index 39f44258d793..323a9e79a684 100644
> --- a/drivers/video/fbdev/core/bitblit.c
> +++ b/drivers/video/fbdev/core/bitblit.c
> @@ -18,6 +18,7 @@
> #include <linux/console.h>
> #include <asm/types.h>
> #include "fbcon.h"
> +#include "fbcon_rotate.h"
>
> /*
> * Accelerated handlers.
> @@ -150,7 +151,9 @@ static void bit_putcs(struct vc_data *vc, struct fb_info *info,
> const unsigned short *s, int count, int yy, int xx,
> int fg, int bg)
> {
> + struct fbcon_par *par = info->fbcon_par;
> struct fb_image image;
> + u32 vyres = GETVYRES(par->p, info);
> u32 width = DIV_ROUND_UP(vc->vc_font.width, 8);
> u32 cellsize = width * vc->vc_font.height;
> u32 maxcnt = info->pixmap.size/cellsize;
> @@ -167,10 +170,10 @@ static void bit_putcs(struct vc_data *vc, struct fb_info *info,
> image.height = vc->vc_font.height;
> image.depth = 1;
>
> - if (image.dy >= info->var.yres)
> + if (image.dy >= vyres)
> return;
>
> - image.height = min(image.height, info->var.yres - image.dy);
> + image.height = min(image.height, vyres - image.dy);
>
> if (attribute) {
> buf = kmalloc(cellsize, GFP_ATOMIC);
>
> base-commit: 8d3ae59288f1e7d58d76558a6ee96d533bc5019f
--
--
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)
next prev parent reply other threads:[~2026-10-20 11:40 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-10-17 8:53 CatMe0w
2026-10-17 9:05 ` Greg KH
2026-10-20 11:40 ` Thomas Zimmermann [this message]
2026-10-20 12:24 ` Helge Deller
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=d2490a35-df4e-450f-955a-0491529a3772@suse.de \
--to=tzimmermann@suse.de \
--cc=CatMe0w@live.cn \
--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=stable@vger.kernel.org \
/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
all inboxes | Powered by JetHome®