[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <07a220351baa1e6851b90c961aade0ce6d26bcf6.camel@redhat.com>
Date: Fri, 03 Nov 2023 10:11:06 +0100
From: Philipp Stanner <pstanner@...hat.com>
To: Greg Kroah-Hartman <gregkh@...uxfoundation.org>
Cc: Ian Abbott <abbotti@....co.uk>,
H Hartley Sweeten <hsweeten@...ionengravers.com>,
Ivan Orlov <ivan.orlov0322@...il.com>,
Benjamin Tissoires <benjamin.tissoires@...hat.com>,
linux-kernel@...r.kernel.org, Dave Airlie <airlied@...hat.com>
Subject: Re: [PATCH] drivers/comedi: copy userspace array safely
On Fri, 2023-11-03 at 06:53 +0100, Greg Kroah-Hartman wrote:
> On Thu, Nov 02, 2023 at 08:08:49PM +0100, Philipp Stanner wrote:
> > comedi_fops.c utilizes memdup_user() to copy a userspace array. This
> > does not check for an overflow.
>
> Is there potential for an overflow today?
None that I'm aware of, no. This is more about establishing the new
function as the standard for array-copying, thereby improving
readability and maybe robustness in case of future changes.
>
> >
> > Use the new wrapper memdup_array_user() to copy the array more safely.
>
> How about saying something like:
> "Use the new function memdup_array_user() in case things change
> in the future which would prevent overflows if something were to
> change in the size of the structures".
>
> Or something to the affect of "all is good today, but make it easy to be
> correct in the future as well".
Yes, good idea. I'll send a better wording
P.
>
> thanks,
>
> greg k-h
>
Powered by blists - more mailing lists