From: Yang Shi <yang@os.amperecomputing.com>
To: Nathan Chancellor <nathan@kernel.org>
Cc: ryan.roberts@arm.com, dev.jain@arm.com, cl@gentwo.org,
catalin.marinas@arm.com, will@kernel.org,
linux-arm-kernel@lists.infradead.org,
linux-kernel@vger.kernel.org
Subject: Re: [v2 PATCH] arm64: mm: make linear mapping permission update more robust for patial range
Date: Tue, 18 Nov 2025 15:34:46 -0800 [thread overview]
Message-ID: <d52fb90a-0d30-49de-8d4e-86141f5ce297@os.amperecomputing.com> (raw)
In-Reply-To: <20251118230750.GA1451312@ax162>
On 11/18/25 3:07 PM, Nathan Chancellor wrote:
> On Tue, Nov 18, 2025 at 09:35:08AM -0800, Yang Shi wrote:
>> Thanks for reporting this problem. It looks like I forgot to use untagged
>> address when calculating idx.
>>
>> Can you please try the below patch?
>>
>> diff --git a/arch/arm64/mm/pageattr.c b/arch/arm64/mm/pageattr.c
>> index 08ac96b9f846..0f6417e3f9f1 100644
>> --- a/arch/arm64/mm/pageattr.c
>> +++ b/arch/arm64/mm/pageattr.c
>> @@ -183,7 +183,7 @@ static int change_memory_common(unsigned long addr, int
>> numpages,
>> */
>> if (rodata_full && (pgprot_val(set_mask) == PTE_RDONLY ||
>> pgprot_val(clear_mask) == PTE_RDONLY)) {
>> - unsigned long idx = (start - (unsigned long)area->addr) >>
>> PAGE_SHIFT;
>> + unsigned long idx = (start - (unsigned
>> long)kasan_reset_tag(area->addr)) >> PAGE_SHIFT;
>> for (; numpages; idx++, numpages--) {
>> __change_memory_common((u64)page_address(area->pages[idx]),
>> PAGE_SIZE, set_mask,
>> clear_mask);
> Yes, that appears to resolve the issue for me, thanks for the quick fix!
>
> If a formal tag helps:
>
> Tested-by: Nathan Chancellor <nathan@kernel.org>
Thank you. I will prepare a formal patch soon.
Yang
>
> Cheers,
> Nathan
prev parent reply other threads:[~2025-11-18 23:35 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-10-23 20:44 [v2 PATCH] arm64: mm: make linear mapping permission update more robust for patial range Yang Shi
2025-11-10 23:08 ` Yang Shi
2025-11-13 18:59 ` Catalin Marinas
2025-11-18 16:41 ` Nathan Chancellor
2025-11-18 17:35 ` Yang Shi
2025-11-18 23:07 ` Nathan Chancellor
2025-11-18 23:34 ` Yang Shi [this message]
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=d52fb90a-0d30-49de-8d4e-86141f5ce297@os.amperecomputing.com \
--to=yang@os.amperecomputing.com \
--cc=catalin.marinas@arm.com \
--cc=cl@gentwo.org \
--cc=dev.jain@arm.com \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=nathan@kernel.org \
--cc=ryan.roberts@arm.com \
--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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox