mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "David Hildenbrand (Arm)" <david@kernel.org>
To: Andrew Morton <akpm@linux-foundation.org>,
	Donggeun Yoo <donggeunyoo.kernel@gmail.com>
Cc: rppt@kernel.org, peterx@redhat.com, surenb@google.com,
	aarcange@redhat.com, ljs@kernel.org, liam@infradead.org,
	vbabka@kernel.org, mhocko@suse.com, shuah@kernel.org,
	kirill@shutemov.name, linux-mm@kvack.org,
	linux-kselftest@vger.kernel.org, linux-kernel@vger.kernel.org,
	stable@vger.kernel.org
Subject: Re: [PATCH v2 1/2] userfaultfd: clear the inherited uffd bit in move_swap_pte()
Date: Fri, 25 Sep 2026 09:36:26 +0200	[thread overview]
Message-ID: <8f60eae1-31ba-4ff4-adf9-951240561f13@kernel.org> (raw)
In-Reply-To: <20260924214811.19ef8af417d37071ed8338c4@linux-foundation.org>

On 9/25/26 06:48, Andrew Morton wrote:
> On Fri, 25 Sep 2026 13:29:06 +0900 Donggeun Yoo <donggeunyoo.kernel@gmail.com> wrote:
> 
>> UFFDIO_MOVE on a swapped-out page installs the source PTE at the
>> destination unchanged, so a uffd bit set on the source lands in a
>> destination VMA that was never registered for write protection.  It
>> can't be unset there, and THP collapse can't happen either, because a
>> swap entry with the uffd bit set makes the scan bail.
>>
>> I don't think it's intentional because for an unswapped page the bit
>> doesn't come along, and I don't see why being swapped out should change
>> that.
>>
>> Clear the uffd bit on the moved swap entry unless the destination is
>> RWP-registered.
> 
> Thanks, but...
> 
> When fixing a bug, please always fully describe the userspace-visible
> effects of that bug.

It would also be helpful to describe if this was actually hit in practice so
far. IOW, how relevant is this in practice.

Will this trigger a kernel splat later?

Someone would have to use UFFD_WP/UFFD_RWP with UFFDIO_MOVE, and have
UFFD_WP/UFFD_RWP disabled on the destination vma ... and then work on a swap entry.

Code itself LGTM

-- 
Cheers,

David

  reply	other threads:[~2026-09-25  7:36 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-09-25  4:29 [PATCH v2 0/2] " Donggeun Yoo
2026-09-25  4:29 ` [PATCH v2 1/2] " Donggeun Yoo
2026-09-25  4:48   ` Andrew Morton
2026-09-25  7:36     ` David Hildenbrand (Arm) [this message]
2026-09-25  4:29 ` [PATCH v2 2/2] selftests/mm: add a test for UFFDIO_MOVE of a write-protected swap entry Donggeun Yoo
2026-09-25  7:41   ` David Hildenbrand (Arm)

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=8f60eae1-31ba-4ff4-adf9-951240561f13@kernel.org \
    --to=david@kernel.org \
    --cc=aarcange@redhat.com \
    --cc=akpm@linux-foundation.org \
    --cc=donggeunyoo.kernel@gmail.com \
    --cc=kirill@shutemov.name \
    --cc=liam@infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-kselftest@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=ljs@kernel.org \
    --cc=mhocko@suse.com \
    --cc=peterx@redhat.com \
    --cc=rppt@kernel.org \
    --cc=shuah@kernel.org \
    --cc=stable@vger.kernel.org \
    --cc=surenb@google.com \
    --cc=vbabka@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

all inboxes | Powered by JetHome®