From: sashiko-bot@kernel.org
To: "Daniel Palmer" <daniel@0x0f.com>
Cc: dri-devel@lists.freedesktop.org
Subject: Re: [PATCH v2 5/5] fbdev: tdfxfb: Program the initial video mode
Date: Fri, 31 Jul 2026 12:28:31 +0000 [thread overview]
Message-ID: <20260731122832.283891F000E9@smtp.kernel.org> (raw)
In-Reply-To: <20260731121915.3362232-6-daniel@0x0f.com>
Thank you for your contribution! Sashiko AI review found 2 potential issue(s) to consider:
New issues:
- [Critical] Unbounded memset_io() leads to out-of-bounds physical memory write
Pre-existing issues:
- [High] Infinite loop in banshee_wait_idle() causes kernel hang on probe
--
--- Patch [5]: [PATCH v2 5/5] fbdev: tdfxfb: Program the initial video mode ---
commit 99f06e3d4bb98c9560cb7c49215cddea173febfd
Author: Daniel Palmer <daniel@0x0f.com>
fbdev: tdfxfb: Program the initial video mode
If the card does not get bound to by fbcon set_par() never happens and the
initial video mode is not setup and the display detects no signal. This
commit programs the video mode and also clears the framebuffer memory so
random garbage isn't displayed.
> diff --git a/drivers/video/fbdev/tdfxfb.c b/drivers/video/fbdev/tdfxfb.c
> index f2b658a47135d..cb1c2e9f37dbc 100644
> --- a/drivers/video/fbdev/tdfxfb.c
> +++ b/drivers/video/fbdev/tdfxfb.c
> @@ -1686,6 +1686,14 @@ static int tdfxfb_probe(struct pci_dev *pdev, const struct pci_device_id *id)
> goto out_err_iobase;
> }
>
> + /*
> + * Program a video mode and clear the framebuffer now, this
> + * ensures the display comes up even if fbcon doesn't bind
> + * when the framebuffer is registered.
> + */
> + tdfxfb_set_par(info);
[Severity: High]
This is a pre-existing issue, but can this lead to an infinite loop and
kernel hang during device probe?
When tdfxfb_set_par() is called, it invokes the code path leading to
banshee_wait_idle(), which contains a tight loop waiting for hardware
register status to clear:
drivers/video/fbdev/tdfxfb.c:banshee_wait_idle() {
...
do {
if ((tdfx_inl(par, STATUS) & STATUS_BUSY) == 0)
i++;
} while (i < 3);
...
}
If a malfunctioning or malicious PCI device returns a constant busy status,
would the driver loop indefinitely here since the loop is unbounded?
> + memset_io(info->screen_base, 0, info->fix.smem_len);
[Severity: Critical]
Could this regression result in an out-of-bounds physical memory write?
The length info->fix.smem_len is derived from untrusted hardware registers
read during do_lfb_size(), rather than the validated PCI BAR length:
drivers/video/fbdev/tdfxfb.c:do_lfb_size() {
...
return num_chips * chip_size * 1024l * 1024;
...
}
If a device exposes large values for these registers, can
info->fix.smem_len exceed the actual size remapped at info->screen_base,
causing memset_io() to overwrite adjacent memory?
> +
> if (register_framebuffer(info) < 0) {
> printk(KERN_ERR "tdfxfb: can't register framebuffer\n");
> fb_dealloc_cmap(&info->cmap);
--
Sashiko AI review · https://sashiko.dev/#/patchset/20260731121915.3362232-1-daniel@0x0f.com?part=5
next prev parent reply other threads:[~2026-07-31 12:28 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-07-31 12:19 [PATCH v2 0/5] fbdev: tdfxfb: Make "unbooted" cards work Daniel Palmer
2026-07-31 12:19 ` [PATCH v2 1/5] fbdev: tdfxfb: Add helper to read config table from BIOS Daniel Palmer
2026-07-31 12:24 ` sashiko-bot
2026-07-31 12:19 ` [PATCH v2 2/5] fbdev: tdfxfb: Attempt to detect if the card wasn't booted Daniel Palmer
2026-07-31 12:19 ` [PATCH v2 3/5] fbdev: tdfxfb: Manually boot unbooted cards Daniel Palmer
2026-07-31 12:19 ` [PATCH v2 4/5] fbdev: tdfxfb: Wake the VGA core before programming the CRTC Daniel Palmer
2026-07-31 12:19 ` [PATCH v2 5/5] fbdev: tdfxfb: Program the initial video mode Daniel Palmer
2026-07-31 12:28 ` sashiko-bot [this message]
2026-07-31 12:38 ` [PATCH v2 0/5] fbdev: tdfxfb: Make "unbooted" cards work 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=20260731122832.283891F000E9@smtp.kernel.org \
--to=sashiko-bot@kernel.org \
--cc=daniel@0x0f.com \
--cc=dri-devel@lists.freedesktop.org \
--cc=sashiko-reviews@lists.linux.dev \
/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.