Skip to contentSkip to conversation

kernel/panic: Do not append newline to the stack protector panic string

PATCH In review Borislav Petkov 2 participants 2 messages Oct 8, 2018

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 kernel/panic: Do not append newline to the stack protector panic string

From: Borislav Petkov <[email protected]>

... because panic() itself already does this. Otherwise you have line-broken trailer:

  [    1.836965] ---[ end Kernel panic - not syncing: stack-protector: Kernel stack is corrupted in: pgd_alloc+0x29e/0x2a0
  [    1.836965]  ]---
Cc Andrew Morton <[email protected]>
Cc Kees Cook <[email protected]>
Cc Masahiro Yamada <[email protected]>
Cc "Steven Rostedt (VMware)" <[email protected]>
---
 kernel/panic.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
kernel/panic.c +1 -1
index 8b2e002d52eb..837a94b7024d 100644
@@ -631,7 +631,7 @@ device_initcall(register_warn_debugfs);
  */
 __visible void __stack_chk_fail(void)
 {
-	panic("stack-protector: Kernel stack is corrupted in: %pB\n",
+	panic("stack-protector: Kernel stack is corrupted in: %pB",
 		__builtin_return_address(0));
 }
 EXPORT_SYMBOL(__stack_chk_fail);
Signature · 1 line
2.19.0.271.gfe8321ec057f
Acked-by on v1 1/1
#1 lore raw
Quoted 5 lines · Borislav Petkov

From: Borislav Petkov <[email protected]>

... because panic() itself already does this. Otherwise you have line-broken trailer:

Quoted 8 lines
  [    1.836965] ---[ end Kernel panic - not syncing: stack-protector: Kernel stack is corrupted in: pgd_alloc+0x29e/0x2a0
  [    1.836965]  ]---
Cc Andrew Morton <[email protected]>
Cc Kees Cook <[email protected]>
Cc Masahiro Yamada <[email protected]>
Cc "Steven Rostedt (VMware)" <[email protected]>

Andrew, can you take this?

-Kees

Quoted 20 lines
---
 kernel/panic.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
kernel/panic.c +1 -2
index 8b2e002d52eb..837a94b7024d 100644
@@ -631,7 +631,7 @@ device_initcall(register_warn_debugfs);
  */
 __visible void __stack_chk_fail(void)
 {
-       panic("stack-protector: Kernel stack is corrupted in: %pB\n",
+       panic("stack-protector: Kernel stack is corrupted in: %pB",
                __builtin_return_address(0));
 }
 EXPORT_SYMBOL(__stack_chk_fail);
--

2.19.0.271.gfe8321ec057f

Signature · 2 lines
Kees Cook
Pixel Security