Re: [PATCH v4 02/11] x86, kfence: enable KFENCE for x86

From
Jann Horn <jannh@google.com>
Date
2020-10-02 06:09:25
Also in
linux-arm-kernel, linux-mm, lkml
Reply to
Marco Elver, 2020-09-29
On Tue, Sep 29, 2020 at 3:38 PM Marco Elver [off-list ref] wrote:
Add architecture specific implementation details for KFENCE and enable
KFENCE for the x86 architecture. In particular, this implements the
required interface in <asm/kfence.h> for setting up the pool and
providing helper functions for protecting and unprotecting pages.
[...]
quoted hunk ↗ jump to hunk
diff --git a/arch/x86/include/asm/kfence.h b/arch/x86/include/asm/kfence.h
[...]
quoted hunk ↗ jump to hunk
+/* Protect the given page and flush TLBs. */
+static inline bool kfence_protect_page(unsigned long addr, bool protect)
+{
[...]
+       flush_tlb_one_kernel(addr);
flush_tlb_one_kernel() -> flush_tlb_one_user() ->
__flush_tlb_one_user() -> native_flush_tlb_one_user() only flushes on
the local CPU core, not on others. If you want to leave it this way, I
think this needs a comment explaining why we're not doing a global
flush (locking context / performance overhead / ... ?).
Thread (36 messages) 36 messages, 6 authors, last reply 2020-10-12
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