mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "Jose A. Perez de Azpillaga" <azpijr@gmail.com>
To: "David Hildenbrand (Arm)" <david@kernel.org>,
	Tal Zussman <tz2294@columbia.edu>, n3rd <18670333770@163.com>,
	"linux-mm@kvack.org" <linux-mm@kvack.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Cc: "akpm@linux-foundation.org" <akpm@linux-foundation.org>,
	"ljs@kernel.org" <ljs@kernel.org>,
	"kas@kernel.org" <kas@kernel.org>,
	"ziy@nvidia.com" <ziy@nvidia.com>,
	Mike Rapoport <rppt@kernel.org>,
	"peterx@redhat.com" <peterx@redhat.com>,
	"security@kernel.org" <security@kernel.org>
Subject: Re: [SECURITY] mm: khugepaged collapse_file() drops RWP PTE markers
Date: Wed, 11 Nov 2026 20:43:47 +0100	[thread overview]
Message-ID: <60029f5a-091a-4022-ae48-8fb9a00d922c@gmail.com> (raw)
In-Reply-To: <856cdf21-7982-475a-b244-a7ceff4eb6aa@kernel.org>

On 11/11/26 8:29 AM, David Hildenbrand (Arm) wrote:
> On 11/11/26 04:19, Tal Zussman wrote:
>> On 11/10/26 6:55 AM, David Hildenbrand (Arm) wrote:
>>> On 11/10/26 12:54, n3rd wrote:
>>>>
>>>> Hello,
>>>>
>>>> I am reporting a security bug in the Linux kernel.
>>>
>>> Stop sending uffd problems as security bugs. STOP IT NOW.
>>>
>>> Tal has a long list of uffd-related fixes he is about to send out. CCing him.
>>>
>> So this issue was originally on my list and I had a fix for it... but it was
>> REALLY ugly and a band-aid, so I dropped it.
> 
> Yeah, RWP is a mess.
> 
>>
>> I think the real solution is to just add actual markers for RWP and solve
>> all of these issues at once... but that should be a separate series from my
>> batch of fixes (which I'll be sending shortly). Is there a reason RWP
>> markers weren't done in the first place that I'm missing?
> 
> Let's ask kiryl: why is it ok to drop RWP PTE bits during swapout, zap, collapse
> etc?
> 
> https://kernel.org/doc/html/latest/admin-guide/mm/userfaultfd.html?utm_source=chatgpt.com
> 
> states "Unlike WP (which persists via PTE_MARKER_UFFD_WP), there is no
> persistent RWP marker today. The user needs to re-arm the range with
> UFFDIO_RWPROTECT after any operation that explicitly frees PTEs."
> 
> But requiring the user to re-arm is rather questionable design if the kernel can
> just zap these page table entries.
> 
> @Jose, maybe you want to look into marker support for RWP to make RWP a bit less
> horrible?

oops. I overlooked the thread because of the AI report...

IMHO (and after reading Kiryl's email), I'd fix the doc instead. "Scope 
of protection" doesn't mention collapse or shmem reclaim, and it still 
tells the user to re-arm.

I could work on that patch :)

-- 
cheers,
jose a. p-a

  parent reply	other threads:[~2026-11-11 19:43 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <606cae9e.bbec5.1a1c54f4f9f.Coremail.18670333770@163.com>
2026-11-10 11:55 ` David Hildenbrand (Arm)
2026-11-11  3:19   ` Tal Zussman
2026-11-11  7:29     ` David Hildenbrand (Arm)
2026-11-11 18:53       ` Kiryl Shutsemau
2026-11-11 19:18         ` Linus Torvalds
2026-11-11 19:43         ` David Hildenbrand (Arm)
2026-11-11 19:43       ` Jose A. Perez de Azpillaga [this message]
2026-11-11 19:53         ` Kiryl Shutsemau

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=60029f5a-091a-4022-ae48-8fb9a00d922c@gmail.com \
    --to=azpijr@gmail.com \
    --cc=18670333770@163.com \
    --cc=akpm@linux-foundation.org \
    --cc=david@kernel.org \
    --cc=kas@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=ljs@kernel.org \
    --cc=peterx@redhat.com \
    --cc=rppt@kernel.org \
    --cc=security@kernel.org \
    --cc=tz2294@columbia.edu \
    --cc=ziy@nvidia.com \
    /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®