public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] hardening: Enable KFENCE in the hardening config
@ 2024-02-12 13:01 Marco Elver
  2024-02-12 14:07 ` Matthieu Baerts
  2024-02-12 19:04 ` Kees Cook
  0 siblings, 2 replies; 3+ messages in thread
From: Marco Elver @ 2024-02-12 13:01 UTC (permalink / raw)
  To: elver, Kees Cook
  Cc: Gustavo A. R. Silva, linux-hardening, linux-kernel, Dmitry Vyukov,
	Alexander Potapenko, kasan-dev, Matthieu Baerts, Jakub Kicinski

KFENCE is not a security mitigation mechanism (due to sampling), but has
the performance characteristics of unintrusive hardening techniques.
When used at scale, however, it improves overall security by allowing
kernel developers to detect heap memory-safety bugs cheaply.

Link: https://lkml.kernel.org/r/79B9A832-B3DE-4229-9D87-748B2CFB7D12@kernel.org
Cc: Matthieu Baerts <matttbe@kernel.org>
Cc: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Marco Elver <elver@google.com>
---
 kernel/configs/hardening.config | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/kernel/configs/hardening.config b/kernel/configs/hardening.config
index 95a400f042b1..79c865bfb116 100644
--- a/kernel/configs/hardening.config
+++ b/kernel/configs/hardening.config
@@ -46,6 +46,9 @@ CONFIG_UBSAN_BOUNDS=y
 # CONFIG_UBSAN_ALIGNMENT
 CONFIG_UBSAN_SANITIZE_ALL=y
 
+# Sampling-based heap out-of-bounds and use-after-free detection.
+CONFIG_KFENCE=y
+
 # Linked list integrity checking.
 CONFIG_LIST_HARDENED=y
 
-- 
2.43.0.687.g38aa6559b0-goog


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] hardening: Enable KFENCE in the hardening config
  2024-02-12 13:01 [PATCH] hardening: Enable KFENCE in the hardening config Marco Elver
@ 2024-02-12 14:07 ` Matthieu Baerts
  2024-02-12 19:04 ` Kees Cook
  1 sibling, 0 replies; 3+ messages in thread
From: Matthieu Baerts @ 2024-02-12 14:07 UTC (permalink / raw)
  To: Marco Elver, Kees Cook
  Cc: Gustavo A. R. Silva, linux-hardening, linux-kernel, Dmitry Vyukov,
	Alexander Potapenko, kasan-dev, Jakub Kicinski

Hi Marco,

On 12/02/2024 14:01, Marco Elver wrote:
> KFENCE is not a security mitigation mechanism (due to sampling), but has
> the performance characteristics of unintrusive hardening techniques.
> When used at scale, however, it improves overall security by allowing
> kernel developers to detect heap memory-safety bugs cheaply.

Thank you for having sent this patch!

Cheers,
Matt
-- 
Sponsored by the NGI0 Core fund.

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] hardening: Enable KFENCE in the hardening config
  2024-02-12 13:01 [PATCH] hardening: Enable KFENCE in the hardening config Marco Elver
  2024-02-12 14:07 ` Matthieu Baerts
@ 2024-02-12 19:04 ` Kees Cook
  1 sibling, 0 replies; 3+ messages in thread
From: Kees Cook @ 2024-02-12 19:04 UTC (permalink / raw)
  To: Marco Elver
  Cc: Gustavo A. R. Silva, linux-hardening, linux-kernel, Dmitry Vyukov,
	Alexander Potapenko, kasan-dev, Matthieu Baerts, Jakub Kicinski

On Mon, Feb 12, 2024 at 02:01:09PM +0100, Marco Elver wrote:
> KFENCE is not a security mitigation mechanism (due to sampling), but has
> the performance characteristics of unintrusive hardening techniques.
> When used at scale, however, it improves overall security by allowing
> kernel developers to detect heap memory-safety bugs cheaply.
> 
> Link: https://lkml.kernel.org/r/79B9A832-B3DE-4229-9D87-748B2CFB7D12@kernel.org
> Cc: Matthieu Baerts <matttbe@kernel.org>
> Cc: Jakub Kicinski <kuba@kernel.org>
> Signed-off-by: Marco Elver <elver@google.com>

Thanks! Applied to my for-next/hardening tree.

https://git.kernel.org/pub/scm/linux/kernel/git/kees/linux.git/commit/?h=for-next/hardening&id=1f82cb2f3859540120e990a79abfee8151ea6b93

-Kees

-- 
Kees Cook

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2024-02-12 19:04 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-02-12 13:01 [PATCH] hardening: Enable KFENCE in the hardening config Marco Elver
2024-02-12 14:07 ` Matthieu Baerts
2024-02-12 19:04 ` Kees Cook

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox