Re: [PATCH v3 03/10] arm64, kfence: enable KFENCE for ARM64

From
Marco Elver <elver@google.com>
Date
2020-09-22 09:56:41
Also in
linux-arm-kernel, linux-mm, lkml
Reply to
Will Deacon, 2020-09-21
On Mon, 21 Sep 2020 at 19:44, Will Deacon [off-list ref] wrote:
[...]
quoted
quoted
quoted
quoted
For ARM64, we would like to solicit feedback on what the best option is
to obtain a constant address for __kfence_pool. One option is to declare
a memory range in the memory layout to be dedicated to KFENCE (like is
done for KASAN), however, it is unclear if this is the best available
option. We would like to avoid touching the memory layout.
Sorry for the delay on this.
NP, thanks for looking!
quoted
Given that the pool is relatively small (i.e. when compared with our virtual
address space), dedicating an area of virtual space sounds like it makes
the most sense here. How early do you need it to be available?
Yes, having a dedicated address sounds good.
We're inserting kfence_init() into start_kernel() after timekeeping_init().
So way after mm_init(), if that matters.
The question is though, how big should that dedicated area be?
Right now KFENCE_NUM_OBJECTS can be up to 16383 (which makes the pool
size 64MB), but this number actually comes from the limitation on
static objects, so we might want to increase that number on arm64.
What happens on x86 and why would we do something different?
On x86 we just do `char __kfence_pool[KFENCE_POOL_SIZE] ...;` to
statically allocate the pool. On arm64 this doesn't seem to work
because static memory doesn't have struct pages?

Thanks,
-- Marco
Thread (50 messages) 50 messages, 9 authors, last reply 2020-10-15
Keyboard shortcuts
hback out one level
jnext message in thread / next series-diff position
kprevious message in thread / previous series-diff position
ldrill in
Escclose help / fold thread tree
?toggle this help