linux-rdma.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jason Gunthorpe <jgg@nvidia.com>
To: Bernard Metzler <BMT@zurich.ibm.com>
Cc: "linux-rdma@vger.kernel.org" <linux-rdma@vger.kernel.org>,
	"leonro@nvidia.com" <leonro@nvidia.com>,
	"David.Laight@aculab.com" <David.Laight@aculab.com>
Subject: Re: [PATCH] RDMA/siw: Fix missing permission check in user buffer registration
Date: Fri, 16 Dec 2022 16:12:55 -0400	[thread overview]
Message-ID: <Y5zRR4KbAFOFIvpU@nvidia.com> (raw)
In-Reply-To: <SA0PR15MB3919045403A59EF36370173599E69@SA0PR15MB3919.namprd15.prod.outlook.com>

On Fri, Dec 16, 2022 at 08:11:32PM +0000, Bernard Metzler wrote:
> 
> 
> > -----Original Message-----
> > From: Jason Gunthorpe <jgg@nvidia.com>
> > Sent: Friday, 16 December 2022 19:35
> > To: Bernard Metzler <BMT@zurich.ibm.com>
> > Cc: linux-rdma@vger.kernel.org; leonro@nvidia.com; David.Laight@aculab.com
> > Subject: [EXTERNAL] Re: [PATCH] RDMA/siw: Fix missing permission check in
> > user buffer registration
> > 
> > On Fri, Dec 16, 2022 at 07:32:09PM +0100, Bernard Metzler wrote:
> > > User communication buffer registration lacks check of access
> > > rights for provided address range. Using pin_user_pages_fast()
> > > instead of pin_user_pages() during user page pinning implicitely
> > > introduces the necessary check. It furthermore tries to avoid
> > > grabbing the mmap_read_lock.
> > 
> > Huh? What access check?
> > 
> 
>         if (unlikely(!access_ok((void __user *)start, len)))
>                 return -EFAULT;
> 
> siw needs to call access_ok() during user buffer registration.

No, it doesn't

Either pin_user_pages or pin_user_pages_fast() are equivalent.

You do have a bad bug here if this isn't holding the mmap lock though

Jason

  reply	other threads:[~2022-12-16 20:13 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-12-16 18:32 [PATCH] RDMA/siw: Fix missing permission check in user buffer registration Bernard Metzler
2022-12-16 18:34 ` Jason Gunthorpe
2022-12-16 20:11   ` Bernard Metzler
2022-12-16 20:12     ` Jason Gunthorpe [this message]
2022-12-20 13:52       ` Bernard Metzler
2023-01-03 13:07         ` Jason Gunthorpe
2023-01-03 14:11           ` Bernard Metzler
2023-01-03 14:15             ` Jason Gunthorpe
2023-01-03 16:19               ` Bernard Metzler

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=Y5zRR4KbAFOFIvpU@nvidia.com \
    --to=jgg@nvidia.com \
    --cc=BMT@zurich.ibm.com \
    --cc=David.Laight@aculab.com \
    --cc=leonro@nvidia.com \
    --cc=linux-rdma@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;
as well as URLs for NNTP newsgroup(s).