Reviewed-by: Jacek Lawrynowicz <jacek.lawrynow...@linux.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.bu...@mt.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)
- [PATCH v4 0/6] Fix potential out-of-bounds error in so... Markus Burri
- [PATCH v4 1/6] iio: backend: fix out-of-bound wri... Markus Burri
- Re: [PATCH v4 1/6] iio: backend: fix out-of-b... Jonathan Cameron
- Re: [PATCH v4 1/6] iio: backend: fix out-... Jonathan Cameron
- [PATCH v4 5/6] powerpc/eeh: fix potential OoB Markus Burri
- Re: [PATCH v4 5/6] powerpc/eeh: fix potential... Mahesh J Salgaonkar
- [PATCH v4 2/6] accel/ivpu: Use effective buffer s... Markus Burri
- Re: [PATCH v4 2/6] accel/ivpu: Use effective ... Jacek Lawrynowicz
- Re: [PATCH v4 2/6] accel/ivpu: Use effective ... Jacek Lawrynowicz
- [PATCH v4 4/6] gpio: fix potential out-of-bound w... Markus Burri
- Re: [PATCH v4 4/6] gpio: fix potential out-of... kernel test robot
- Re: [PATCH v4 4/6] gpio: fix potential out-of... Bartosz Golaszewski
- [PATCH v4 6/6] powerpc/eeh-powernv: fix potential... Markus Burri
- Re: [PATCH v4 6/6] powerpc/eeh-powernv: fix p... Mahesh J Salgaonkar
- [PATCH v4 3/6] iio: fix potential out-of-bound wr... Markus Burri
- Re: [PATCH v4 3/6] iio: fix potential out-of-... Jonathan Cameron
- Re: [PATCH v4 3/6] iio: fix potential out-of-... Jonathan Cameron
- Re: [PATCH v4 0/6] Fix potential out-of-bounds er... Bartosz Golaszewski