From: "Wachowski, Karol" <karol.wachowski@linux.intel.com>
To: Dan Carpenter <error27@gmail.com>,
Karol Wachowski <karol.wachowski@intel.com>
Cc: Andrzej Kacprowski <andrzej.kacprowski@linux.intel.com>,
Oded Gabbay <ogabbay@kernel.org>,
Jacek Lawrynowicz <jacek.lawrynowicz@linux.intel.com>,
dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org,
kernel-janitors@vger.kernel.org
Subject: Re: [PATCH] accel/ivpu: prevent uninitialized data bug in debugfs
Date: Mon, 25 May 2026 09:25:38 +0200 [thread overview]
Message-ID: <9a6b239c-d970-4ec3-abf0-6b900b786279@linux.intel.com> (raw)
In-Reply-To: <ahP24m6Mii9EDL7Q@stanley.mountain>
On 25-May-26 9:14, Dan Carpenter wrote:
> The simple_write_to_buffer() will only initialize data starting from
> the *pos offset so if it's non-zero then the first part of the buffer
> uninitialized. Really, if *pos is non-zero then this code won't work
> so just check for that at the start of the function.
>
> Fixes: 320323d2e545 ("accel/ivpu: Add debugfs interface for setting HWS priority bands")
> Signed-off-by: Dan Carpenter <error27@gmail.com>
> ---
> drivers/accel/ivpu/ivpu_debugfs.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/accel/ivpu/ivpu_debugfs.c b/drivers/accel/ivpu/ivpu_debugfs.c
> index 189dbe94cf14..dc20bc73c6ed 100644
> --- a/drivers/accel/ivpu/ivpu_debugfs.c
> +++ b/drivers/accel/ivpu/ivpu_debugfs.c
> @@ -450,7 +450,7 @@ priority_bands_fops_write(struct file *file, const char __user *user_buf, size_t
> u32 band;
> int ret;
>
> - if (size >= sizeof(buf))
> + if (*pos != 0 || size >= sizeof(buf))
> return -EINVAL;
>
> ret = simple_write_to_buffer(buf, sizeof(buf) - 1, pos, user_buf, size);
Thanks for submission.
Reviewed-by: Karol Wachowski <karol.wachowski@linux.intel.com>
next prev parent reply other threads:[~2026-05-25 7:25 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-05-25 7:14 [PATCH] accel/ivpu: prevent uninitialized data bug in debugfs Dan Carpenter
2026-05-25 7:25 ` Wachowski, Karol [this message]
2026-05-25 21:38 ` Claude review: " Claude Code Review Bot
2026-05-25 21:38 ` Claude Code Review Bot
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=9a6b239c-d970-4ec3-abf0-6b900b786279@linux.intel.com \
--to=karol.wachowski@linux.intel.com \
--cc=andrzej.kacprowski@linux.intel.com \
--cc=dri-devel@lists.freedesktop.org \
--cc=error27@gmail.com \
--cc=jacek.lawrynowicz@linux.intel.com \
--cc=karol.wachowski@intel.com \
--cc=kernel-janitors@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=ogabbay@kernel.org \
/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