]> www.infradead.org Git - users/dwmw2/linux.git/commitdiff
stackleak: Use str_enabled_disabled() helper in stack_erasing_sysctl()
authorThorsten Blum <thorsten.blum@linux.dev>
Sun, 22 Dec 2024 22:31:57 +0000 (23:31 +0100)
committerKees Cook <kees@kernel.org>
Mon, 23 Dec 2024 04:28:11 +0000 (20:28 -0800)
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>
kernel/stackleak.c

index 39fd620a7db6f908e8c8e51f765b041aae22fe5f..0f4804f28c616e3f538f38d381d2045cd83a466b 100644 (file)
@@ -15,6 +15,7 @@
 
 #ifdef CONFIG_STACKLEAK_RUNTIME_DISABLE
 #include <linux/jump_label.h>
+#include <linux/string_choices.h>
 #include <linux/sysctl.h>
 #include <linux/init.h>
 
@@ -41,7 +42,7 @@ static int stack_erasing_sysctl(const struct ctl_table *table, int write,
                static_branch_enable(&stack_erasing_bypass);
 
        pr_warn("stackleak: kernel stack erasing is %s\n",
-                                       state ? "enabled" : "disabled");
+                                       str_enabled_disabled(state));
        return ret;
 }
 static struct ctl_table stackleak_sysctls[] = {