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: <809f4dc3-cba1-25b9-36cf-492e3b434530@codeaurora.org>
Date:   Fri, 12 Jun 2020 19:27:14 +0530
From:   Shyam Thombre <sthombre@...eaurora.org>
To:     Catalin Marinas <catalin.marinas@....com>
Cc:     will.deacon@....com, ard.biesheuvel@....com, mark.rutland@....com,
        anshuman.khandual@....com, sashal@...nel.org,
        linux-arm-kernel@...ts.infradead.org, linux-kernel@...r.kernel.org,
        jcrouse@...eaurora.org
Subject: Re: [PATCH] arm64: mm: reset address tag set by kasan sw tagging

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@...eaurora.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

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ