[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <d52fb90a-0d30-49de-8d4e-86141f5ce297@os.amperecomputing.com>
Date: Tue, 18 Nov 2025 15:34:46 -0800
From: Yang Shi <yang@...amperecomputing.com>
To: Nathan Chancellor <nathan@...nel.org>
Cc: ryan.roberts@....com, dev.jain@....com, cl@...two.org,
catalin.marinas@....com, will@...nel.org,
linux-arm-kernel@...ts.infradead.org, linux-kernel@...r.kernel.org
Subject: Re: [v2 PATCH] arm64: mm: make linear mapping permission update more
robust for patial range
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@...nel.org>
Thank you. I will prepare a formal patch soon.
Yang
>
> Cheers,
> Nathan
Powered by blists - more mailing lists