From: Peter Xu <peterx@redhat.com>
To: Nadav Amit <nadav.amit@gmail.com>
Cc: Andrew Morton <akpm@linux-foundation.org>,
linux-mm@kvack.org, Nadav Amit <namit@vmware.com>,
James Houghton <jthoughton@google.com>,
David Hildenbrand <david@redhat.com>,
Mike Rapoport <rppt@linux.ibm.com>, Jan Kara <jack@suse.cz>,
Andrea Arcangeli <aarcange@redhat.com>,
stable@vger.kernel.org
Subject: Re: [PATCH] userfaultfd: provide properly masked address for huge-pages
Date: Tue, 12 Jul 2022 09:27:36 -0400 [thread overview]
Message-ID: <Ys12yG6XKCCTI3LH@xz-m1.local> (raw)
In-Reply-To: <20220711165906.2682-1-namit@vmware.com>
On Mon, Jul 11, 2022 at 09:59:06AM -0700, Nadav Amit wrote:
> From: Nadav Amit <namit@vmware.com>
>
> Commit 824ddc601adc ("userfaultfd: provide unmasked address on
> page-fault") was introduced to fix an old bug, in which the offset in
> the address of a page-fault was masked. Concerns were raised - although
> were never backed by actual code - that some userspace code might break
> because the bug has been around for quite a while. To address these
> concerns a new flag was introduced, and only when this flag is set by
> the user, userfaultfd provides the exact address of the page-fault.
>
> The commit however had a bug, and if the flag is unset, the offset was
> always masked based on a base-page granularity. Yet, for huge-pages, the
> behavior prior to the commit was that the address is masked to the
> huge-page granulrity.
>
> While there are no reports on real breakage, fix this issue. If the flag
> is unset, use the address with the masking that was done before.
>
> Fixes: 824ddc601adc ("userfaultfd: provide unmasked address on page-fault")
> Reported-by: James Houghton <jthoughton@google.com>
> Cc: Peter Xu <peterx@redhat.com>
> Cc: David Hildenbrand <david@redhat.com>
> Cc: Mike Rapoport <rppt@linux.ibm.com>
> Cc: Jan Kara <jack@suse.cz>
> Cc: Andrea Arcangeli <aarcange@redhat.com>
> Cc: <stable@vger.kernel.org>
> Signed-off-by: Nadav Amit <namit@vmware.com>
Reviewed-by: Peter Xu <peterx@redhat.com>
--
Peter Xu
next prev parent reply other threads:[~2022-07-12 13:27 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-07-11 16:59 Nadav Amit
2022-07-12 6:33 ` Mike Rapoport
2022-07-12 13:27 ` Peter Xu [this message]
2022-07-12 17:04 ` James Houghton
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=Ys12yG6XKCCTI3LH@xz-m1.local \
--to=peterx@redhat.com \
--cc=aarcange@redhat.com \
--cc=akpm@linux-foundation.org \
--cc=david@redhat.com \
--cc=jack@suse.cz \
--cc=jthoughton@google.com \
--cc=linux-mm@kvack.org \
--cc=nadav.amit@gmail.com \
--cc=namit@vmware.com \
--cc=rppt@linux.ibm.com \
--cc=stable@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox