mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Dev Jain <dev.jain@arm.com>
To: David CARLIER <devnexen@gmail.com>
Cc: Andrew Morton <akpm@linux-foundation.org>,
	David Hildenbrand <david@kernel.org>,
	Lorenzo Stoakes <ljs@kernel.org>,
	"Liam R . Howlett" <liam@infradead.org>,
	Vlastimil Babka <vbabka@kernel.org>,
	Mike Rapoport <rppt@kernel.org>,
	Suren Baghdasaryan <surenb@google.com>,
	Michal Hocko <mhocko@suse.com>, Paul Walmsley <pjw@kernel.org>,
	Palmer Dabbelt <palmer@dabbelt.com>,
	Albert Ou <aou@eecs.berkeley.edu>,
	Alexandre Ghiti <alex@ghiti.fr>,
	Dave Hansen <dave.hansen@linux.intel.com>,
	Lu Baolu <baolu.lu@linux.intel.com>,
	syzbot+fd95a72470f5a44e464c@syzkaller.appspotmail.com,
	linux-mm@kvack.org, linux-kernel@vger.kernel.org,
	linux-riscv@lists.infradead.org
Subject: Re: [PATCH] mm: pgtable: free kernel page tables via RCU to fix ptdump UAF
Date: Wed, 1 Jul 2026 17:56:10 +0530	[thread overview]
Message-ID: <5158500d-0a30-4b2f-9b0f-f10e01dabd4d@arm.com> (raw)
In-Reply-To: <CA+XhMqzErBiN5w56fO2_2T3Yj=-L+dPUDjoMvNdK9PcF37nsbw@mail.gmail.com>



On 01/07/26 11:27 am, David CARLIER wrote:
> Hi Dev,
> 
> Yes, the RCU deferral covers arm64 too, so the static key and the
> mmap_lock in pud_free_pmd_page()/pmd_free_pte_page() are now
> redundant. Keep the arch_vmap_*_supported() changes though.

Sorry I should have mentioned in my previous email that I had a comment
below, on the code :) could you please see below.

[--- snip ---]


>>> diff --git a/mm/ptdump.c b/mm/ptdump.c
>>> index 973020000096..50cd96a33dfd 100644
>>> --- a/mm/ptdump.c
>>> +++ b/mm/ptdump.c
>>> @@ -178,11 +178,13 @@ void ptdump_walk_pgd(struct ptdump_state *st, struct mm_struct *mm, pgd_t *pgd)
>>>
>>>       get_online_mems();
>>>       mmap_write_lock(mm);
>>
>> mmap write lock is not required anymore no?

^
>>
>>
>>> +     rcu_read_lock();
>>
>> Is there a possibility of RCU stall here? For example a system with
>> lots of physical memory will have a huge linear map.

^


>>
>>>       while (range->start != range->end) {
>>>               walk_page_range_debug(mm, range->start, range->end,
>>>                                     &ptdump_ops, pgd, st);
>>>               range++;
>>>       }
>>> +     rcu_read_unlock();
>>>       mmap_write_unlock(mm);
>>>       put_online_mems();
>>>
>>


  reply	other threads:[~2026-07-01 12:26 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-06-30  4:10 David Carlier
2026-07-01  5:42 ` Dev Jain
2026-07-01  5:57   ` David CARLIER
2026-07-01 12:26     ` Dev Jain [this message]
2026-07-01 15:58 ` David Hildenbrand (Arm)
2026-07-02  9:18 David Carlier
2026-07-02  9:25 ` Dev Jain

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=5158500d-0a30-4b2f-9b0f-f10e01dabd4d@arm.com \
    --to=dev.jain@arm.com \
    --cc=akpm@linux-foundation.org \
    --cc=alex@ghiti.fr \
    --cc=aou@eecs.berkeley.edu \
    --cc=baolu.lu@linux.intel.com \
    --cc=dave.hansen@linux.intel.com \
    --cc=david@kernel.org \
    --cc=devnexen@gmail.com \
    --cc=liam@infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=linux-riscv@lists.infradead.org \
    --cc=ljs@kernel.org \
    --cc=mhocko@suse.com \
    --cc=palmer@dabbelt.com \
    --cc=pjw@kernel.org \
    --cc=rppt@kernel.org \
    --cc=surenb@google.com \
    --cc=syzbot+fd95a72470f5a44e464c@syzkaller.appspotmail.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®