--- zzzz-none-000/linux-4.9.279/kernel/panic.c 2021-08-08 06:38:54.000000000 +0000 +++ puma7-arm-6591-750/linux-4.9.279/kernel/panic.c 2023-02-08 10:58:16.000000000 +0000 @@ -5,6 +5,11 @@ */ /* + * Includes Intel Corporation's changes/modifications dated: 2017. + * Changed/modified portions - Copyright (c) 2017, Intel Corporation. + */ + +/* * This function is used through-out the kernel (including mm and fs) * to indicate a major problem. */ @@ -128,10 +133,15 @@ * * This function never returns. */ +#ifdef CONFIG_FULL_PANIC void panic(const char *fmt, ...) { static char buf[1024]; va_list args; +#else +void tiny_panic(int a, ...) +{ +#endif long i, i_next = 0; int state = 0; int old_cpu, this_cpu; @@ -169,10 +179,16 @@ console_verbose(); bust_spinlocks(1); + +#ifdef CONFIG_FULL_PANIC va_start(args, fmt); vsnprintf(buf, sizeof(buf), fmt, args); va_end(args); pr_emerg("Kernel panic - not syncing: %s\n", buf); +#else + pr_emerg("Kernel panic - not syncing\n"); +#endif + #ifdef CONFIG_DEBUG_BUGVERBOSE /* * Avoid nested stack-dumping if a panic occurs during oops processing @@ -212,7 +228,11 @@ * Run any panic handlers, including those that might need to * add information to the kmsg dump output. */ +#ifdef CONFIG_FULL_PANIC atomic_notifier_call_chain(&panic_notifier_list, 0, buf); +#else + atomic_notifier_call_chain(&panic_notifier_list, 0, ""); +#endif /* Call flush even twice. It tries harder with a single online CPU */ printk_nmi_flush_on_panic(); @@ -289,8 +309,12 @@ disabled_wait(caller); } #endif +#ifdef CONFIG_FULL_PANIC pr_emerg("---[ end Kernel panic - not syncing: %s\n", buf); - local_irq_enable(); +#else + pr_emerg("---[ end Kernel panic - not syncing\n"); +#endif + //local_irq_enable(); for (i = 0; ; i += PANIC_TIMER_STEP) { touch_softlockup_watchdog(); if (i >= i_next) { @@ -301,8 +325,11 @@ } } +#ifdef CONFIG_FULL_PANIC EXPORT_SYMBOL(panic); - +#else +EXPORT_SYMBOL(tiny_panic); +#endif struct tnt { u8 bit; @@ -600,6 +627,9 @@ */ __visible void __stack_chk_fail(void) { + if (IS_ENABLED(CONFIG_CC_STACKPROTECTOR_BUG_ON_FAIL)) + BUG(); + panic("stack-protector: Kernel stack is corrupted in: %p\n", __builtin_return_address(0)); }