[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <aQB8j7Hc3b9vAT5_@smile.fi.intel.com>
Date: Tue, 28 Oct 2025 10:19:27 +0200
From: Andy Shevchenko <andriy.shevchenko@...el.com>
To: Miaoqian Lin <linmq006@...il.com>
Cc: Lars-Peter Clausen <lars@...afoo.de>,
Michael Hennerich <Michael.Hennerich@...log.com>,
Jonathan Cameron <jic23@...nel.org>,
David Lechner <dlechner@...libre.com>,
Nuno Sá <nuno.sa@...log.com>,
Andy Shevchenko <andy@...nel.org>,
Angelo Dureghello <adureghello@...libre.com>,
linux-iio@...r.kernel.org, linux-kernel@...r.kernel.org,
stable@...r.kernel.org
Subject: Re: [PATCH] iio: dac: ad3552r-hs: fix out-of-bound write in
ad3552r_hs_write_data_source
On Tue, Oct 28, 2025 at 10:18:05AM +0200, Andy Shevchenko wrote:
> On Mon, Oct 27, 2025 at 11:07:13PM +0800, Miaoqian Lin wrote:
...
> > + if (count >= sizeof(buf))
> > + return -ENOSPC;
>
> But this makes the validation too strict now.
>
> > ret = simple_write_to_buffer(buf, sizeof(buf) - 1, ppos, userbuf,
> > count);
>
> You definitely failed to read the code that implements the above.
>
> > if (ret < 0)
> > return ret;
> > - buf[count] = '\0';
> > + buf[ret] = '\0';
Maybe this line is what we might need, but I haven't checked deeper if it's a
problem.
> NAK.
>
> This patch is an unneeded churn.
--
With Best Regards,
Andy Shevchenko
Powered by blists - more mailing lists