[PATCH 0/3] Make the scheduler stack end check selectable at boot

From: Chris Down

Date: Tue Oct 27 2026 - 02:37:06 EST


At Meta, some of our host types enable CONFIG_SCHED_STACK_END_CHECK, but
we don't want it generally on because of the extra work on every context
switch.

Right now this is only configurable by setting the Kconfig option at
build time. Let's make it so we can also select it at boot with
sched_stack_end_check=, so that those hosts can share one kernel image.

(Patch 1 is a cleanup I happened upon while working on this, it can
also be taken independently.)

Chris Down (3):
sched/core: Skip the shadow stack end check when SCS is disabled
sched/core: Add sched_stack_end_check= boot parameter
lkdtm/bugs: Add CORRUPT_STACK_END to test the scheduler stack end
check

.../admin-guide/kernel-parameters.txt | 8 +++++
drivers/misc/lkdtm/bugs.c | 21 ++++++++++++
kernel/sched/core.c | 33 +++++++++++++++----
tools/testing/selftests/lkdtm/tests.txt | 1 +
4 files changed, 57 insertions(+), 6 deletions(-)


base-commit: b99b7f60c5b473d374c68b53753153b4aa9e0702
--
2.54.0