linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Jason Gunthorpe <jgg@nvidia.com>
To: Christoph Hellwig <hch@infradead.org>
Cc: Lorenzo Stoakes <lstoakes@gmail.com>,
	linux-mm@kvack.org, linux-kernel@vger.kernel.org,
	Andrew Morton <akpm@linux-foundation.org>,
	Jens Axboe <axboe@kernel.dk>,
	Matthew Wilcox <willy@infradead.org>,
	Dennis Dalessandro <dennis.dalessandro@cornelisnetworks.com>,
	Leon Romanovsky <leon@kernel.org>,
	Christian Benvenuti <benve@cisco.com>,
	Nelson Escobar <neescoba@cisco.com>,
	Bernard Metzler <bmt@zurich.ibm.com>,
	Peter Zijlstra <peterz@infradead.org>,
	Ingo Molnar <mingo@redhat.com>,
	Arnaldo Carvalho de Melo <acme@kernel.org>,
	Mark Rutland <mark.rutland@arm.com>,
	Alexander Shishkin <alexander.shishkin@linux.intel.com>,
	Jiri Olsa <jolsa@kernel.org>, Namhyung Kim <namhyung@kernel.org>,
	Ian Rogers <irogers@google.com>,
	Adrian Hunter <adrian.hunter@intel.com>,
	Bjorn Topel <bjorn@kernel.org>,
	Magnus Karlsson <magnus.karlsson@intel.com>,
	Maciej Fijalkowski <maciej.fijalkowski@intel.com>,
	Jonathan Lemon <jonathan.lemon@gmail.com>,
	"David S . Miller" <davem@davemloft.net>,
	Eric Dumazet <edumazet@google.com>,
	Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>,
	Christian Brauner <brauner@kernel.org>,
	Richard Cochran <richardcochran@gmail.com>,
	Alexei Starovoitov <ast@kernel.org>,
	Daniel Borkmann <daniel@iogearbox.net>,
	Jesper Dangaard Brouer <hawk@kernel.org>,
	John Fastabend <john.fastabend@gmail.com>,
	linux-fsdevel@vger.kernel.org, linux-perf-users@vger.kernel.org,
	netdev@vger.kernel.org, bpf@vger.kernel.org,
	Oleg Nesterov <oleg@redhat.com>, Jan Kara <jack@suse.cz>,
	Chris Mason <clm@fb.com>, John Hubbard <jhubbard@nvidia.com>
Subject: Re: [PATCH v2] mm/gup: disallow GUP writing to file-backed mappings by default
Date: Mon, 24 Apr 2023 10:26:57 -0300	[thread overview]
Message-ID: <ZEaDoZOeUOAwcWER@nvidia.com> (raw)
In-Reply-To: <ZEZ4VCyfRNCZOO8/@infradead.org>

On Mon, Apr 24, 2023 at 05:38:44AM -0700, Christoph Hellwig wrote:

> > I wonder if that is really the case? I know people tried this with
> > RDMA and it didn't get very far before testing uncovered data
> > corruption and kernel crashes.. Maybe O_DIRECT has a much smaller race
> > window so people can get away with it?
> 
> It absolutely causes all kinds of issues even with O_DIRECT.  I'd be
> all for trying to disallow it as it simplies a lot of things, but I fear
> it's not going to stick.

I suggest the kernel lockdown mode again. If people want to do unsafe
things they can boot in a lessor lockdown mode, we've disabled several
kernel features this way already. lockdown integrity sounds
appropriate for this kind of bug.

Maybe we can start to get some data on who is actually using it.

> > Alternatively, perhaps we abuse FOLL_LONGTERM and prevent it from
> > working with filebacked pages since, I think, the ease of triggering a
> > bug goes up the longer the pages are pinned.
> 
> FOLL_LONGTERM on file backed pages is a nightmare.  If you think you
> can get away with prohibiting it for RDMA, and KVM doesn't need it
> I'd be all for not allowing that at all.

Yes, I think we can and should do this.

Jason


  reply	other threads:[~2023-04-24 13:27 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-04-24  7:43 Lorenzo Stoakes
2023-04-24  9:43 ` Christoph Hellwig
2023-04-24 10:17   ` Lorenzo Stoakes
2023-04-24 12:28     ` Jason Gunthorpe
2023-04-24 12:38       ` Christoph Hellwig
2023-04-24 13:26         ` Jason Gunthorpe [this message]
2023-04-24 12:38       ` Lorenzo Stoakes
2023-04-24 13:39         ` Jason Gunthorpe
2023-04-24 14:29           ` Lorenzo Stoakes
2023-04-24 17:36             ` Jason Gunthorpe
2023-04-24 18:22               ` Lorenzo Stoakes
2023-04-24 18:54                 ` Jason Gunthorpe
2023-04-24 19:18                   ` Lorenzo Stoakes
2023-04-24 22:53                     ` Jason Gunthorpe
2023-04-24 23:03                       ` Lorenzo Stoakes
2023-04-24 23:17                         ` Jason Gunthorpe
2023-04-24 23:26                           ` Lorenzo Stoakes
2023-04-24 23:30                             ` 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=ZEaDoZOeUOAwcWER@nvidia.com \
    --to=jgg@nvidia.com \
    --cc=acme@kernel.org \
    --cc=adrian.hunter@intel.com \
    --cc=akpm@linux-foundation.org \
    --cc=alexander.shishkin@linux.intel.com \
    --cc=ast@kernel.org \
    --cc=axboe@kernel.dk \
    --cc=benve@cisco.com \
    --cc=bjorn@kernel.org \
    --cc=bmt@zurich.ibm.com \
    --cc=bpf@vger.kernel.org \
    --cc=brauner@kernel.org \
    --cc=clm@fb.com \
    --cc=daniel@iogearbox.net \
    --cc=davem@davemloft.net \
    --cc=dennis.dalessandro@cornelisnetworks.com \
    --cc=edumazet@google.com \
    --cc=hawk@kernel.org \
    --cc=hch@infradead.org \
    --cc=irogers@google.com \
    --cc=jack@suse.cz \
    --cc=jhubbard@nvidia.com \
    --cc=john.fastabend@gmail.com \
    --cc=jolsa@kernel.org \
    --cc=jonathan.lemon@gmail.com \
    --cc=kuba@kernel.org \
    --cc=leon@kernel.org \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=linux-perf-users@vger.kernel.org \
    --cc=lstoakes@gmail.com \
    --cc=maciej.fijalkowski@intel.com \
    --cc=magnus.karlsson@intel.com \
    --cc=mark.rutland@arm.com \
    --cc=mingo@redhat.com \
    --cc=namhyung@kernel.org \
    --cc=neescoba@cisco.com \
    --cc=netdev@vger.kernel.org \
    --cc=oleg@redhat.com \
    --cc=pabeni@redhat.com \
    --cc=peterz@infradead.org \
    --cc=richardcochran@gmail.com \
    --cc=willy@infradead.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