From: sashiko-bot@kernel.org
To: "Pan Chuang" <panchuang@vivo.com>
Cc: dri-devel@lists.freedesktop.org
Subject: Re: [PATCH 7/7] fbdev: sa1100fb: Remove redundant dev_err()
Date: Wed, 22 Jul 2026 08:15:53 +0000 [thread overview]
Message-ID: <20260722081554.2AD751F000E9@smtp.kernel.org> (raw)
In-Reply-To: <20260722075803.570532-8-panchuang@vivo.com>
Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
Pre-existing issues:
- [High] Missing `.suppress_bind_attrs = true` leads to catastrophic use-after-free on sysfs unbind.
--
--- Patch [7]: [PATCH 7/7] fbdev: sa1100fb: Remove redundant dev_err() ---
commit 811a165c0a2521029ab935181ae6d9d247a19898
Author: Pan Chuang <panchuang@vivo.com>
fbdev: sa1100fb: Remove redundant dev_err()
This commit simplifies the probe function by removing a redundant error
message after devm_request_irq(). The devm variant already logs detailed
error messages internally on failure.
> diff --git a/drivers/video/fbdev/sa1100fb.c b/drivers/video/fbdev/sa1100fb.c
> index 0d362d2bf0e38..fea0172c45b5b 100644
> --- a/drivers/video/fbdev/sa1100fb.c
> +++ b/drivers/video/fbdev/sa1100fb.c
> @@ -1167,10 +1167,8 @@ static int sa1100fb_probe(struct platform_device *pdev)
>
> ret = devm_request_irq(&pdev->dev, irq, sa1100fb_handle_irq, 0,
> "LCD", fbi);
> - if (ret) {
> - dev_err(&pdev->dev, "request_irq failed: %d\n", ret);
> + if (ret)
> return ret;
> - }
[Severity: High]
This isn't a bug introduced by this patch, but since we are modifying
sa1100fb_probe(), should we also address a potential use-after-free during
driver unbind?
Looking at the driver definition, it registers resources that require explicit
unregistration, but does not provide a remove callback and does not suppress
sysfs unbind:
drivers/video/fbdev/sa1100fb.c:sa1100fb_driver {
.probe = sa1100fb_probe,
.suspend = sa1100fb_suspend,
.resume = sa1100fb_resume,
.driver = {
.name = "sa11x0-fb",
},
};
If a user unbinds the driver via sysfs, the driver core will call
devres_release_all() and free the devm allocated fbi structure.
However, because register_framebuffer() and cpufreq_register_notifier()
are called during probe without ever being unregistered, the fbdev and cpufreq
subsystems will hold dangling pointers to the freed fbi structure.
Any subsequent access to the framebuffer or CPU frequency transitions
could dereference this freed memory.
Would it make sense to set suppress_bind_attrs = true in the driver struct
to prevent sysfs unbind from succeeding, or alternatively implement a proper
remove callback to unregister these resources?
--
Sashiko AI review · https://sashiko.dev/#/patchset/20260722075803.570532-1-panchuang@vivo.com?part=7
prev parent reply other threads:[~2026-07-22 8:15 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-07-22 7:57 [PATCH 0/7] video: fbdev: Remove redundant dev_err() Pan Chuang
2026-07-22 7:57 ` [PATCH 1/7] fbdev: mmp: " Pan Chuang
2026-07-22 8:07 ` sashiko-bot
2026-07-22 7:57 ` [PATCH 2/7] fbdev: omapfb/dsi-cm: " Pan Chuang
2026-07-22 8:08 ` sashiko-bot
2026-07-22 7:57 ` [PATCH 3/7] fbdev: pxa168fb: " Pan Chuang
2026-07-22 8:06 ` sashiko-bot
2026-07-22 7:57 ` [PATCH 4/7] fbdev: pxa3xx-gcu: " Pan Chuang
2026-07-22 8:07 ` sashiko-bot
2026-07-22 7:57 ` [PATCH 5/7] fbdev: pxafb: " Pan Chuang
2026-07-22 8:14 ` sashiko-bot
2026-07-22 7:57 ` [PATCH 6/7] fbdev: s3c-fb: " Pan Chuang
2026-07-22 8:20 ` sashiko-bot
2026-07-22 7:57 ` [PATCH 7/7] fbdev: sa1100fb: " Pan Chuang
2026-07-22 8:15 ` sashiko-bot [this message]
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=20260722081554.2AD751F000E9@smtp.kernel.org \
--to=sashiko-bot@kernel.org \
--cc=dri-devel@lists.freedesktop.org \
--cc=panchuang@vivo.com \
--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.