[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <60cf19a2-4f55-4330-991d-5ec76ab5a5f3@linux.intel.com>
Date: Mon, 12 May 2025 12:32:01 +0200
From: Jacek Lawrynowicz <jacek.lawrynowicz@...ux.intel.com>
To: Markus Burri <markus.burri@...com>, linux-kernel@...r.kernel.org
Cc: Mahesh J Salgaonkar <mahesh@...ux.ibm.com>,
Oliver O'Halloran <oohall@...il.com>,
Madhavan Srinivasan <maddy@...ux.ibm.com>,
Michael Ellerman <mpe@...erman.id.au>, Nicholas Piggin <npiggin@...il.com>,
Christophe Leroy <christophe.leroy@...roup.eu>,
Naveen N Rao <naveen@...nel.org>,
Maciej Falkowski <maciej.falkowski@...ux.intel.com>,
Oded Gabbay <ogabbay@...nel.org>, Linus Walleij <linus.walleij@...aro.org>,
Bartosz Golaszewski <brgl@...ev.pl>, Nuno Sa <nuno.sa@...log.com>,
Olivier Moysan <olivier.moysan@...s.st.com>,
Jonathan Cameron <jic23@...nel.org>, Lars-Peter Clausen <lars@...afoo.de>,
linuxppc-dev@...ts.ozlabs.org, dri-devel@...ts.freedesktop.org,
linux-gpio@...r.kernel.org, linux-iio@...r.kernel.org,
Markus Burri <markus.burri@....ch>
Subject: Re: [PATCH v4 2/6] accel/ivpu: Use effective buffer size for zero
terminator
Reviewed-by: Jacek Lawrynowicz <jacek.lawrynowicz@...ux.intel.com>
On 5/8/2025 3:06 PM, Markus Burri wrote:
> Use the effective written size instead of original size as index for zero
> termination. If the input from user-space is to larger and the input is
> truncated, the original size is out-of-bound.
> Since there is an upfront size check here, the change is for consistency.
>
> Signed-off-by: Markus Burri <markus.burri@...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 f0dad0c9ce33..cd24ccd20ba6 100644
> --- a/drivers/accel/ivpu/ivpu_debugfs.c
> +++ b/drivers/accel/ivpu/ivpu_debugfs.c
> @@ -455,7 +455,7 @@ priority_bands_fops_write(struct file *file, const char __user *user_buf, size_t
> if (ret < 0)
> return ret;
>
> - buf[size] = '\0';
> + buf[ret] = '\0';
> ret = sscanf(buf, "%u %u %u %u", &band, &grace_period, &process_grace_period,
> &process_quantum);
> if (ret != 4)
Powered by blists - more mailing lists