linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Jason Gunthorpe <jgg@nvidia.com>
To: David Hildenbrand <david@redhat.com>
Cc: Andrew Morton <akpm@linux-foundation.org>,
	John Hubbard <jhubbard@nvidia.com>,
	linux-mm@kvack.org, Lorenzo Stoakes <lstoakes@gmail.com>,
	syzbot+353c7be4964c6253f24a@syzkaller.appspotmail.com
Subject: Re: [PATCH] mm/gup: Do not return 0 from pin_user_pages_fast() for bad args
Date: Wed, 21 Jun 2023 08:38:37 -0300	[thread overview]
Message-ID: <ZJLhPYtes5MLTyXj@nvidia.com> (raw)
In-Reply-To: <d86c82d7-2e45-6de8-dcfa-c1dcac06c49a@redhat.com>

On Wed, Jun 21, 2023 at 01:24:14PM +0200, David Hildenbrand wrote:
> > diff --git a/mm/gup.c b/mm/gup.c
> > index bbe4162365933e..36c587fec574fd 100644
> > --- a/mm/gup.c
> > +++ b/mm/gup.c
> > @@ -2969,7 +2969,7 @@ static int internal_get_user_pages_fast(unsigned long start,
> >   	start = untagged_addr(start) & PAGE_MASK;
> >   	len = nr_pages << PAGE_SHIFT;
> >   	if (check_add_overflow(start, len, &end))
> > -		return 0;
> > +		return -EOVERFLOW;
> 
> I'm curious if there is any sane use case where that could actually trigger.
> Smells like something that should be a WARN_ON_ONCE(), but maybe some
> callers simply pass through what user-space gave them.

Yes, that is pretty common to just pass through.

Thanks,
Jason


      reply	other threads:[~2023-06-21 11:38 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-06-19 18:27 Jason Gunthorpe
2023-06-20  1:38 ` John Hubbard
2023-06-20 21:20 ` Lorenzo Stoakes
2023-06-21 11:24 ` David Hildenbrand
2023-06-21 11:38   ` Jason Gunthorpe [this message]

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=ZJLhPYtes5MLTyXj@nvidia.com \
    --to=jgg@nvidia.com \
    --cc=akpm@linux-foundation.org \
    --cc=david@redhat.com \
    --cc=jhubbard@nvidia.com \
    --cc=linux-mm@kvack.org \
    --cc=lstoakes@gmail.com \
    --cc=syzbot+353c7be4964c6253f24a@syzkaller.appspotmail.com \
    /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