Skip to content

Commit 437641a

Browse files
committed
configs/hardening: Enable CONFIG_INIT_ON_FREE_DEFAULT_ON
To reduce stale data lifetimes, enable CONFIG_INIT_ON_FREE_DEFAULT_ON as well. This matches the addition of CONFIG_STACKLEAK=y, which is doing similar for stack memory. Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Kees Cook <[email protected]>
1 parent 4c56d9f commit 437641a

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

kernel/configs/hardening.config

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,9 @@ CONFIG_LIST_HARDENED=y
6060
# Initialize all heap variables to zero on allocation.
6161
CONFIG_INIT_ON_ALLOC_DEFAULT_ON=y
6262

63+
# Initialize all heap variables to zero on free to reduce stale data lifetime.
64+
CONFIG_INIT_ON_FREE_DEFAULT_ON=y
65+
6366
# Initialize all stack variables to zero on function entry.
6467
CONFIG_INIT_STACK_ALL_ZERO=y
6568

0 commit comments

Comments
 (0)