lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Date:   Fri, 26 May 2023 10:23:46 +0100
From:   Lorenzo Stoakes <lstoakes@...il.com>
To:     David Howells <dhowells@...hat.com>
Cc:     Christoph Hellwig <hch@...radead.org>,
        David Hildenbrand <david@...hat.com>,
        Jens Axboe <axboe@...nel.dk>,
        Al Viro <viro@...iv.linux.org.uk>,
        Matthew Wilcox <willy@...radead.org>, Jan Kara <jack@...e.cz>,
        Jeff Layton <jlayton@...nel.org>,
        Jason Gunthorpe <jgg@...dia.com>,
        Logan Gunthorpe <logang@...tatee.com>,
        Hillf Danton <hdanton@...a.com>,
        Christian Brauner <brauner@...nel.org>,
        Linus Torvalds <torvalds@...ux-foundation.org>,
        linux-fsdevel@...r.kernel.org, linux-block@...r.kernel.org,
        linux-kernel@...r.kernel.org, linux-mm@...ck.org,
        Andrew Morton <akpm@...ux-foundation.org>
Subject: Re: [RFC PATCH v2 1/3] mm: Don't pin ZERO_PAGE in pin_user_pages()

On Fri, May 26, 2023 at 10:15:26AM +0100, David Howells wrote:
> Lorenzo Stoakes <lstoakes@...il.com> wrote:
>
> > > iov_iter_extract_pages(), on the other hand, is only used in two places
> > > with these patches and the pins are always released with
> > > unpin_user_page*() so it's a lot easier to audit.
> >
> > Thanks for the clarification. I guess these are the cases where you're
> > likely to see zero page usage, but since this is changing all PUP*() callers
> > don't you need to audit all of those too?
>
> I don't think it should be necessary.  This only affects pages obtained from
> gup with FOLL_PIN - and, so far as I know, those always have to be released
> with unpin_user_page*() which is part of the gup API and thus it should be
> transparent to the users.
>

Right, I was only saying so in relation to you stating the need to audit,
for precisely this reason I wondered why you felt the need to :)

> Pages obtained FOLL_GET, on the other hand, aren't freed through the gup API -
> and there are a bunch of ways of releasing them - and getting additional refs
> too.

Yes that's a very good point! Sorry, in my enthusiasm for GUP reform this
thorny aspect slipped my mind...

As Christoph said though hopefully over time we can limit the use of FOLL_GET so
this becomes easier perhaps. Larger discussion on this area in [0] :)

[0]:https://lore.kernel.org/all/ZGWnq%2FdAYELyKpTy@infradead.org/

>
> David
>

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ