linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: Shyam Thombre <sthombre@codeaurora.org>
To: Catalin Marinas <catalin.marinas@arm.com>
Cc: mark.rutland@arm.com, sashal@kernel.org,
	anshuman.khandual@arm.com, will.deacon@arm.com,
	linux-kernel@vger.kernel.org, jcrouse@codeaurora.org,
	ard.biesheuvel@arm.com, linux-arm-kernel@lists.infradead.org
Subject: Re: [PATCH] arm64: mm: reset address tag set by kasan sw tagging
Date: Fri, 12 Jun 2020 19:27:14 +0530	[thread overview]
Message-ID: <809f4dc3-cba1-25b9-36cf-492e3b434530@codeaurora.org> (raw)
In-Reply-To: <20200610113626.GI26099@gaia>

Hi Catalin,


On 6/10/2020 5:06 PM, Catalin Marinas wrote:
> On Wed, Jun 10, 2020 at 04:39:44PM +0530, Shyam Thombre wrote:
>> KASAN sw tagging sets a random tag of 8 bits in the top byte of the pointer
>> returned by the memory allocating functions. So for the functions unaware
>> of this change, the top 8 bits of the address must be reset which is done
>> by the function arch_kasan_reset_tag().
>>
>> Signed-off-by: Shyam Thombre <sthombre@codeaurora.org>
>> ---
>>   arch/arm64/mm/mmu.c | 1 +
>>   1 file changed, 1 insertion(+)
>>
>> diff --git a/arch/arm64/mm/mmu.c b/arch/arm64/mm/mmu.c
>> index e7fbc62..eae7655 100644
>> --- a/arch/arm64/mm/mmu.c
>> +++ b/arch/arm64/mm/mmu.c
>> @@ -723,6 +723,7 @@ int kern_addr_valid(unsigned long addr)
>>   	pmd_t *pmdp, pmd;
>>   	pte_t *ptep, pte;
>>   
>> +	addr = arch_kasan_reset_tag(addr);
>>   	if ((((long)addr) >> VA_BITS) != -1UL)
>>   		return 0;
> 
> It would be interesting to know what fails without this patch. The only
> user seems to be read_kcore() and, at a quick look, I don't see how it
> can generate tagged addresses.
> 

This issue is seen in downstream GPU drivers. It currently doesn't look 
to impact any upstream users.


-- 
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum,
a Linux Foundation Collaborative Project

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

  reply	other threads:[~2020-06-12 13:58 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-06-10 11:09 [PATCH] arm64: mm: reset address tag set by kasan sw tagging Shyam Thombre
2020-06-10 11:36 ` Catalin Marinas
2020-06-12 13:57   ` Shyam Thombre [this message]
2020-06-15 16:34 ` 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=809f4dc3-cba1-25b9-36cf-492e3b434530@codeaurora.org \
    --to=sthombre@codeaurora.org \
    --cc=anshuman.khandual@arm.com \
    --cc=ard.biesheuvel@arm.com \
    --cc=catalin.marinas@arm.com \
    --cc=jcrouse@codeaurora.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mark.rutland@arm.com \
    --cc=sashal@kernel.org \
    --cc=will.deacon@arm.com \
    /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;
as well as URLs for NNTP newsgroup(s).