Re: [PATCH] kasan: Add explicit preconditions to kasan_report()

2021-01-21 Thread Andrey Konovalov
On Thu, Jan 21, 2021 at 12:30 PM Vincenzo Frascino wrote: > > Hi Andrey, > > On 1/19/21 8:56 PM, Andrey Konovalov wrote: > >> 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. > > It is not

Re: [PATCH] kasan: Add explicit preconditions to kasan_report()

2021-01-21 Thread Vincenzo Frascino
Hi Andrey, On 1/19/21 8:56 PM, Andrey Konovalov wrote: >> 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. It is not necessary but it does not hurt, since we are going to add vmalloc anyway at some

Re: [PATCH] kasan: Add explicit preconditions to kasan_report()

2021-01-20 Thread Catalin Marinas
On Wed, Jan 20, 2021 at 04:16:02PM +, Vincenzo Frascino wrote: > On 1/20/21 4:04 PM, Catalin Marinas wrote: > > On Tue, Jan 19, 2021 at 08:35:49PM +, Vincenzo Frascino wrote: > >> On 1/19/21 6:52 PM, Catalin Marinas wrote: > >>> On Tue, Jan 19, 2021 at 07:27:43PM +0100, Andrey Konovalov

Re: [PATCH] kasan: Add explicit preconditions to kasan_report()

2021-01-20 Thread Vincenzo Frascino
On 1/20/21 4:04 PM, Catalin Marinas wrote: > On Tue, Jan 19, 2021 at 08:35:49PM +, Vincenzo Frascino wrote: >> On 1/19/21 6:52 PM, Catalin Marinas wrote: >>> On Tue, Jan 19, 2021 at 07:27:43PM +0100, Andrey Konovalov wrote: On Tue, Jan 19, 2021 at 6:26 PM Vincenzo Frascino wrote:

Re: [PATCH] kasan: Add explicit preconditions to kasan_report()

2021-01-20 Thread Catalin Marinas
On Tue, Jan 19, 2021 at 08:35:49PM +, Vincenzo Frascino wrote: > On 1/19/21 6:52 PM, Catalin Marinas wrote: > > On Tue, Jan 19, 2021 at 07:27:43PM +0100, Andrey Konovalov wrote: > >> On Tue, Jan 19, 2021 at 6:26 PM Vincenzo Frascino > >> wrote: > >>> > >>> With the introduction of

Re: [PATCH] kasan: Add explicit preconditions to kasan_report()

2021-01-19 Thread Andrey Konovalov
On Tue, Jan 19, 2021 at 9:32 PM Vincenzo Frascino 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

Re: [PATCH] kasan: Add explicit preconditions to kasan_report()

2021-01-19 Thread Catalin Marinas
On Tue, Jan 19, 2021 at 07:27:43PM +0100, Andrey Konovalov wrote: > On Tue, Jan 19, 2021 at 6:26 PM Vincenzo Frascino > wrote: > > > > With the introduction of KASAN_HW_TAGS, kasan_report() dereferences > > the address passed as a parameter. > > > > Add a comment to make sure that the

Re: [PATCH] kasan: Add explicit preconditions to kasan_report()

2021-01-19 Thread Andrey Konovalov
On Tue, Jan 19, 2021 at 6:26 PM Vincenzo Frascino wrote: > > With the introduction of KASAN_HW_TAGS, kasan_report() dereferences > the address passed as a parameter. > > Add a comment to make sure that the preconditions to the function are > explicitly clarified. > > Note: An invalid address

Re: [PATCH] kasan: Add explicit preconditions to kasan_report()

2021-01-19 Thread Vincenzo Frascino
On 1/19/21 6:52 PM, Catalin Marinas wrote: > On Tue, Jan 19, 2021 at 07:27:43PM +0100, Andrey Konovalov wrote: >> On Tue, Jan 19, 2021 at 6:26 PM Vincenzo Frascino >> wrote: >>> >>> With the introduction of KASAN_HW_TAGS, kasan_report() dereferences >>> the address passed as a parameter. >>>

Re: [PATCH] kasan: Add explicit preconditions to kasan_report()

2021-01-19 Thread Andrey Konovalov
On Tue, Jan 19, 2021 at 7:57 PM Vincenzo Frascino wrote: > > > > On 1/19/21 6:52 PM, Catalin Marinas wrote: > > On Tue, Jan 19, 2021 at 07:27:43PM +0100, Andrey Konovalov wrote: > >> On Tue, Jan 19, 2021 at 6:26 PM Vincenzo Frascino > >> wrote: > >>> > >>> With the introduction of KASAN_HW_TAGS,

Re: [PATCH] kasan: Add explicit preconditions to kasan_report()

2021-01-19 Thread Vincenzo Frascino
On 1/19/21 6:52 PM, Catalin Marinas wrote: > On Tue, Jan 19, 2021 at 07:27:43PM +0100, Andrey Konovalov wrote: >> On Tue, Jan 19, 2021 at 6:26 PM Vincenzo Frascino >> wrote: >>> >>> With the introduction of KASAN_HW_TAGS, kasan_report() dereferences >>> the address passed as a parameter. >>>

Re: [PATCH] kasan: Add explicit preconditions to kasan_report()

2021-01-19 Thread Vincenzo Frascino
On 1/19/21 7:02 PM, Catalin Marinas wrote: > On Tue, Jan 19, 2021 at 07:00:57PM +, Vincenzo Frascino wrote: >> On 1/19/21 6:52 PM, Catalin Marinas wrote: >>> On Tue, Jan 19, 2021 at 07:27:43PM +0100, Andrey Konovalov wrote: On Tue, Jan 19, 2021 at 6:26 PM Vincenzo Frascino wrote:

Re: [PATCH] kasan: Add explicit preconditions to kasan_report()

2021-01-19 Thread Catalin Marinas
On Tue, Jan 19, 2021 at 07:00:57PM +, Vincenzo Frascino wrote: > On 1/19/21 6:52 PM, Catalin Marinas wrote: > > On Tue, Jan 19, 2021 at 07:27:43PM +0100, Andrey Konovalov wrote: > >> On Tue, Jan 19, 2021 at 6:26 PM Vincenzo Frascino > >> wrote: > >>> > >>> With the introduction of

Re: [PATCH] kasan: Add explicit preconditions to kasan_report()

2021-01-19 Thread Vincenzo Frascino
Hi Andrey, On 1/19/21 6:27 PM, Andrey Konovalov wrote: > On Tue, Jan 19, 2021 at 6:26 PM Vincenzo Frascino > wrote: >> >> With the introduction of KASAN_HW_TAGS, kasan_report() dereferences >> the address passed as a parameter. >> >> Add a comment to make sure that the preconditions to the

[PATCH] kasan: Add explicit preconditions to kasan_report()

2021-01-19 Thread Vincenzo Frascino
With the introduction of KASAN_HW_TAGS, kasan_report() dereferences the address passed as a parameter. Add a comment to make sure that the preconditions to the function are explicitly clarified. Note: An invalid address (e.g. NULL pointer address) passed to the function when, KASAN_HW_TAGS is