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]
Message-Id: <20230507180053.7d47cd3b58c73f3b6fc567e0@linux-foundation.org>
Date:   Sun, 7 May 2023 18:00:53 -0700
From:   Andrew Morton <akpm@...ux-foundation.org>
To:     David Hildenbrand <david@...hat.com>
Cc:     Lorenzo Stoakes <lstoakes@...il.com>, linux-mm@...ck.org,
        linux-kernel@...r.kernel.org
Subject: Re: [PATCH] mm/gup: add missing gup_must_unshare() check to
 gup_huge_pgd()

On Mon, 8 May 2023 02:45:12 +0200 David Hildenbrand <david@...hat.com> wrote:

> On 08.05.23 02:30, Andrew Morton wrote:
> > On Sat,  6 May 2023 15:05:25 +0100 Lorenzo Stoakes <lstoakes@...il.com> wrote:
> > 
> >> All other instances of gup_huge_pXd() perform the unshare check, so update
> >> the PGD-specific function to do so as well.
> >>
> >> While checking pgd_write() might seem unusual, this function already
> >> performs such a check via pgd_access_permitted() so this is in line with
> >> the existing implementation.
> > 
> > Rationale seems strange.  "Other sites do it so this should also".  Why
> > is this a desirable change?  Maybe the "other instances" shouldn't be
> > performing this check either?
> 
> This change makes unshare handling across all GUP-fast variants consistent,
> which is desirable as GUP-fast is complicated enough already even when
> consistent :)

Thanks, I added the below to the changelog:

David said:

: This change makes unshare handling across all GUP-fast variants
: consistent, which is desirable as GUP-fast is complicated enough
: already even when consistent.
: 
: This function was the only one I seemed to have missed (or left out and
: forgot why -- maybe because it's really dead code for now).  The COW
: selftest would identify the problem, so far there was no report. 
: Either the selftest wasn't run on corresponding architectures with that
: hugetlb size, or that code is still dead code and unused by
: architectures.
: 
: the original commit(s) that added unsharing explain why we care about
: these checks:
: 
: a7f226604170acd6 ("mm/gup: trigger FAULT_FLAG_UNSHARE when R/O-pinning a possibly shared anonymous page")
: 84209e87c6963f92 ("mm/gup: reliable R/O long-term pinning in COW mappings")

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ