Thread (95 messages) 95 messages, 16 authors, 2021-01-15

Re: [PATCH 0/2] page_count can't be used to decide when wp_page_copy

From: Andy Lutomirski <luto@kernel.org>
Date: 2021-01-08 18:32:36
Also in: lkml

On Fri, Jan 8, 2021 at 10:19 AM Jason Gunthorpe [off-list ref] wrote:
On Fri, Jan 08, 2021 at 12:00:36PM -0500, Andrea Arcangeli wrote:
quoted
quoted
The majority cannot be converted to notifiers because they are DMA
based. Every one of those is an ABI for something, and does not expect
extra privilege to function. It would be a major breaking change to
have pin_user_pages require some cap.
... what makes them safe is to be transient GUP pin and not long
term.

Please note the "long term" in the underlined line.
Many of them are long term, though only 50 or so have been marked
specifically with FOLL_LONGTERM. I don't see how we can make such a
major ABI break.

Looking at it, vmsplice() is simply wrong. A long term page pin must
use pin_user_pages(), and either FOLL_LONGTERM|FOLL_WRITE (write mode)
FOLL_LONGTERM|FOLL_FORCE|FOLL_WRITE (read mode)
Can we just remove vmsplice() support?  We could make it do a normal
copy, thereby getting rid of a fair amount of nastiness and potential
attacks.  Even ignoring issues relating to the length of time that the
vmsplice reference is alive, we also have whatever problems could be
caused by a malicious or misguided user vmsplice()ing some memory and
then modifying it.

--Andy
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help