mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Philipp Stanner <pstanner@redhat.com>
To: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: Ian Abbott <abbotti@mev.co.uk>,
	H Hartley Sweeten <hsweeten@visionengravers.com>,
	Ivan Orlov <ivan.orlov0322@gmail.com>,
	Benjamin Tissoires <benjamin.tissoires@redhat.com>,
	linux-kernel@vger.kernel.org, Dave Airlie <airlied@redhat.com>
Subject: Re: [PATCH] drivers/comedi: copy userspace array safely
Date: Fri, 03 Nov 2023 10:11:06 +0100	[thread overview]
Message-ID: <07a220351baa1e6851b90c961aade0ce6d26bcf6.camel@redhat.com> (raw)
In-Reply-To: <2023110348-drained-tameness-b943@gregkh>

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
> 


  reply	other threads:[~2023-11-03  9:12 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-11-02 19:08 Philipp Stanner
2023-11-03  5:53 ` Greg Kroah-Hartman
2023-11-03  9:11   ` Philipp Stanner [this message]
2023-11-03 10:25     ` Ian Abbott

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=07a220351baa1e6851b90c961aade0ce6d26bcf6.camel@redhat.com \
    --to=pstanner@redhat.com \
    --cc=abbotti@mev.co.uk \
    --cc=airlied@redhat.com \
    --cc=benjamin.tissoires@redhat.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=hsweeten@visionengravers.com \
    --cc=ivan.orlov0322@gmail.com \
    --cc=linux-kernel@vger.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

all inboxes | Powered by JetHome®