From: Jason Gunthorpe <jgg@nvidia.com>
To: Shiraz Saleem <shiraz.saleem@intel.com>
Cc: <dledford@redhat.com>, <linux-rdma@vger.kernel.org>,
<stable@kernel.org>, Di Zhu <zhudi21@huawei.com>
Subject: Re: [PATCH v2 1/2] RDMA/i40iw: Address an mmap handler exploit in i40iw
Date: Wed, 25 Nov 2020 10:47:55 -0400 [thread overview]
Message-ID: <20201125144755.GA298008@nvidia.com> (raw)
In-Reply-To: <20201125005616.1800-2-shiraz.saleem@intel.com>
On Tue, Nov 24, 2020 at 06:56:16PM -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@huawei.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 | 5 ----
> drivers/infiniband/hw/i40iw/i40iw_verbs.c | 37 +++++-----------------------
> 2 files changed, 7 insertions(+), 35 deletions(-)
Applied to for-rc, thanks
Jason
next prev parent reply other threads:[~2020-11-25 14:48 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-11-25 0:56 [PATCH v2 0/2] Fix an mmap exploit and remove push in i40iw Shiraz Saleem
2020-11-25 0:56 ` [PATCH v2 1/2] RDMA/i40iw: Address an mmap handler exploit " Shiraz Saleem
2020-11-25 14:47 ` Jason Gunthorpe [this message]
2020-11-25 0:56 ` [PATCH v2 2/2] RDMA/i40iw: Remove push code from i40iw Shiraz Saleem
2020-12-02 0:50 ` Jason Gunthorpe
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=20201125144755.GA298008@nvidia.com \
--to=jgg@nvidia.com \
--cc=dledford@redhat.com \
--cc=linux-rdma@vger.kernel.org \
--cc=shiraz.saleem@intel.com \
--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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.