lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <aNOwuKmbAaMaEMb7@arm.com>
Date: Wed, 24 Sep 2025 09:50:00 +0100
From: Catalin Marinas <catalin.marinas@....com>
To: Lance Yang <lance.yang@...ux.dev>
Cc: David Hildenbrand <david@...hat.com>, akpm@...ux-foundation.org,
	lorenzo.stoakes@...cle.com, usamaarif642@...il.com,
	yuzhao@...gle.com, ziy@...dia.com, baolin.wang@...ux.alibaba.com,
	baohua@...nel.org, voidice@...il.com, Liam.Howlett@...cle.com,
	cerasuolodomenico@...il.com, hannes@...xchg.org,
	kaleshsingh@...gle.com, npache@...hat.com, riel@...riel.com,
	roman.gushchin@...ux.dev, rppt@...nel.org, ryan.roberts@....com,
	dev.jain@....com, ryncsn@...il.com, shakeel.butt@...ux.dev,
	surenb@...gle.com, hughd@...gle.com, willy@...radead.org,
	matthew.brost@...el.com, joshua.hahnjy@...il.com, rakie.kim@...com,
	byungchul@...com, gourry@...rry.net, ying.huang@...ux.alibaba.com,
	apopple@...dia.com, qun-wei.lin@...iatek.com,
	Andrew.Yang@...iatek.com, casper.li@...iatek.com,
	chinwen.chang@...iatek.com, linux-arm-kernel@...ts.infradead.org,
	linux-kernel@...r.kernel.org, linux-mediatek@...ts.infradead.org,
	linux-mm@...ck.org, ioworker0@...il.com, stable@...r.kernel.org
Subject: Re: [PATCH 1/1] mm/thp: fix MTE tag mismatch when replacing
 zero-filled subpages

On Wed, Sep 24, 2025 at 10:49:27AM +0800, Lance Yang wrote:
> On 2025/9/24 00:14, Catalin Marinas wrote:
> > So alternative patch that also fixes the deferred struct page init (on
> > the assumptions that the zero page is always mapped as pte_special():
> 
> I can confirm that this alternative patch also works correctly; my tests
> for MTE all pass ;)

Thanks Lance for testing. I'll post one of the variants today.

> This looks like a better fix since it solves the boot hang issue too.

In principle, yes, until I tracked down why I changed it in the first
place - 68d54ceeec0e ("arm64: mte: Allow PTRACE_PEEKMTETAGS access to
the zero page"). ptrace() can read tags from PROT_MTE mappings and we
want to allow reading zeroes as well if the page points to the zero
page. Not flagging the page as PG_mte_tagged caused issues.

I can change the logic in the ptrace() code, I just need to figure out
what happens to the huge zero page. Ideally we should treat both in the
same way but, AFAICT, we don't use pmd_mkspecial() on the huge zero
page, so it gets flagged with PG_mte_tagged.

If I go with the first fix for the page merging, I'll look to defer the
zero page initialisation post page_alloc_init_late() in a separate
patch.

-- 
Catalin

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ