From: Lance Yang <lance.yang@linux.dev>
To: David Hildenbrand <david@redhat.com>,
Catalin Marinas <catalin.marinas@arm.com>
Cc: linux-arm-kernel@lists.infradead.org, linux-mm@kvack.org,
Gergely Kovacs <Gergely.Kovacs2@arm.com>,
Will Deacon <will@kernel.org>
Subject: Re: [PATCH] arm64: mte: Do not flag the zero page as PG_mte_tagged
Date: Wed, 24 Sep 2025 20:55:16 +0800 [thread overview]
Message-ID: <87bc9c70-a464-4990-947a-faacd4959595@linux.dev> (raw)
In-Reply-To: <8006c8c3-8e62-47c2-9d0d-9c7183dcdcf9@redhat.com>
On 2025/9/24 20:49, David Hildenbrand wrote:
> On 24.09.25 14:48, Lance Yang wrote:
>>
>>
>> On 2025/9/24 20:31, Catalin Marinas wrote:
>>> Commit 68d54ceeec0e ("arm64: mte: Allow PTRACE_PEEKMTETAGS access to the
>>> zero page") attempted to fix ptrace() reading of tags from the zero page
>>> by marking it as PG_mte_tagged during cpu_enable_mte(). The same commit
>>> also changed the ptrace() tag access permission check to the VM_MTE vma
>>> flag while turning the page flag test into a WARN_ON_ONCE().
>>>
>>> Attempting to set the PG_mte_tagged flag early with
>>> CONFIG_DEFERRED_STRUCT_PAGE_INIT enabled may either hang (after commit
>>> d77e59a8fccd "arm64: mte: Lock a page for MTE tag initialisation") or
>>> have the flags cleared later during page_alloc_init_late(). In addition,
>>> pages_identical() -> memcmp_pages() will reject any comparison with the
>>> zero page as it is marked as tagged.
>>>
>>> Partially revert the above commit to avoid setting PG_mte_tagged on the
>>> zero page. Update the __access_remote_tags() warning on untagged pages
>>> to ignore the zero page since it is known to have the tags initialised.
>>>
>>> Note that all user mapping of the zero page are marked as pte_special().
>>> The arm64 set_pte_at() will not call mte_sync_tags() on such pages, so
>>> PG_mte_tagged will remain cleared.
>>>
>>> Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>
>>> Fixes: 68d54ceeec0e ("arm64: mte: Allow PTRACE_PEEKMTETAGS access to
>>> the zero page")
>>> Reported-by: Gergely Kovacs <Gergely.Kovacs2@arm.com>
>>> Cc: <stable@vger.kernel.org> # 5.10.x
>>> Cc: Will Deacon <will@kernel.org>
>>> Cc: David Hildenbrand <david@redhat.com>
>>> Cc: Lance Yang <lance.yang@linux.dev>
>>> ---
>>>
>>> For reference, discussion on page merging here:
>>>
>>> https://lore.kernel.org/r/aNKJ5glToE4hMhWA@arm.com
>>
>> Cool. LGTM.
>> Acked-by: Lance Yang <lance.yang@linux.dev>
>
>
> Likely you can provide even a Tested-by? Just saying :)
Right, so:
Tested-by: Lance Yang <lance.yang@linux.dev>
next prev parent reply other threads:[~2025-09-24 12:56 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-09-24 12:31 [PATCH] arm64: mte: Do not flag the zero page as PG_mte_tagged Catalin Marinas
2025-09-24 12:41 ` David Hildenbrand
2025-09-24 12:48 ` Lance Yang
2025-09-24 12:49 ` David Hildenbrand
2025-09-24 12:55 ` Lance Yang [this message]
2025-10-03 17:19 ` Will Deacon
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=87bc9c70-a464-4990-947a-faacd4959595@linux.dev \
--to=lance.yang@linux.dev \
--cc=Gergely.Kovacs2@arm.com \
--cc=catalin.marinas@arm.com \
--cc=david@redhat.com \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-mm@kvack.org \
--cc=will@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.