From: Jiri Slaby <jirislaby@kernel.org>
To: Jari Ruusu <jariruusu@protonmail.com>,
Yi Yang <yiyang13@huawei.com>, GONG Ruiqi <gongruiqi1@huawei.com>,
Helge Deller <deller@gmx.de>,
Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
Sasha Levin <sashal@kernel.org>,
Linus Torvalds <torvalds@linux-foundation.org>
Cc: "stable@vger.kernel.org" <stable@vger.kernel.org>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: Re: Text mode VGA-console scrolling is broken in upstream & stable trees
Date: Thu, 31 Jul 2025 09:22:31 +0200 [thread overview]
Message-ID: <a1d0172f-5f3c-4f3e-9362-d9de0192e8b2@kernel.org> (raw)
In-Reply-To: <C4_ogGo3eSdgo3wcbkdIXQDoGk2CShDfiQEjnwmgLUvd1cVp5kKguDC4M7KlWO4Tg9Ny3joveq7vH9K_zpBGvIA8-UkU2ogSE1T9Y6782js=@protonmail.com>
On 30. 07. 25, 16:06, Jari Ruusu wrote:
> The patch that broke text mode VGA-console scrolling is this one:
> "vgacon: Add check for vc_origin address range in vgacon_scroll()"
> commit 864f9963ec6b4b76d104d595ba28110b87158003 upstream.
>
> How to preproduce:
> (1) boot a kernel that is configured to use text mode VGA-console
> (2) type commands: ls -l /usr/bin | less -S
> (3) scroll up/down with cursor-down/up keys
>
> Above mentioned patch seems to have landed in upstream and all
> kernel.org stable trees with zero testing. Even minimal testing
> would have shown that it breaks text mode VGA-console scrolling.
At the time this was posted (privately and on security@), I commented:
=====
> --- a/drivers/video/console/vgacon.c
> +++ b/drivers/video/console/vgacon.c
> @@ -1168,7 +1168,7 @@ static bool vgacon_scroll(struct vc_data *c,
unsigned int t, unsigned int b,
> c->vc_screenbuf_size - delta);
> c->vc_origin = vga_vram_end - c->vc_screenbuf_size;
> vga_rolled_over = 0;
> - } else
> + } else if (oldo - delta >= (unsigned long)c->vc_screenbuf)
> c->vc_origin -= delta;
IMO you should also add:
else
c->vc_origin = c->vc_screenbuf;
Or clamp 'delta' beforehand and don't add the 'if'.
=====
That did not happen, AFAICS. Care to test the above suggestion?
thanks,
--
js
suse labs
next prev parent reply other threads:[~2025-07-31 7:22 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-07-30 14:06 Text mode VGA-console scrolling is broken in upstream & stable trees Jari Ruusu
2025-07-30 14:26 ` Greg Kroah-Hartman
2025-07-30 15:20 ` Salvatore Bonaccorso
2025-07-31 7:22 ` Jiri Slaby [this message]
2025-07-31 16:12 ` Jari Ruusu
2025-08-02 19:54 ` 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=a1d0172f-5f3c-4f3e-9362-d9de0192e8b2@kernel.org \
--to=jirislaby@kernel.org \
--cc=deller@gmx.de \
--cc=gongruiqi1@huawei.com \
--cc=gregkh@linuxfoundation.org \
--cc=jariruusu@protonmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=sashal@kernel.org \
--cc=stable@vger.kernel.org \
--cc=torvalds@linux-foundation.org \
--cc=yiyang13@huawei.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