* [PATCH 1/2] fbdev: radeonfb: reject a zero pixclock in radeonfb_check_var()
@ 2026-11-20 17:54 Helge Deller
2026-11-20 17:54 ` [PATCH 2/2] fbcon: Don't drop last logo line if logo is same size as screen Helge Deller
0 siblings, 1 reply; 3+ messages in thread
From: Helge Deller @ 2026-11-20 17:54 UTC (permalink / raw)
To: linux-fbdev, dri-devel; +Cc: Jianqiang Zou, stable
From: Jianqiang Zou <jq.zou@outlook.com>
radeonfb_set_par() derives the dot clock from the user supplied
struct fb_var_screeninfo:
dotClock = 1000000000 / pixClock;
where pixClock is copied from mode->pixclock. A zero pixclock
bypasses the existing validation and makes the kernel divide by zero
in radeonfb_set_par().
The driver does have a check for this: fb_validate_mode() returns
-EINVAL when pixclock is 0, but radeon_match_mode() only calls it when
the output has no scaler and an EDID-derived mode database is
available:
if (has_rmx == 0 && rinfo->mon1_modedb)
if (fb_validate_mode(...))
return -EINVAL;
mon1_modedb is only filled in when an EDID is read, so when no
EDID-derived mode database is available the validation is skipped and
the invalid mode reaches radeonfb_set_par().
Reject a zero pixclock in radeonfb_check_var() before matching the
mode. fb_set_var() calls it on the FBIOPUT_VSCREENINFO path before
->fb_set_par(), so the invalid value is rejected before the mode is
applied. This is the same check other fbdev drivers use (i740fb,
arkfb, s3fb).
Reproduced on Linux 7.3.0 using a custom QEMU PCI stub device with
vendor/device ID 1002:5955; no physical Radeon hardware was used. A
single FBIOPUT_VSCREENINFO with pixclock = 0 is enough to trigger the
divide error.
Signed-off-by: Jianqiang Zou <jq.zou@outlook.com>
Cc: stable@vger.kernel.org
Signed-off-by: Helge Deller <deller@gmx.de>
---
drivers/video/fbdev/aty/radeon_base.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/drivers/video/fbdev/aty/radeon_base.c b/drivers/video/fbdev/aty/radeon_base.c
index 387bc5f96765..45dd42134e81 100644
--- a/drivers/video/fbdev/aty/radeon_base.c
+++ b/drivers/video/fbdev/aty/radeon_base.c
@@ -836,6 +836,9 @@ static int radeonfb_check_var (struct fb_var_screeninfo *var, struct fb_info *in
int nom, den;
unsigned int pitch;
+ if (!var->pixclock)
+ return -EINVAL;
+
if (radeon_match_mode(rinfo, &v, var))
return -EINVAL;
--
2.56.1
^ permalink raw reply related [flat|nested] 3+ messages in thread* [PATCH 2/2] fbcon: Don't drop last logo line if logo is same size as screen
2026-11-20 17:54 [PATCH 1/2] fbdev: radeonfb: reject a zero pixclock in radeonfb_check_var() Helge Deller
@ 2026-11-20 17:54 ` Helge Deller
2026-11-20 18:38 ` sashiko-bot
0 siblings, 1 reply; 3+ messages in thread
From: Helge Deller @ 2026-11-20 17:54 UTC (permalink / raw)
To: linux-fbdev, dri-devel; +Cc: Henri Roosen, stable
Henri reported a regression that when a custom bootlogo is exactly as
big as the screen, a white bar with the size of the font height is
displayed at the bottom of the display.
This patch fixes this off-by-one bug, but now -as sashiko-bot noticed-
since the logo covers the whole screen there is no area left in which
the text can be scrolled. To avoid accesses outside the screen memory
simply keep the text area covering the full screen (and possibly
overwriting) the full-screen logo.
Fixes: 94e6a058b168 ("fbcon: Fix KASAN slab-out-of-bounds Read in fbcon_prepare_logo")
Tested-by: Henri Roosen <henri.roosen@ginzinger.com>
Signed-off-by: Helge Deller <deller@gmx.de>
Cc: stable@vger.kernel.org # v7.3+
---
drivers/video/fbdev/core/fbcon.c | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/drivers/video/fbdev/core/fbcon.c b/drivers/video/fbdev/core/fbcon.c
index d7890e119dc7..cc311dc0e2e4 100644
--- a/drivers/video/fbdev/core/fbcon.c
+++ b/drivers/video/fbdev/core/fbcon.c
@@ -666,7 +666,7 @@ static void fbcon_prepare_logo(struct vc_data *vc, struct fb_info *info,
logo_height = fb_prepare_logo(info, par->rotate);
logo_lines = DIV_ROUND_UP(logo_height, vc->vc_font.height);
logo_lines = min(logo_lines, rows);
- logo_lines = min(logo_lines, new_rows - 1);
+ logo_lines = min(logo_lines, new_rows);
if (logo_lines <= 0) {
logo_lines = 0;
logo_shown = FBCON_LOGO_DONTSHOW;
@@ -734,7 +734,9 @@ static void fbcon_prepare_logo(struct vc_data *vc, struct fb_info *info,
pr_info("fbcon: disable boot-logo (boot-logo bigger than screen).\n");
} else {
logo_shown = FBCON_LOGO_DRAW;
- vc->vc_top = logo_lines;
+ /* keep vc_top if logo covers whole screen */
+ if (logo_lines < vc->vc_bottom)
+ vc->vc_top = logo_lines;
}
}
#endif /* MODULE */
--
2.56.1
^ permalink raw reply related [flat|nested] 3+ messages in thread* Re: [PATCH 2/2] fbcon: Don't drop last logo line if logo is same size as screen
2026-11-20 17:54 ` [PATCH 2/2] fbcon: Don't drop last logo line if logo is same size as screen Helge Deller
@ 2026-11-20 18:38 ` sashiko-bot
0 siblings, 0 replies; 3+ messages in thread
From: sashiko-bot @ 2026-11-20 18:38 UTC (permalink / raw)
To: Helge Deller, dri-devel
Thank you for your contribution! Sashiko AI review found 1 potential
issue to consider:
- [Medium] fbcon: full-screen boot-logo overwritten by update_region()
in fbcon_switch()
--
commit 1d5d014858b9e8c6374a333c00292505b2a11f3a
Author: Helge Deller <deller@gmx.de>
fbcon: Don't drop last logo line if logo is same size as screen
This commit allows logo_lines to reach new_rows in fbcon_prepare_logo() so
a full-screen boot logo is not truncated by one character row, while
keeping vc->vc_top unchanged when logo_lines reaches vc->vc_bottom.
> diff --git a/drivers/video/fbdev/core/fbcon.c b/drivers/video/fbdev/core/fbcon.c
> index 7720dfc80c165..12a27b520260e 100644
> --- a/drivers/video/fbdev/core/fbcon.c
> +++ b/drivers/video/fbdev/core/fbcon.c
> @@ -637,7 +637,7 @@ static void fbcon_prepare_logo(struct vc_data *vc, struct fb_info *info,
> logo_height = fb_prepare_logo(info, par->rotate);
> logo_lines = DIV_ROUND_UP(logo_height, vc->vc_font.height);
> logo_lines = min(logo_lines, rows);
> - logo_lines = min(logo_lines, new_rows - 1);
> + logo_lines = min(logo_lines, new_rows);
> if (logo_lines <= 0) {
> logo_lines = 0;
> logo_shown = FBCON_LOGO_DONTSHOW;
> @@ -705,7 +705,9 @@ static void fbcon_prepare_logo(struct vc_data *vc, struct fb_info *info,
> pr_info("fbcon: disable boot-logo (boot-logo bigger than screen).\n");
> } else {
> logo_shown = FBCON_LOGO_DRAW;
> - vc->vc_top = logo_lines;
> + /* keep vc_top if logo covers whole screen */
> + if (logo_lines < vc->vc_bottom)
> + vc->vc_top = logo_lines;
> }
> }
> #endif /* MODULE */
[Severity: Medium]
When the boot logo covers the whole screen (logo_lines == vc->vc_bottom),
does leaving vc->vc_top at 0 cause fbcon_switch() to immediately erase the
logo?
Earlier in fbcon_prepare_logo(), scr_memsetw() fills logo_lines rows of
vc->vc_origin with erase characters. When fbcon_switch() runs with
logo_shown == FBCON_LOGO_DRAW, it draws the logo and then redraws the text
region starting from vc->vc_top:
drivers/video/fbdev/core/fbcon.c:fbcon_switch() {
...
if (logo_shown == FBCON_LOGO_DRAW) {
logo_shown = fg_console;
fb_show_logo(info, par->rotate);
update_region(vc,
vc->vc_origin + vc->vc_size_row * vc->vc_top,
vc->vc_size_row * (vc->vc_bottom -
vc->vc_top) / 2);
return false;
}
...
}
With vc->vc_top left at 0, update_region() blits those blank erase
characters from vc->vc_origin over all rows 0..vc->vc_bottom - 1 right
after fb_show_logo(), wiping out the full-screen logo.
--
Sashiko AI review · https://sashiko.dev/#/patchset/20261120175413.176249-1-deller@gmx.de?part=2
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2026-11-20 18:39 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-11-20 17:54 [PATCH 1/2] fbdev: radeonfb: reject a zero pixclock in radeonfb_check_var() Helge Deller
2026-11-20 17:54 ` [PATCH 2/2] fbcon: Don't drop last logo line if logo is same size as screen Helge Deller
2026-11-20 18:38 ` sashiko-bot
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.