Skip to content

Commit 62e9c1e

Browse files
tobluxkees
authored andcommitted
stackleak: Use str_enabled_disabled() helper in stack_erasing_sysctl()
Remove hard-coded strings by using the str_enabled_disabled() helper function. Signed-off-by: Thorsten Blum <thorsten.blum@linux.dev> Link: https://lore.kernel.org/r/20241222223157.135164-2-thorsten.blum@linux.dev Signed-off-by: Kees Cook <kees@kernel.org>
1 parent e3f6a42 commit 62e9c1e

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

kernel/stackleak.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515

1616
#ifdef CONFIG_STACKLEAK_RUNTIME_DISABLE
1717
#include <linux/jump_label.h>
18+
#include <linux/string_choices.h>
1819
#include <linux/sysctl.h>
1920
#include <linux/init.h>
2021

@@ -41,7 +42,7 @@ static int stack_erasing_sysctl(const struct ctl_table *table, int write,
4142
static_branch_enable(&stack_erasing_bypass);
4243

4344
pr_warn("stackleak: kernel stack erasing is %s\n",
44-
state ? "enabled" : "disabled");
45+
str_enabled_disabled(state));
4546
return ret;
4647
}
4748
static struct ctl_table stackleak_sysctls[] = {

0 commit comments

Comments
 (0)