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] [thread-next>] [day] [month] [year] [list]
Date:   Thu, 3 Sep 2020 00:23:24 -0700
From:   John Hubbard <jhubbard@...dia.com>
To:     Souptick Joarder <jrdr.linux@...il.com>
CC:     Barry Song <song.bao.hua@...ilicon.com>,
        Andrew Morton <akpm@...ux-foundation.org>,
        Linux-MM <linux-mm@...ck.org>, <linux-kernel@...r.kernel.org>,
        <linuxarm@...wei.com>, Jan Kara <jack@...e.cz>,
        Jérôme Glisse <jglisse@...hat.com>,
        "Matthew Wilcox (Oracle)" <willy@...radead.org>,
        Al Viro <viro@...iv.linux.org.uk>,
        Christoph Hellwig <hch@...radead.org>,
        "Dan Williams" <dan.j.williams@...el.com>,
        Dave Chinner <david@...morbit.com>,
        Jason Gunthorpe <jgg@...pe.ca>,
        Jonathan Corbet <corbet@....net>,
        "Michal Hocko" <mhocko@...e.com>,
        Mike Kravetz <mike.kravetz@...cle.com>,
        Shuah Khan <shuah@...nel.org>, Vlastimil Babka <vbabka@...e.cz>
Subject: Re: [PATCH] mm/gup: don't permit users to call get_user_pages with
 FOLL_LONGTERM

On 9/3/20 12:12 AM, Souptick Joarder wrote:
> On Wed, Aug 19, 2020 at 11:45 PM John Hubbard <jhubbard@...dia.com> wrote:
>>
>> On 8/19/20 4:01 AM, Barry Song wrote:
>>> gug prohibits users from calling get_user_pages() with FOLL_PIN. But it
>>
>> Maybe Andrew can fix the typo above: gug --> gup.
>>
>>
>>> allows users to call get_user_pages() with FOLL_LONGTERM only. It seems
>>> insensible.
>>>
>>> since FOLL_LONGTERM is a stricter case of FOLL_PIN, we should prohibit
>>> users from calling get_user_pages() with FOLL_LONGTERM while not with
>>> FOLL_PIN.
>>>
>>> mm/gup_benchmark.c used to be the only user who did this improperly.
>>> But it has been fixed by moving to use pin_user_pages().
>>
>> For future patches, you don't have to write everything in the
>> commit log. Some things are better placed in a cover letter or after
>> the "---" line, because they don't need to be recorded forever.
>>
>> Anyway, the diffs seem fine, assuming that you've audited the call sites.
> 
> We can use is_valid_gup_flags() inside ->
> get_user_pages_locked(),
> get_user_pages_unlocked(),
> pin_user_pages_locked() as well.

Probably it's best to discern between valid pup flags, and valid gup flags.
As in: separate functions for those. Maybe one is a subset of the other, but
still.

> 
> Are you planning to add it in future patches ?
> 

It's not on my list. I don't see anything wrong with doing so, other
than avoiding the minor pitfall I called out above. So if you want to
do that, then feel free...


thanks,
-- 
John Hubbard
NVIDIA

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ