From: Yao Yiqi <yyaqia@gmail.com>
To: deller@gmx.de, tzimmermann@suse.de, simona@ffwll.ch
Cc: dri-devel@lists.freedesktop.org, linux-fbdev@vger.kernel.org,
linux-kernel@vger.kernel.org, yaoyiqi3@huawei.com,
Yao Yiqi <yyaqia@gmail.com>
Subject: [PATCH v5 0/3] fbcon: fix rotated font buffer handling on font change
Date: Mon, 19 Oct 2026 17:43:28 +0800 [thread overview]
Message-ID: <20261019094331.1128871-1-yyaqia@gmail.com> (raw)
Fix out-of-bounds reads of the rotated font buffer when the console
font changes on a rotated console (fbcon=rotate:N). KDFONTOP installs
the new geometry and vc_resize() redraws before par->rotated.buf is
updated, so the old buffer is indexed with the new cell size.
Patch 1 keys the rotated font cache on the font geometry. Patch 2
rebuilds it on font changes, saving and restoring the whole cache if
the change fails. Patch 3 retries a failed allocation.
Changes since v4: save, clear and restore the entire par->rotated
state instead of only the buffer; restoring just the buffer left the
cache key describing the rejected font, which could make a later
switch skip the rebuild and index the smaller buffer with the larger
font's geometry (found by the Sashiko review).
v4: https://lore.kernel.org/all/20261019090206.1094958-1-yyaqia@gmail.com/
v1: https://lore.kernel.org/all/20261014085102.497789-1-yaoyiqi3@huawei.com/
Yao Yiqi (3):
fbcon: Include font geometry in the rotated font cache
fbcon: Rebuild rotated font buffer on font change
fbcon: Retry rotated font allocation after failure
drivers/video/fbdev/core/fbcon.c | 46 ++++++++++++++++++++++++++
drivers/video/fbdev/core/fbcon.h | 19 ++++++----
drivers/video/fbdev/core/fbcon_rotate.c | 10 ++++++-
3 files changed, 68 insertions(+), 7 deletions(-)
--
2.56.0
next reply other threads:[~2026-10-19 9:43 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-10-19 9:43 Yao Yiqi [this message]
2026-10-19 9:43 ` [PATCH v5 1/3] fbcon: Include font geometry in the rotated font cache Yao Yiqi
2026-10-19 9:43 ` [PATCH v5 2/3] fbcon: Rebuild rotated font buffer on font change Yao Yiqi
2026-10-19 9:43 ` [PATCH v5 3/3] fbcon: Retry rotated font allocation after failure Yao Yiqi
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=20261019094331.1128871-1-yyaqia@gmail.com \
--to=yyaqia@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=tzimmermann@suse.de \
--cc=yaoyiqi3@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
all inboxes | Powered by JetHome®