[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <878s2kxq5m.fsf@dja-thinkpad.axtens.net>
Date: Tue, 06 Jul 2021 10:05:41 +1000
From: Daniel Axtens <dja@...ens.net>
To: Marco Elver <elver@...gle.com>,
Kefeng Wang <wangkefeng.wang@...wei.com>
Cc: Catalin Marinas <catalin.marinas@....com>,
Will Deacon <will@...nel.org>,
Andrey Ryabinin <ryabinin.a.a@...il.com>,
Andrey Konovalov <andreyknvl@...il.com>,
Dmitry Vyukov <dvyukov@...gle.com>,
linux-arm-kernel@...ts.infradead.org, linux-kernel@...r.kernel.org,
kasan-dev@...glegroups.com, linux-mm@...ck.org
Subject: Re: [PATCH -next 3/3] kasan: arm64: Fix pcpu_page_first_chunk crash
with KASAN_VMALLOC
> If so, should we put the call inside of vm_area_register_early?
Ah, we already do this. Sorry. My other questions remain.
Kind regards,
Daniel
>
> Kind regards,
> Daniel
>
>>
>>> void __init kasan_init(void)
>>> {
>>> kasan_init_shadow();
>>> diff --git a/include/linux/kasan.h b/include/linux/kasan.h
>>> index 5310e217bd74..79d3895b0240 100644
>>> --- a/include/linux/kasan.h
>>> +++ b/include/linux/kasan.h
>>> @@ -49,6 +49,8 @@ extern p4d_t kasan_early_shadow_p4d[MAX_PTRS_PER_P4D];
>>> int kasan_populate_early_shadow(const void *shadow_start,
>>> const void *shadow_end);
>>>
>>> +void kasan_populate_early_vm_area_shadow(void *start, unsigned long size);
>>> +
>>> static inline void *kasan_mem_to_shadow(const void *addr)
>>> {
>>> return (void *)((unsigned long)addr >> KASAN_SHADOW_SCALE_SHIFT)
>>> diff --git a/mm/kasan/init.c b/mm/kasan/init.c
>>> index cc64ed6858c6..d39577d088a1 100644
>>> --- a/mm/kasan/init.c
>>> +++ b/mm/kasan/init.c
>>> @@ -279,6 +279,11 @@ int __ref kasan_populate_early_shadow(const void *shadow_start,
>>> return 0;
>>> }
>>>
>>> +void __init __weak kasan_populate_early_vm_area_shadow(void *start,
>>> + unsigned long size)
>>> +{
>>> +}
>>
>> I'm just wondering if this could be a generic function, perhaps with an
>> appropriate IS_ENABLED() check of a generic Kconfig option
>> (CONFIG_NEED_PER_CPU_PAGE_FIRST_CHUNK ?) to short-circuit it, if it's
>> not only an arm64 problem.
>>
>> But I haven't looked much further, so would appeal to you to either
>> confirm or reject this idea.
>>
>> Thanks,
>> -- Marco
Powered by blists - more mailing lists