lkml.org 
[lkml]   [2021]   [Jan]   [19]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
Date
SubjectRe: [PATCH] kasan: Add explicit preconditions to kasan_report()
On Tue, Jan 19, 2021 at 9:32 PM Vincenzo Frascino
<vincenzo.frascino@arm.com> wrote:
>
> This seems not working on arm64 because according to virt_addr_valid 0 is a
> valid virtual address, in fact:
>
> __is_lm_address(0) == true && pfn_valid(virt_to_pfn(0)) == true.
>
> An option could be to make an exception for virtual address 0 in
> addr_has_metadata() something like:
>
> static inline bool addr_has_metadata(const void *addr)
> {
> if ((u64)addr == 0)
> return false;

This sounds good to me, but we need to check for < PAGE_SIZE or
something like that, right? There's some limit below which accesses
are considered null-ptr-derefs.

> return (is_vmalloc_addr(addr) || virt_addr_valid(addr));

Do we need is_vmalloc_addr()? As we don't yet have vmalloc support for HW_TAGS.

\
 
 \ /
  Last update: 2021-01-19 21:59    [W:0.090 / U:0.104 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site