lkml.org 
[lkml]   [2023]   [Jan]   [26]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH v11 2/8] iov_iter: Add a function to extract a page list from an iterator
On Thu, Jan 26, 2023 at 11:56:50PM +0000, David Howells wrote:
> Al says that pinning a page (ie. FOLL_PIN) could cause a deadlock if a page is
> vmspliced into a pipe with the pipe holding a pin on it because pinned pages
> are removed from all page tables. Is this actually the case? I can't see
> offhand where in mm/gup.c it does this.

It doesn't; sorry, really confused memories of what's going on, took a while
to sort them out (FWIW, writeback is where we unmap and check if page is
pinned, while pin_user_pages running into an unmapped page will end up
with handle_mm_fault() (->fault(), actually) try to get the sucker locked
and block on that until the writeback is over).

Said that, I still think that pinned pages (arbitrary pagecache ones,
at that) ending up in a pipe is a seriously bad idea. It's trivial to
arrange for them to stay that way indefinitely - no priveleges needed,
very few limits, etc.

\
 
 \ /
  Last update: 2023-03-26 23:57    [W:0.099 / U:0.700 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site