All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jason Gunthorpe <jgg@nvidia.com>
To: Steven Sistare <steven.sistare@oracle.com>
Cc: kvm@vger.kernel.org, Alex Williamson <alex.williamson@redhat.com>,
	Cornelia Huck <cohuck@redhat.com>
Subject: Re: [PATCH V4 2/5] vfio/type1: prevent locked_vm underflow
Date: Thu, 15 Dec 2022 11:03:54 -0400	[thread overview]
Message-ID: <Y5s3Wkb5JoPCO1Fs@nvidia.com> (raw)
In-Reply-To: <4736f410-e925-3eb7-7c33-bcf4ad9b55a0@oracle.com>

On Thu, Dec 15, 2022 at 09:38:42AM -0500, Steven Sistare wrote:

> > I'm not sure this is quite, right, or at least the comment isn't quite
> > right..
> > 
> > The issue is that the vfio_dma does not store the mm that provided the
> > pages. By going through the task every time it allows the mm to change
> > under its feet which of course can corrupt the assumed accounting in
> > various ways.
> > 
> > To fix this, the mm should be kept, as you did above. All the code
> > that is touching the task to get the mm should be dropped. The only
> > purpose of the task is to check the rlimit.
> 
> Yes.  While developing my "redo" series I tried it that way, but did not post
> that version.  Functionally it should be equivalent to this series, but I can
> code it again to see if it looks cleaner.

The big reason to split is that this existing bug pre-dates the vaddr
work and should probably be backported further. It can be triggered
just by doing exec..

Jason

  reply	other threads:[~2022-12-15 15:04 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-12-14 21:24 [PATCH V4 0/5] fixes for virtual address update Steve Sistare
2022-12-14 21:24 ` [PATCH V4 1/5] vfio/type1: exclude mdevs from VFIO_UPDATE_VADDR Steve Sistare
2022-12-15  4:34   ` Tian, Kevin
2022-12-15 14:32     ` Steven Sistare
2022-12-14 21:24 ` [PATCH V4 2/5] vfio/type1: prevent locked_vm underflow Steve Sistare
2022-12-15  4:52   ` Tian, Kevin
2022-12-15 14:33     ` Steven Sistare
2022-12-15 14:20   ` Jason Gunthorpe
2022-12-15 14:38     ` Steven Sistare
2022-12-15 15:03       ` Jason Gunthorpe [this message]
2022-12-14 21:24 ` [PATCH V4 3/5] vfio/type1: revert "block on invalid vaddr" Steve Sistare
2022-12-14 21:24 ` [PATCH V4 4/5] vfio/type1: revert "implement notify callback" Steve Sistare
2022-12-14 21:24 ` [PATCH V4 5/5] vfio: revert "iommu driver " Steve Sistare
2022-12-14 21:42 ` [PATCH V4 0/5] fixes for virtual address update Alex Williamson
2022-12-15 14:25   ` Jason Gunthorpe
2022-12-15 18:37     ` Alex Williamson
  -- strict thread matches above, loose matches on Subject: below --
2022-12-15 21:53 Steve Sistare
2022-12-15 21:53 ` [PATCH V4 2/5] vfio/type1: prevent locked_vm underflow Steve Sistare

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=Y5s3Wkb5JoPCO1Fs@nvidia.com \
    --to=jgg@nvidia.com \
    --cc=alex.williamson@redhat.com \
    --cc=cohuck@redhat.com \
    --cc=kvm@vger.kernel.org \
    --cc=steven.sistare@oracle.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.