dri-devel Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: sashiko-bot@kernel.org
To: "Hui Peng" <benquike@gmail.com>
Cc: dri-devel@lists.freedesktop.org
Subject: Re: [PATCH] drm/sitronix: st7571: fix hwbuf heap buffer overflow from unaligned nlines
Date: Sat, 19 Sep 2026 22:48:53 +0000	[thread overview]
Message-ID: <20260919224853.92A7F1F000FF@smtp.kernel.org> (raw)
In-Reply-To: <20260919222631.3798442-1-benquike@gmail.com>

Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [Medium] drm/sitronix: commit message and patch implementation completely mismatched
--

commit 46fb9fd81496f4b52e8d10740054c55dda3862dc
Author: Hui Peng <benquike@gmail.com>

drm/sitronix: st7571: fix hwbuf heap buffer overflow from unaligned nlines

The commit attempts to fix a heap buffer overflow in the sitronix st7571 driver
by ensuring the allocated buffer size is aligned.

> In st7571_fb_blit_rect() (drivers/gpu/drm/sitronix/st7571.c), align y1
> down and y2 up to multiples of 8 rows before computing nlines so the
> byte count written into st7571->hwbuf matches the allocated page-aligned
> buffer capacity and cannot overflow st7571->hwbuf.

[Severity: Medium]
Does the commit message describe the actual changes made in this patch?

The message claims to fix an issue in st7571_fb_blit_rect() by modifying how
coordinates y1 and y2 are aligned. However, the patch does not modify this
function, but instead rounds up an allocation size in st7571_probe().

> diff --git a/drivers/gpu/drm/sitronix/st7571.c b/drivers/gpu/drm/sitronix/st7571.c
> index fc3ba5e8600f6..40017ee5a1f6e 100644
> --- a/drivers/gpu/drm/sitronix/st7571.c
> +++ b/drivers/gpu/drm/sitronix/st7571.c
> @@ -827,7 +827,8 @@ struct st7571_device *st7571_probe(struct device *dev,
>  	st7571->regmap = regmap;
>  
>  	st7571->hwbuf = devm_kzalloc(st7571->dev,
> -				     (st7571->nlines * st7571->ncols * st7571->bpp) / 8,
> +				     (round_up(st7571->nlines, 8) *
> +				      st7571->ncols * st7571->bpp) / 8,
>  				     GFP_KERNEL);

Could the commit message be updated to match the implementation?

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20260919222631.3798442-1-benquike@gmail.com?part=1

      reply	other threads:[~2026-09-19 22:48 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-09-19 22:26 [PATCH] drm/sitronix: st7571: fix hwbuf heap buffer overflow from unaligned nlines Hui Peng
2026-09-19 22:48 ` 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=20260919224853.92A7F1F000FF@smtp.kernel.org \
    --to=sashiko-bot@kernel.org \
    --cc=benquike@gmail.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox