Linux RDMA and InfiniBand development
 help / color / mirror / Atom feed
From: "Saleem, Shiraz" <shiraz.saleem@intel.com>
To: Jason Gunthorpe <jgg@nvidia.com>
Cc: "dledford@redhat.com" <dledford@redhat.com>,
	"linux-rdma@vger.kernel.org" <linux-rdma@vger.kernel.org>,
	"stable@kernel.org" <stable@kernel.org>,
	Di Zhu <zhudi21@huawei.com>
Subject: RE: [PATCH v1 1/2] RDMA/i40iw: Address an mmap handler exploit in i40iw
Date: Wed, 25 Nov 2020 01:04:43 +0000	[thread overview]
Message-ID: <a935ec3699744af6a282e1897ef52565@intel.com> (raw)
In-Reply-To: <20201125000726.GG4800@nvidia.com>

> Subject: Re: [PATCH v1 1/2] RDMA/i40iw: Address an mmap handler exploit in
> i40iw
> 
> On Tue, Nov 24, 2020 at 05:51:02PM -0600, Shiraz Saleem wrote:
> > i40iw_mmap manipulates the vma->vm_pgoff to differentiate a push page
> > mmap vs a doorbell mmap, and uses it to compute the pfn in
> > remap_pfn_range without any validation. This is vulnerable to an mmap
> > exploit as described in [1].
> >
> > Push feature is disabled in the driver currently and therefore no push
> > mmaps are issued from user-space. The feature does not work as
> > expected in the x722 product.
> >
> > Remove the push module parameter and all VMA attribute manipulations
> > for this feature in i40iw_mmap. Update i40iw_mmap to only allow DB
> > user mmapings at offset = 0. Check vm_pgoff for zero and if the mmaps
> > are bound to a single page.
> >
> > [1]
> > https://lore.kernel.org/linux-rdma/20201119093523.7588-1-zhudi21@huawe
> > i.com/raw
> >
> > Fixes: d37498417947 ("i40iw: add files for iwarp interface")
> > Cc: stable@kernel.org
> > Reported-by: Di Zhu <zhudi21@huawei.com>
> > Signed-off-by: Shiraz Saleem <shiraz.saleem@intel.com>
> >  drivers/infiniband/hw/i40iw/i40iw_main.c  |    4 ---
> >  drivers/infiniband/hw/i40iw/i40iw_verbs.c |   37 +++++-----------------------
> >  2 files changed, 7 insertions(+), 34 deletions(-)
> 
> Please compile your patches:
> 
> drivers/infiniband/hw/i40iw/i40iw_main.c: In function ‘i40iw_setup_init_state’:
> drivers/infiniband/hw/i40iw/i40iw_main.c:1579:21: error: ‘push_mode’ undeclared
> (first use in this function); did you mean ‘user_mode’?
>  1579 |  iwdev->push_mode = push_mode;
>       |                     ^~~~~~~~~
>       |                     user_mode
> drivers/infiniband/hw/i40iw/i40iw_main.c:1579:21: note: each undeclared identifier is
> reported only once for each function it appears in
> 

Sorry! Goofed up. Had only compiled the series. Sent v2.

  reply	other threads:[~2020-11-25  1:04 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-11-24 23:51 [PATCH v1 0/2] Fix an mmap exploit and remove push in i40iw Shiraz Saleem
2020-11-24 23:51 ` [PATCH v1 1/2] RDMA/i40iw: Address an mmap handler exploit " Shiraz Saleem
2020-11-25  0:07   ` Jason Gunthorpe
2020-11-25  1:04     ` Saleem, Shiraz [this message]
2020-11-24 23:51 ` [PATCH v1 2/2] RDMA/i40iw: Remove push code from i40iw Shiraz Saleem

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=a935ec3699744af6a282e1897ef52565@intel.com \
    --to=shiraz.saleem@intel.com \
    --cc=dledford@redhat.com \
    --cc=jgg@nvidia.com \
    --cc=linux-rdma@vger.kernel.org \
    --cc=stable@kernel.org \
    --cc=zhudi21@huawei.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