All of lore.kernel.org
 help / color / mirror / Atom feed
From: sashiko-bot@kernel.org
To: "Yao Yiqi" <yyaqia@gmail.com>
Cc: dri-devel@lists.freedesktop.org
Subject: Re: [PATCH v2 2/3] fbcon: Rebuild rotated font buffer on font change
Date: Fri, 16 Oct 2026 04:10:44 +0000	[thread overview]
Message-ID: <sashiko-outbox-173733@kernel.org> (raw)
In-Reply-To: <20261016034533.445862-3-yaoyiqi3@huawei.com>

Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [Medium] fbcon: hardware tileblitting desync on set_font error path
--

commit 4bfab26c62faf08e2aeace132c9263da4258cec4
Author: Yao Yiqi <yyaqia@gmail.com>

fbcon: Rebuild rotated font buffer on font change

Rebuilds the rotated font buffer for the visible console when the font is 
changed, preventing an out-of-bounds read if the new font size differs. 
Selects the console blitting state via set_blitting_type() before rotation, 
and rebuilds the rotated font again on the error path if vc_resize() fails.

> diff --git a/drivers/video/fbdev/core/fbcon.c b/drivers/video/fbdev/core/fbcon.c
> index 01715873ea49b..1a2fe9fc1dc2a 100644
> --- a/drivers/video/fbdev/core/fbcon.c
> +++ b/drivers/video/fbdev/core/fbcon.c

[ ... ]

> @@ -2466,6 +2477,14 @@ static int fbcon_do_set_font(struct vc_data *vc, int w, int h, int charcount,
>  	else if (!old_hi_font_mask && vc->vc_hi_font_mask)
>  		set_vc_hi_font(vc, false);
>  
> +	/*
> +	 * The rotated font buffer was rebuilt for the new font before
> +	 * vc_resize() was attempted. Call rotate_font() again to
> +	 * overwrite par->rotated with the restored font's state.
> +	 */
> +	if (con_is_visible(vc) && par->bitops->rotate_font)
> +		par->bitops->rotate_font(info, vc);
> +

[Severity: Medium]
When vc_resize() fails, this error path successfully restores the software
font state and rotated buffer, but does this leave the hardware tileblitting 
engine out of sync?

Earlier in fbcon_do_set_font(), set_blitting_type() is called to configure
the hardware with the new font's dimensions. Since set_blitting_type() isn't 
called again here to revert the hardware state, it seems the tile engine 
could remain programmed with the rejected font dimensions while the software 
console reverts to the old font. Could this lead to screen corruption or 
hardware bounds mismatches?

>  	font_data_put(data);
>  
>  	return ret;

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20261016034533.445862-1-yaoyiqi3@huawei.com?part=2

  reply	other threads:[~2026-10-16  4:10 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-10-16  3:45 [PATCH v2 0/3] fbcon: fix rotated font buffer handling on font change Yao Yiqi
2026-10-16  3:45 ` [PATCH v2 1/3] fbcon: Include font geometry in the rotated font cache Yao Yiqi
2026-10-16  3:45 ` [PATCH v2 2/3] fbcon: Rebuild rotated font buffer on font change Yao Yiqi
2026-10-16  4:10   ` sashiko-bot [this message]
2026-10-16  3:45 ` [PATCH v2 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=sashiko-outbox-173733@kernel.org \
    --to=sashiko-bot@kernel.org \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=sashiko-reviews@lists.linux.dev \
    --cc=yyaqia@gmail.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.