From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by smtp.subspace.kernel.org (Postfix) with ESMTP id CCCC1481253 for ; Wed, 1 Jul 2026 12:26:19 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=217.140.110.172 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1782908781; cv=none; b=tIjXohf8d3G63Ug36fP57pFzMNBTGsq0ua++fNuib3dwMPv2QHvsa8JIJQuaumiyu15XAdAhM8ose5fvhrgibTwtxIvyX3wBGxV7qCuSfFKtSIYPIgt7TrOuJ7aHu6zeXcUzOnnm4EHtbKVJQmlFc/+cImXf1EQCRvs0LUVBNaM= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1782908781; c=relaxed/simple; bh=U3DO0j/dmUnuT8V0sMZSGlJWF7PRalEy3TBu9TEA4Gg=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=qn/fRT1NYLxEr4NOk7VCXCyotd+RUP4jc2xJswB9joOccSj6ImkbHBW1lU6f4T0wiI706Y2zmqiePodVmP5bcwqq7DqOeEBZ6EN4aqBE6SL9ELqqJ03dw/Ai5njzmxA30aGHwcqUKF34pIx4rkNrjDDbdTLr+5+5MUrMC3j0FpM= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=arm.com; spf=pass smtp.mailfrom=arm.com; dkim=pass (1024-bit key) header.d=arm.com header.i=@arm.com header.b=j6b5h+ZG; arc=none smtp.client-ip=217.140.110.172 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=arm.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=arm.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=arm.com header.i=@arm.com header.b="j6b5h+ZG" Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id CA0682309; Wed, 1 Jul 2026 05:26:14 -0700 (PDT) Received: from [10.164.19.15] (unknown [10.164.19.15]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id D84A53F85F; Wed, 1 Jul 2026 05:26:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=arm.com; s=foss; t=1782908779; bh=U3DO0j/dmUnuT8V0sMZSGlJWF7PRalEy3TBu9TEA4Gg=; h=Date:Subject:To:Cc:References:From:In-Reply-To:From; b=j6b5h+ZGlYet+l8RJqC7C3JtqgHXxikuUKU4RoK4Fcmi8iZkKNQcMim54FA961tjF tAeeIFIg1H0dRzCh5JM/daTl7Cy/a6PArfhnY52jopb1oYOGQ6KcOo/fKN3z61RTKG ztgWBrC1porMMbL48pZGQJBXP8T6B6zTVQHMs06Y= Message-ID: <5158500d-0a30-4b2f-9b0f-f10e01dabd4d@arm.com> Date: Wed, 1 Jul 2026 17:56:10 +0530 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH] mm: pgtable: free kernel page tables via RCU to fix ptdump UAF To: David CARLIER Cc: Andrew Morton , David Hildenbrand , Lorenzo Stoakes , "Liam R . Howlett" , Vlastimil Babka , Mike Rapoport , Suren Baghdasaryan , Michal Hocko , Paul Walmsley , Palmer Dabbelt , Albert Ou , Alexandre Ghiti , Dave Hansen , Lu Baolu , syzbot+fd95a72470f5a44e464c@syzkaller.appspotmail.com, linux-mm@kvack.org, linux-kernel@vger.kernel.org, linux-riscv@lists.infradead.org References: <20260630041012.5975-1-devnexen@gmail.com> Content-Language: en-US From: Dev Jain In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit 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(); >>> >>