diff --git a/arch/alpha/kernel/traps.c b/arch/alpha/kernel/traps.c index f6b9664ac5042d7eca61c9889c321648cf532761..5b1920a04556694def6b76159bb15a9b3ab36152 100644 --- a/arch/alpha/kernel/traps.c +++ b/arch/alpha/kernel/traps.c @@ -192,7 +192,8 @@ die_if_kernel(char * str, struct pt_regs *regs, long err, unsigned long *r9_15) local_irq_enable(); while (1); } - do_exit(SIGSEGV); + pr_info("%s() (SIGSEGV) +", __func__); do_exit(SIGSEGV); } #ifndef CONFIG_MATHEMU @@ -577,7 +578,8 @@ do_entUna(void * va, unsigned long opcode, unsigned long reg, printk("Bad unaligned kernel access at %016lx: %p %lx %lu\n", pc, va, opcode, reg); - do_exit(SIGSEGV); + pr_info("%s() (SIGSEGV) +", __func__); do_exit(SIGSEGV); got_exception: /* Ok, we caught the exception, but we don't want it. Is there @@ -632,7 +634,8 @@ do_entUna(void * va, unsigned long opcode, unsigned long reg, local_irq_enable(); while (1); } - do_exit(SIGSEGV); + pr_info("%s() (SIGSEGV) +", __func__); do_exit(SIGSEGV); } /* diff --git a/arch/alpha/mm/fault.c b/arch/alpha/mm/fault.c index 741e61ef9d3fe4d11b8349f42fc0e404b60cb0fa..eec894e0ab6ccf5f146e5205bb13306fa826d1e9 100644 --- a/arch/alpha/mm/fault.c +++ b/arch/alpha/mm/fault.c @@ -206,7 +206,8 @@ do_page_fault(unsigned long address, unsigned long mmcsr, printk(KERN_ALERT "Unable to handle kernel paging request at " "virtual address %016lx\n", address); die_if_kernel("Oops", regs, cause, (unsigned long*)regs - 16); - do_exit(SIGKILL); + pr_info("%s() (SIGKILL) +", __func__); do_exit(SIGKILL); /* We ran out of memory, or some other thing happened to us that made us unable to handle the page fault gracefully. */ diff --git a/arch/arm/kernel/traps.c b/arch/arm/kernel/traps.c index c053abd1fb5393d853fd48aca47c3ec975b27eed..6d97bbdbd0571fcbc2f3668b25bd3e1ed066a688 100644 --- a/arch/arm/kernel/traps.c +++ b/arch/arm/kernel/traps.c @@ -338,7 +338,8 @@ static void oops_end(unsigned long flags, struct pt_regs *regs, int signr) if (panic_on_oops) panic("Fatal exception"); if (signr) - do_exit(signr); + pr_info("%s() (signr) +", __func__); do_exit(signr); } /* diff --git a/arch/arm/mm/fault.c b/arch/arm/mm/fault.c index bd0f4821f7e11fa52b20e73fd1c0ea56bab728e6..82b2b847a612b42d15ff915b15bfab4de4f75bc6 100644 --- a/arch/arm/mm/fault.c +++ b/arch/arm/mm/fault.c @@ -124,7 +124,8 @@ __do_kernel_fault(struct mm_struct *mm, unsigned long addr, unsigned int fsr, show_pte(KERN_ALERT, mm, addr); die("Oops", regs, fsr); bust_spinlocks(0); - do_exit(SIGKILL); + pr_info("%s() (SIGKILL) +", __func__); do_exit(SIGKILL); } /* diff --git a/arch/arm64/kernel/traps.c b/arch/arm64/kernel/traps.c index 34739e80211bc5f59f88be6793b0e4a8d15d67c8..906af565675a73e4a7a59011b49a563289080fcb 100644 --- a/arch/arm64/kernel/traps.c +++ b/arch/arm64/kernel/traps.c @@ -200,6 +200,7 @@ void die(const char *str, struct pt_regs *regs, int err) panic("Fatal exception"); raw_spin_unlock_irqrestore(&die_lock, flags); + pr_info("%s() 1 SIGSEGV\n", __func__); if (ret != NOTIFY_STOP) do_exit(SIGSEGV); diff --git a/arch/arm64/mm/fault.c b/arch/arm64/mm/fault.c index 9fc6db0bcbad0636f2ee6919cc2a04d5f8bd4127..b8dc9bda9668c75abf24176f1217015dc3a9e235 100644 --- a/arch/arm64/mm/fault.c +++ b/arch/arm64/mm/fault.c @@ -296,6 +296,7 @@ static void die_kernel_fault(const char *msg, unsigned long addr, show_pte(addr); die("Oops", regs, esr); bust_spinlocks(0); + pr_info("%s() 1 SIGKILL\n", __func__); do_exit(SIGKILL); } diff --git a/arch/csky/abiv1/alignment.c b/arch/csky/abiv1/alignment.c index cb2a0d94a144d381541d81da2618c46849b7345b..01d40170a56e7adc3eb06b43abd07da81031b4e1 100644 --- a/arch/csky/abiv1/alignment.c +++ b/arch/csky/abiv1/alignment.c @@ -294,7 +294,8 @@ void csky_alignment(struct pt_regs *regs) __func__, opcode, rz, rx, imm, addr); show_regs(regs); bust_spinlocks(0); - do_exit(SIGKILL); + pr_info("%s() (SIGKILL) +", __func__); do_exit(SIGKILL); } force_sig_fault(SIGBUS, BUS_ADRALN, (void __user *)addr); diff --git a/arch/csky/kernel/traps.c b/arch/csky/kernel/traps.c index b057480e7463c74acafca327285edd2016fff093..9d5f90d17ee8b5b9e4f00a11e2f38a8f054946d0 100644 --- a/arch/csky/kernel/traps.c +++ b/arch/csky/kernel/traps.c @@ -85,7 +85,8 @@ void die_if_kernel(char *str, struct pt_regs *regs, int nr) pr_err("%s: %08x\n", str, nr); show_regs(regs); add_taint(TAINT_DIE, LOCKDEP_NOW_UNRELIABLE); - do_exit(SIGSEGV); + pr_info("%s() (SIGSEGV) +", __func__); do_exit(SIGSEGV); } void buserr(struct pt_regs *regs) diff --git a/arch/h8300/kernel/traps.c b/arch/h8300/kernel/traps.c index e47a9e0dc278fa99abb1319f9503d8a0c2f33ca9..0921e3c1428a00eefa617cfa473316596fdb988c 100644 --- a/arch/h8300/kernel/traps.c +++ b/arch/h8300/kernel/traps.c @@ -110,7 +110,8 @@ void die(const char *str, struct pt_regs *fp, unsigned long err) dump(fp); spin_unlock_irq(&die_lock); - do_exit(SIGSEGV); + pr_info("%s() (SIGSEGV) +", __func__); do_exit(SIGSEGV); } static int kstack_depth_to_print = 24; diff --git a/arch/h8300/mm/fault.c b/arch/h8300/mm/fault.c index fabffb83930af24e214d27637eb90deb976492d0..a4e9295a508b22fc3931b3c71c68e591932a54af 100644 --- a/arch/h8300/mm/fault.c +++ b/arch/h8300/mm/fault.c @@ -52,7 +52,8 @@ asmlinkage int do_page_fault(struct pt_regs *regs, unsigned long address, printk(" at virtual address %08lx\n", address); if (!user_mode(regs)) die("Oops", regs, error_code); - do_exit(SIGKILL); + pr_info("%s() (SIGKILL) +", __func__); do_exit(SIGKILL); return 1; } diff --git a/arch/hexagon/kernel/traps.c b/arch/hexagon/kernel/traps.c index 69c623b14ddd2808485023c83badf73f0d4019dc..de52b572bae1f91170d09627a32b141c13e2b9a4 100644 --- a/arch/hexagon/kernel/traps.c +++ b/arch/hexagon/kernel/traps.c @@ -221,7 +221,8 @@ int die(const char *str, struct pt_regs *regs, long err) panic("Fatal exception"); oops_exit(); - do_exit(err); + pr_info("%s() (err) +", __func__); do_exit(err); return 0; } diff --git a/arch/ia64/kernel/mca_drv.c b/arch/ia64/kernel/mca_drv.c index 4d0ab323dee8c7d65cb0db3a1adb1b186970cda6..ced08be2491456d3e395178d31f300e7f44e7395 100644 --- a/arch/ia64/kernel/mca_drv.c +++ b/arch/ia64/kernel/mca_drv.c @@ -176,7 +176,8 @@ mca_handler_bh(unsigned long paddr, void *iip, unsigned long ipsr) spin_unlock(&mca_bh_lock); /* This process is about to be killed itself */ - do_exit(SIGKILL); + pr_info("%s() (SIGKILL) +", __func__); do_exit(SIGKILL); } /** diff --git a/arch/ia64/kernel/traps.c b/arch/ia64/kernel/traps.c index e13cb905930fb754bdaf899ec6c950970377b733..46e581a78bd901f75a8a6759f613555bb7ff92a0 100644 --- a/arch/ia64/kernel/traps.c +++ b/arch/ia64/kernel/traps.c @@ -85,7 +85,8 @@ die (const char *str, struct pt_regs *regs, long err) if (panic_on_oops) panic("Fatal exception"); - do_exit(SIGSEGV); + pr_info("%s() (SIGSEGV) +", __func__); do_exit(SIGSEGV); return 0; } diff --git a/arch/ia64/mm/fault.c b/arch/ia64/mm/fault.c index c2f299fe9e04a88c8bc9675a5295141a4a0f82eb..b4d4b8acf464939761bd74416c551a8d31e60266 100644 --- a/arch/ia64/mm/fault.c +++ b/arch/ia64/mm/fault.c @@ -272,7 +272,8 @@ ia64_do_page_fault (unsigned long address, unsigned long isr, struct pt_regs *re regs = NULL; bust_spinlocks(0); if (regs) - do_exit(SIGKILL); + pr_info("%s() (SIGKILL) +", __func__); do_exit(SIGKILL); return; out_of_memory: diff --git a/arch/m68k/kernel/traps.c b/arch/m68k/kernel/traps.c index 344f93d36a9a08958b0585b1f8d007875e7ad99f..67b0d8b3a8af40043b9f7860a439652d07809dc2 100644 --- a/arch/m68k/kernel/traps.c +++ b/arch/m68k/kernel/traps.c @@ -1139,7 +1139,8 @@ void die_if_kernel (char *str, struct pt_regs *fp, int nr) pr_crit("%s: %08x\n", str, nr); show_registers(fp); add_taint(TAINT_DIE, LOCKDEP_NOW_UNRELIABLE); - do_exit(SIGSEGV); + pr_info("%s() (SIGSEGV) +", __func__); do_exit(SIGSEGV); } asmlinkage void set_esp0(unsigned long ssp) @@ -1153,7 +1154,8 @@ asmlinkage void set_esp0(unsigned long ssp) */ asmlinkage void fpsp040_die(void) { - do_exit(SIGSEGV); + pr_info("%s() (SIGSEGV) +", __func__); do_exit(SIGSEGV); } #ifdef CONFIG_M68KFPU_EMU diff --git a/arch/m68k/mm/fault.c b/arch/m68k/mm/fault.c index e9b1d7585b43bf5aaff5bead9ee2e9b537f0e800..42f27aceb1da5027fff03476b13ba02ef4e51936 100644 --- a/arch/m68k/mm/fault.c +++ b/arch/m68k/mm/fault.c @@ -48,7 +48,8 @@ int send_fault_sig(struct pt_regs *regs) pr_alert("Unable to handle kernel access"); pr_cont(" at virtual address %p\n", addr); die_if_kernel("Oops", regs, 0 /*error_code*/); - do_exit(SIGKILL); + pr_info("%s() (SIGKILL) +", __func__); do_exit(SIGKILL); } return 1; diff --git a/arch/microblaze/kernel/exceptions.c b/arch/microblaze/kernel/exceptions.c index cf99c411503e3571594a680a01bf0967d8e134b3..2e933ea32531ec9f654e9dd54957ca1a2cb23a87 100644 --- a/arch/microblaze/kernel/exceptions.c +++ b/arch/microblaze/kernel/exceptions.c @@ -47,7 +47,8 @@ void die(const char *str, struct pt_regs *fp, long err) /* do_exit() should take care of panic'ing from an interrupt * context so we don't handle it here */ - do_exit(err); + pr_info("%s() (err) +", __func__); do_exit(err); } /* for user application debugging */ diff --git a/arch/mips/kernel/syscall.c b/arch/mips/kernel/syscall.c index 3f16f382303103b8ead5374c8c75319680c146bd..edb6038c239715f846616e7d78b11d486d7886e8 100644 --- a/arch/mips/kernel/syscall.c +++ b/arch/mips/kernel/syscall.c @@ -246,5 +246,6 @@ SYSCALL_DEFINE3(cachectl, char *, addr, int, nbytes, int, op) */ asmlinkage void bad_stack(void) { - do_exit(SIGSEGV); + pr_info("%s() (SIGSEGV) +", __func__); do_exit(SIGSEGV); } diff --git a/arch/mips/kernel/traps.c b/arch/mips/kernel/traps.c index 342e41de9d64ee5d2fa99d3ac5997f69c62954d5..358028aa65dddd7106ce2963a5535aaf342485ba 100644 --- a/arch/mips/kernel/traps.c +++ b/arch/mips/kernel/traps.c @@ -415,7 +415,8 @@ void __noreturn die(const char *str, struct pt_regs *regs) if (regs && kexec_should_crash(current)) crash_kexec(regs); - do_exit(sig); + pr_info("%s() (sig) +", __func__); do_exit(sig); } extern struct exception_table_entry __start___dbe_table[]; diff --git a/arch/nds32/kernel/fpu.c b/arch/nds32/kernel/fpu.c index 62bdafbc53f4c8183a3412ffbf6a5065346db92b..110e6ddb265ed2e6731c6f339654f6b7deed5b28 100644 --- a/arch/nds32/kernel/fpu.c +++ b/arch/nds32/kernel/fpu.c @@ -223,7 +223,8 @@ inline void handle_fpu_exception(struct pt_regs *regs) } } else if (fpcsr & FPCSR_mskRIT) { if (!user_mode(regs)) - do_exit(SIGILL); + pr_info("%s() (SIGILL) +", __func__); do_exit(SIGILL); si_signo = SIGILL; } diff --git a/arch/nds32/kernel/traps.c b/arch/nds32/kernel/traps.c index f4d386b52622762c7011667466ee0a632bec6fc8..7489ce88ace7963ba7dd05a8f285910f8e93550b 100644 --- a/arch/nds32/kernel/traps.c +++ b/arch/nds32/kernel/traps.c @@ -184,7 +184,8 @@ void die(const char *str, struct pt_regs *regs, int err) bust_spinlocks(0); spin_unlock_irq(&die_lock); - do_exit(SIGSEGV); + pr_info("%s() (SIGSEGV) +", __func__); do_exit(SIGSEGV); } EXPORT_SYMBOL(die); @@ -288,7 +289,8 @@ void unhandled_interruption(struct pt_regs *regs) pr_emerg("unhandled_interruption\n"); show_regs(regs); if (!user_mode(regs)) - do_exit(SIGKILL); + pr_info("%s() (SIGKILL) +", __func__); do_exit(SIGKILL); force_sig(SIGKILL); } @@ -299,7 +301,8 @@ void unhandled_exceptions(unsigned long entry, unsigned long addr, addr, type); show_regs(regs); if (!user_mode(regs)) - do_exit(SIGKILL); + pr_info("%s() (SIGKILL) +", __func__); do_exit(SIGKILL); force_sig(SIGKILL); } @@ -326,7 +329,8 @@ void do_revinsn(struct pt_regs *regs) pr_emerg("Reserved Instruction\n"); show_regs(regs); if (!user_mode(regs)) - do_exit(SIGILL); + pr_info("%s() (SIGILL) +", __func__); do_exit(SIGILL); force_sig(SIGILL); } diff --git a/arch/nds32/mm/fault.c b/arch/nds32/mm/fault.c index 064ae5d2159d076658e960a83df4574e2778ed48..185fc440e90ee0e206df0293fb16053e10b576a4 100644 --- a/arch/nds32/mm/fault.c +++ b/arch/nds32/mm/fault.c @@ -311,7 +311,8 @@ void do_page_fault(unsigned long entry, unsigned long addr, show_pte(mm, addr); die("Oops", regs, error_code); bust_spinlocks(0); - do_exit(SIGKILL); + pr_info("%s() (SIGKILL) +", __func__); do_exit(SIGKILL); return; diff --git a/arch/nios2/kernel/traps.c b/arch/nios2/kernel/traps.c index 486db793923c03c14845d7adcd95b63b72e04ce2..94910b9028e125597ca93528aaea47260a8028cf 100644 --- a/arch/nios2/kernel/traps.c +++ b/arch/nios2/kernel/traps.c @@ -40,7 +40,8 @@ void die(const char *str, struct pt_regs *regs, long err) * do_exit() should take care of panic'ing from an interrupt * context so we don't handle it here */ - do_exit(err); + pr_info("%s() (err) +", __func__); do_exit(err); } void _exception(int signo, struct pt_regs *regs, int code, unsigned long addr) diff --git a/arch/openrisc/kernel/traps.c b/arch/openrisc/kernel/traps.c index 932a8ec2b520eefd224e871e85967033e3eaa5aa..b0267ec49e2d40888413a5190149021debe5c4e4 100644 --- a/arch/openrisc/kernel/traps.c +++ b/arch/openrisc/kernel/traps.c @@ -218,7 +218,8 @@ void die(const char *str, struct pt_regs *regs, long err) __asm__ __volatile__("l.nop 1"); do {} while (1); #endif - do_exit(SIGSEGV); + pr_info("%s() (SIGSEGV) +", __func__); do_exit(SIGSEGV); } /* This is normally the 'Oops' routine */ diff --git a/arch/openrisc/mm/fault.c b/arch/openrisc/mm/fault.c index 5d4d3a9691d0fb32d3bbcd8041e05bf4fa06c5f2..2b8255af80bc143a632c43bc400c71bfced30bd6 100644 --- a/arch/openrisc/mm/fault.c +++ b/arch/openrisc/mm/fault.c @@ -250,7 +250,8 @@ asmlinkage void do_page_fault(struct pt_regs *regs, unsigned long address, die("Oops", regs, write_acc); - do_exit(SIGKILL); + pr_info("%s() (SIGKILL) +", __func__); do_exit(SIGKILL); /* * We ran out of memory, or some other thing happened to us that made diff --git a/arch/parisc/kernel/traps.c b/arch/parisc/kernel/traps.c index 82fc011894889856e52423c1e37fb813d1fd6891..a880765685c9a70f6a534588d522aed5170828ac 100644 --- a/arch/parisc/kernel/traps.c +++ b/arch/parisc/kernel/traps.c @@ -268,7 +268,8 @@ void die_if_kernel(char *str, struct pt_regs *regs, long err) panic("Fatal exception"); oops_exit(); - do_exit(SIGSEGV); + pr_info("%s() (SIGSEGV) +", __func__); do_exit(SIGSEGV); } /* gdb uses break 4,8 */ diff --git a/arch/powerpc/kernel/signal_32.c b/arch/powerpc/kernel/signal_32.c index 98600b276f764d957fe5f8d91386c921a288cc90..019fd023d2728f9774124545a9adeca6c79cb04b 100644 --- a/arch/powerpc/kernel/signal_32.c +++ b/arch/powerpc/kernel/signal_32.c @@ -1140,7 +1140,8 @@ SYSCALL_DEFINE3(swapcontext, struct ucontext __user *, old_ctx, * We kill the task with a SIGSEGV in this situation. */ if (do_setcontext(new_ctx, regs, 0)) - do_exit(SIGSEGV); + pr_info("%s() (SIGSEGV) +", __func__); do_exit(SIGSEGV); set_thread_flag(TIF_RESTOREALL); return 0; diff --git a/arch/powerpc/kernel/signal_64.c b/arch/powerpc/kernel/signal_64.c index 117515564ec7a6e2d13ecdeba37e3973934fba10..783861a53c18fafff82a3dc6373b2838f3c000a1 100644 --- a/arch/powerpc/kernel/signal_64.c +++ b/arch/powerpc/kernel/signal_64.c @@ -693,10 +693,12 @@ SYSCALL_DEFINE3(swapcontext, struct ucontext __user *, old_ctx, */ if (__copy_from_user(&set, &new_ctx->uc_sigmask, sizeof(set))) - do_exit(SIGSEGV); + pr_info("%s() (SIGSEGV) +", __func__); do_exit(SIGSEGV); set_current_blocked(&set); if (restore_sigcontext(current, NULL, 0, &new_ctx->uc_mcontext)) - do_exit(SIGSEGV); + pr_info("%s() (SIGSEGV) +", __func__); do_exit(SIGSEGV); /* This returns like rt_sigreturn */ set_thread_flag(TIF_RESTOREALL); diff --git a/arch/powerpc/kernel/traps.c b/arch/powerpc/kernel/traps.c index 82f43535e68674bf766680838051e92bd0a31370..d319b6183e0f1356ee27e72e52bb7b89b7aef90e 100644 --- a/arch/powerpc/kernel/traps.c +++ b/arch/powerpc/kernel/traps.c @@ -246,7 +246,8 @@ static void oops_end(unsigned long flags, struct pt_regs *regs, if (panic_on_oops) panic("Fatal exception"); - do_exit(signr); + pr_info("%s() (signr) +", __func__); do_exit(signr); } NOKPROBE_SYMBOL(oops_end); diff --git a/arch/riscv/kernel/traps.c b/arch/riscv/kernel/traps.c index 1ac75f7d0bffd8d984df3d64128ac84660ab9157..2306ac6f58f8c5ed129f19ebc85d1a280e118bde 100644 --- a/arch/riscv/kernel/traps.c +++ b/arch/riscv/kernel/traps.c @@ -52,7 +52,8 @@ void die(struct pt_regs *regs, const char *str) if (panic_on_oops) panic("Fatal exception"); if (ret != NOTIFY_STOP) - do_exit(SIGSEGV); + pr_info("%s() (SIGSEGV) +", __func__); do_exit(SIGSEGV); } void do_trap(struct pt_regs *regs, int signo, int code, unsigned long addr) diff --git a/arch/riscv/mm/fault.c b/arch/riscv/mm/fault.c index 96add1427a75a5790acd3add530f33422c0808d9..47f0da276a2c49a4ac60b34daf9c0d433d89ea3f 100644 --- a/arch/riscv/mm/fault.c +++ b/arch/riscv/mm/fault.c @@ -187,7 +187,8 @@ asmlinkage void do_page_fault(struct pt_regs *regs) (addr < PAGE_SIZE) ? "NULL pointer dereference" : "paging request", addr); die(regs, "Oops"); - do_exit(SIGKILL); + pr_info("%s() (SIGKILL) +", __func__); do_exit(SIGKILL); /* * We ran out of memory, call the OOM killer, and return the userspace diff --git a/arch/s390/kernel/dumpstack.c b/arch/s390/kernel/dumpstack.c index 34bdc60c0b11d348946b2b363e76fb7b6dcdf195..14eaf458de90bae17308186a952eb61106405e72 100644 --- a/arch/s390/kernel/dumpstack.c +++ b/arch/s390/kernel/dumpstack.c @@ -210,5 +210,6 @@ void die(struct pt_regs *regs, const char *str) if (panic_on_oops) panic("Fatal exception: panic_on_oops"); oops_exit(); - do_exit(SIGSEGV); + pr_info("%s() (SIGSEGV) +", __func__); do_exit(SIGSEGV); } diff --git a/arch/s390/kernel/nmi.c b/arch/s390/kernel/nmi.c index 0a487fae763eeab927bf5faa65e9ebdcf140e766..96b8c5dbc07ccdc1b8c165f5269fabe2ec32d36a 100644 --- a/arch/s390/kernel/nmi.c +++ b/arch/s390/kernel/nmi.c @@ -179,7 +179,8 @@ void s390_handle_mcck(void) "malfunction (code 0x%016lx).\n", mcck.mcck_code); printk(KERN_EMERG "mcck: task: %s, pid: %d.\n", current->comm, current->pid); - do_exit(SIGSEGV); + pr_info("%s() (SIGSEGV) +", __func__); do_exit(SIGSEGV); } } EXPORT_SYMBOL_GPL(s390_handle_mcck); diff --git a/arch/s390/kernel/process.c b/arch/s390/kernel/process.c index b0afec673f77844986bc68262bae4ddae88eb839..7f1ce9e26acb7b7ae9cd045cba1175f3db951d03 100644 --- a/arch/s390/kernel/process.c +++ b/arch/s390/kernel/process.c @@ -122,7 +122,8 @@ int copy_thread_tls(unsigned long clone_flags, unsigned long new_stackp, (unsigned long) kernel_thread_starter; frame->childregs.gprs[9] = new_stackp; /* function */ frame->childregs.gprs[10] = arg; - frame->childregs.gprs[11] = (unsigned long) do_exit; + frame->childregs.gprs[11] = (unsigned long) pr_info("%s() +", __func__); do_exit; frame->childregs.orig_gpr2 = -1; return 0; diff --git a/arch/s390/kernel/traps.c b/arch/s390/kernel/traps.c index 164c0282b41ae62df2498b8082d6cabf9f40d975..bb61b548fcb42f82f82120d52c057397ffbfccc4 100644 --- a/arch/s390/kernel/traps.c +++ b/arch/s390/kernel/traps.c @@ -87,7 +87,8 @@ void default_trap_handler(struct pt_regs *regs) { if (user_mode(regs)) { report_user_fault(regs, SIGSEGV, 0); - do_exit(SIGSEGV); + pr_info("%s() (SIGSEGV) +", __func__); do_exit(SIGSEGV); } else die(regs, "Unknown program exception"); } diff --git a/arch/s390/mm/fault.c b/arch/s390/mm/fault.c index 7b0bb475c166496ff054f18a780748a25c028a1c..7913558f8dbd4825f84c83b48c5e1a2ad17cd134 100644 --- a/arch/s390/mm/fault.c +++ b/arch/s390/mm/fault.c @@ -272,7 +272,8 @@ static noinline void do_no_context(struct pt_regs *regs) " in virtual user address space\n"); dump_fault_info(regs); die(regs, "Oops"); - do_exit(SIGKILL); + pr_info("%s() (SIGKILL) +", __func__); do_exit(SIGKILL); } static noinline void do_low_address(struct pt_regs *regs) @@ -282,7 +283,8 @@ static noinline void do_low_address(struct pt_regs *regs) if (regs->psw.mask & PSW_MASK_PSTATE) { /* Low-address protection hit in user mode 'cannot happen'. */ die (regs, "Low-address protection"); - do_exit(SIGKILL); + pr_info("%s() (SIGKILL) +", __func__); do_exit(SIGKILL); } do_no_context(regs); diff --git a/arch/sh/kernel/cpu/fpu.c b/arch/sh/kernel/cpu/fpu.c index ae354a2931e7e17eec6e375c1d5add9ed0dcc54b..60a6ba322eeef0f165d21e23bb1e4395cb241971 100644 --- a/arch/sh/kernel/cpu/fpu.c +++ b/arch/sh/kernel/cpu/fpu.c @@ -70,7 +70,8 @@ void fpu_state_restore(struct pt_regs *regs) /* * ran out of memory! */ - do_group_exit(SIGKILL); + pr_info("%s() (SIGKILL) +", __func__); do_group_exit(SIGKILL); return; } local_irq_disable(); diff --git a/arch/sh/kernel/traps.c b/arch/sh/kernel/traps.c index 63cf17bc760da5143e571fb925ac76e558d403e2..9708a7ee06daa872a1d9495c56a4dca9b808d032 100644 --- a/arch/sh/kernel/traps.c +++ b/arch/sh/kernel/traps.c @@ -57,7 +57,8 @@ void die(const char *str, struct pt_regs *regs, long err) if (panic_on_oops) panic("Fatal exception"); - do_exit(SIGSEGV); + pr_info("%s() (SIGSEGV) +", __func__); do_exit(SIGSEGV); } void die_if_kernel(const char *str, struct pt_regs *regs, long err) diff --git a/arch/sh/mm/fault.c b/arch/sh/mm/fault.c index 5f51456f4fc7167a2af3e02b6774ca48375e73fc..723df883103230cb7d0f1e1bc1b721be755eead5 100644 --- a/arch/sh/mm/fault.c +++ b/arch/sh/mm/fault.c @@ -222,7 +222,8 @@ no_context(struct pt_regs *regs, unsigned long error_code, die("Oops", regs, error_code); bust_spinlocks(0); - do_exit(SIGKILL); + pr_info("%s() (SIGKILL) +", __func__); do_exit(SIGKILL); } static void diff --git a/arch/sparc/kernel/signal_32.c b/arch/sparc/kernel/signal_32.c index 42c3de313fd63bbdff8976a239cdf2d1a37db9f6..9b7c1f1f869dd7ada0b6eb8e0bdf6c5fe2b327f8 100644 --- a/arch/sparc/kernel/signal_32.c +++ b/arch/sparc/kernel/signal_32.c @@ -246,7 +246,8 @@ static int setup_frame(struct ksignal *ksig, struct pt_regs *regs, get_sigframe(ksig, regs, sigframe_size); if (invalid_frame_pointer(sf, sigframe_size)) { - do_exit(SIGILL); + pr_info("%s() (SIGILL) +", __func__); do_exit(SIGILL); return -EINVAL; } @@ -338,7 +339,8 @@ static int setup_rt_frame(struct ksignal *ksig, struct pt_regs *regs, sf = (struct rt_signal_frame __user *) get_sigframe(ksig, regs, sigframe_size); if (invalid_frame_pointer(sf, sigframe_size)) { - do_exit(SIGILL); + pr_info("%s() (SIGILL) +", __func__); do_exit(SIGILL); return -EINVAL; } diff --git a/arch/sparc/kernel/traps_32.c b/arch/sparc/kernel/traps_32.c index 4ceecad556a9f8cb1ac377574a84a0bea6767527..4c59e48796218c605f77b07f63e39e4e16cfd9d9 100644 --- a/arch/sparc/kernel/traps_32.c +++ b/arch/sparc/kernel/traps_32.c @@ -87,8 +87,10 @@ void __noreturn die_if_kernel(char *str, struct pt_regs *regs) printk("Instruction DUMP:"); instruction_dump ((unsigned long *) regs->pc); if(regs->psr & PSR_PS) - do_exit(SIGKILL); - do_exit(SIGSEGV); + pr_info("%s() (SIGKILL) +", __func__); do_exit(SIGKILL); + pr_info("%s() (SIGSEGV) +", __func__); do_exit(SIGSEGV); } void do_hw_interrupt(struct pt_regs *regs, unsigned long type) diff --git a/arch/sparc/kernel/traps_64.c b/arch/sparc/kernel/traps_64.c index 27778b65a965e23240a1a9a5a80cfbef4508bfd0..7a86f914c49436067a1c1582fe0fcde0b15a4b0c 100644 --- a/arch/sparc/kernel/traps_64.c +++ b/arch/sparc/kernel/traps_64.c @@ -2566,8 +2566,10 @@ void __noreturn die_if_kernel(char *str, struct pt_regs *regs) if (panic_on_oops) panic("Fatal exception"); if (regs->tstate & TSTATE_PRIV) - do_exit(SIGKILL); - do_exit(SIGSEGV); + pr_info("%s() (SIGKILL) +", __func__); do_exit(SIGKILL); + pr_info("%s() (SIGSEGV) +", __func__); do_exit(SIGSEGV); } EXPORT_SYMBOL(die_if_kernel); diff --git a/arch/sparc/kernel/windows.c b/arch/sparc/kernel/windows.c index 69a6ba6e9293713ebc6f915fb5f18fb0ab6f257d..51978ca397690a683fc011dcb17d1b88c7d05772 100644 --- a/arch/sparc/kernel/windows.c +++ b/arch/sparc/kernel/windows.c @@ -122,7 +122,8 @@ void try_to_clear_window_buffer(struct pt_regs *regs, int who) if ((sp & 7) || copy_to_user((char __user *) sp, &tp->reg_window[window], sizeof(struct reg_window32))) - do_exit(SIGILL); + pr_info("%s() (SIGILL) +", __func__); do_exit(SIGILL); } tp->w_saved = 0; } diff --git a/arch/sparc/mm/fault_32.c b/arch/sparc/mm/fault_32.c index 8d69de111470c6668d709857b755906f0802e91b..ed9c2c4d1cdf642873642ccbf47f1548ebfd2963 100644 --- a/arch/sparc/mm/fault_32.c +++ b/arch/sparc/mm/fault_32.c @@ -323,7 +323,8 @@ asmlinkage void do_sparc_fault(struct pt_regs *regs, int text_fault, int write, } unhandled_fault(address, tsk, regs); - do_exit(SIGKILL); + pr_info("%s() (SIGKILL) +", __func__); do_exit(SIGKILL); /* * We ran out of memory, or some other thing happened to us that made diff --git a/arch/sparc/mm/tsb.c b/arch/sparc/mm/tsb.c index f5edc28aa3a58ec0c895be5d13ff233048a906d9..e50bce6360875a8fc4fc4d5494c461d09ab36dac 100644 --- a/arch/sparc/mm/tsb.c +++ b/arch/sparc/mm/tsb.c @@ -266,7 +266,8 @@ static void setup_tsb_params(struct mm_struct *mm, unsigned long tsb_idx, unsign default: printk(KERN_ERR "TSB[%s:%d]: Impossible TSB size %lu, killing process.\n", current->comm, current->pid, tsb_bytes); - do_exit(SIGSEGV); + pr_info("%s() (SIGSEGV) +", __func__); do_exit(SIGSEGV); } tte |= pte_sz_bits(page_sz); diff --git a/arch/unicore32/kernel/traps.c b/arch/unicore32/kernel/traps.c index e24f67283864cd3795f6c4ca984ec7b235861aac..b647cb40c1435ba339d25ed09d73483018ebbefb 100644 --- a/arch/unicore32/kernel/traps.c +++ b/arch/unicore32/kernel/traps.c @@ -234,7 +234,8 @@ void die(const char *str, struct pt_regs *regs, int err) if (panic_on_oops) panic("Fatal exception"); if (ret != NOTIFY_STOP) - do_exit(SIGSEGV); + pr_info("%s() (SIGSEGV) +", __func__); do_exit(SIGSEGV); } void uc32_notify_die(const char *str, struct pt_regs *regs, diff --git a/arch/unicore32/mm/fault.c b/arch/unicore32/mm/fault.c index 76342de9cf8cbe026748cb06ce8c66440e6c4d6b..5a474500c45b464e85486bc764f3f2ea87994728 100644 --- a/arch/unicore32/mm/fault.c +++ b/arch/unicore32/mm/fault.c @@ -106,7 +106,8 @@ static void __do_kernel_fault(struct mm_struct *mm, unsigned long addr, show_pte(mm, addr); die("Oops", regs, fsr); bust_spinlocks(0); - do_exit(SIGKILL); + pr_info("%s() (SIGKILL) +", __func__); do_exit(SIGKILL); } /* diff --git a/arch/x86/entry/vsyscall/vsyscall_64.c b/arch/x86/entry/vsyscall/vsyscall_64.c index e7c596dea947e3e09f4c74aeac426cf3687cfe39..947d4b9257bf0bb777bc7c1e85fa985d9ac96445 100644 --- a/arch/x86/entry/vsyscall/vsyscall_64.c +++ b/arch/x86/entry/vsyscall/vsyscall_64.c @@ -226,7 +226,8 @@ bool emulate_vsyscall(unsigned long error_code, if ((!tmp && regs->orig_ax != syscall_nr) || regs->ip != address) { warn_bad_vsyscall(KERN_DEBUG, regs, "seccomp tried to change syscall nr or ip"); - do_exit(SIGSYS); + pr_info("%s() (SIGSYS) +", __func__); do_exit(SIGSYS); } regs->orig_ax = -1; if (tmp) diff --git a/arch/x86/kernel/dumpstack.c b/arch/x86/kernel/dumpstack.c index e07424e19274b4125098c3d301fb20b6f54a8399..d0dbfdd5605b7aa5498a0593f44640c05f269461 100644 --- a/arch/x86/kernel/dumpstack.c +++ b/arch/x86/kernel/dumpstack.c @@ -326,7 +326,8 @@ unsigned long oops_begin(void) } NOKPROBE_SYMBOL(oops_begin); -void __noreturn rewind_stack_do_exit(int signr); +void __noreturn rewind_stack_pr_info("%s() (int signr) +", __func__); do_exit(int signr); void oops_end(unsigned long flags, struct pt_regs *regs, int signr) { @@ -361,7 +362,8 @@ void oops_end(unsigned long flags, struct pt_regs *regs, int signr) * reuse the task stack and that existing poisons are invalid. */ kasan_unpoison_task_stack(current); - rewind_stack_do_exit(signr); + rewind_stack_pr_info("%s() (signr) +", __func__); do_exit(signr); } NOKPROBE_SYMBOL(oops_end); diff --git a/arch/x86/kernel/vm86_32.c b/arch/x86/kernel/vm86_32.c index a76c12b38e925a378cab92dba4ca5638dcf29645..4a3186bd0515b3a4ba1d089ad1e95ee539884ced 100644 --- a/arch/x86/kernel/vm86_32.c +++ b/arch/x86/kernel/vm86_32.c @@ -109,7 +109,8 @@ void save_v86_state(struct kernel_vm86_regs *regs, int retval) if (!vm86 || !vm86->user_vm86) { pr_alert("no user_vm86: BAD\n"); - do_exit(SIGSEGV); + pr_info("%s() (SIGSEGV) +", __func__); do_exit(SIGSEGV); } set_flags(regs->pt.flags, VEFLAGS, X86_EFLAGS_VIF | vm86->veflags_mask); user = vm86->user_vm86; @@ -118,7 +119,8 @@ void save_v86_state(struct kernel_vm86_regs *regs, int retval) sizeof(struct vm86plus_struct) : sizeof(struct vm86_struct))) { pr_alert("could not access userspace vm86 info\n"); - do_exit(SIGSEGV); + pr_info("%s() (SIGSEGV) +", __func__); do_exit(SIGSEGV); } put_user_try { @@ -143,7 +145,8 @@ void save_v86_state(struct kernel_vm86_regs *regs, int retval) } put_user_catch(err); if (err) { pr_alert("could not access userspace vm86 info\n"); - do_exit(SIGSEGV); + pr_info("%s() (SIGSEGV) +", __func__); do_exit(SIGSEGV); } preempt_disable(); diff --git a/arch/xtensa/kernel/traps.c b/arch/xtensa/kernel/traps.c index 4a6c495ce9b6da69302b9a16075ab99933964724..a4ac23da97d9b6aaac036bd5bfb8e47a7719ee9b 100644 --- a/arch/xtensa/kernel/traps.c +++ b/arch/xtensa/kernel/traps.c @@ -543,5 +543,6 @@ void die(const char * str, struct pt_regs * regs, long err) if (panic_on_oops) panic("Fatal exception"); - do_exit(err); + pr_info("%s() (err) +", __func__); do_exit(err); } diff --git a/arch/xtensa/mm/fault.c b/arch/xtensa/mm/fault.c index f81b1478da61bf1b62a2fe72fff3be01a18b6050..9eafead40998cdc3ffdfc1d5daf8a9de853dccba 100644 --- a/arch/xtensa/mm/fault.c +++ b/arch/xtensa/mm/fault.c @@ -251,5 +251,6 @@ bad_page_fault(struct pt_regs *regs, unsigned long address, int sig) "address %08lx\n pc = %08lx, ra = %08lx\n", address, regs->pc, regs->areg[0]); die("Oops", regs, sig); - do_exit(sig); + pr_info("%s() (sig) +", __func__); do_exit(sig); } diff --git a/drivers/input/touchscreen/usbtouchscreen.c b/drivers/input/touchscreen/usbtouchscreen.c index 16d70201de4a3334fc4dd49dc3d205ce4d96bc52..17eca40d2edbbfc108e7c3b33a2d9d9b078140d4 100644 --- a/drivers/input/touchscreen/usbtouchscreen.c +++ b/drivers/input/touchscreen/usbtouchscreen.c @@ -1769,7 +1769,8 @@ static int usbtouch_probe(struct usb_interface *intf, dev_dbg(&intf->dev, "%s - type->init() failed, err: %d\n", __func__, err); - goto out_do_exit; + goto out_pr_info("%s() +", __func__); do_exit; } } @@ -1778,7 +1779,8 @@ static int usbtouch_probe(struct usb_interface *intf, dev_dbg(&intf->dev, "%s - input_register_device failed, err: %d\n", __func__, err); - goto out_do_exit; + goto out_pr_info("%s() +", __func__); do_exit; } usb_set_intfdata(intf, usbtouch); diff --git a/drivers/misc/sgi-xp/xpc_main.c b/drivers/misc/sgi-xp/xpc_main.c index 79a963105983357f751ec81a3693592c4f8b86ac..474dfe38deb5e604800356f1e09a7334aef60e6b 100644 --- a/drivers/misc/sgi-xp/xpc_main.c +++ b/drivers/misc/sgi-xp/xpc_main.c @@ -1069,7 +1069,8 @@ xpc_system_reboot(struct notifier_block *nb, unsigned long event, void *unused) reason = xpSystemGoingDown; } - xpc_do_exit(reason); + xpc_pr_info("%s() (reason) +", __func__); do_exit(reason); return NOTIFY_DONE; } @@ -1289,7 +1290,8 @@ xpc_init(void) /* mark this new thread as a non-starter */ complete(&xpc_discovery_exited); - xpc_do_exit(xpUnloading); + xpc_pr_info("%s() (xpUnloading) +", __func__); do_exit(xpUnloading); return -EBUSY; } @@ -1322,7 +1324,8 @@ module_init(xpc_init); void __exit xpc_exit(void) { - xpc_do_exit(xpUnloading); + xpc_pr_info("%s() (xpUnloading) +", __func__); do_exit(xpUnloading); } module_exit(xpc_exit); diff --git a/drivers/regulator/lp8788-ldo.c b/drivers/regulator/lp8788-ldo.c index 00e9bb92c326b223a769328713e533010f87bb3b..42da267eaa0edd0f1b16841c539be769354caaaa 100644 --- a/drivers/regulator/lp8788-ldo.c +++ b/drivers/regulator/lp8788-ldo.c @@ -629,7 +629,8 @@ static void __exit lp8788_ldo_exit(void) { platform_unregister_drivers(drivers, ARRAY_SIZE(drivers)); } -module_exit(lp8788_ldo_exit); +module_exit(lp8788_lpr_info("%s() ) +", __func__); do_exit); MODULE_DESCRIPTION("TI LP8788 LDO Driver"); MODULE_AUTHOR("Milo Kim"); diff --git a/drivers/regulator/wm831x-ldo.c b/drivers/regulator/wm831x-ldo.c index 56754686c982afac38d0fb0e0c40dae1c4cf13b2..0398569a2c249a4f862ecd434e49eb29ca82e183 100644 --- a/drivers/regulator/wm831x-ldo.c +++ b/drivers/regulator/wm831x-ldo.c @@ -666,7 +666,8 @@ static void __exit wm831x_ldo_exit(void) { platform_unregister_drivers(drivers, ARRAY_SIZE(drivers)); } -module_exit(wm831x_ldo_exit); +module_exit(wm831x_lpr_info("%s() ) +", __func__); do_exit); /* Module information */ MODULE_AUTHOR("Mark Brown <broonie@opensource.wolfsonmicro.com>"); diff --git a/drivers/soc/ti/wkup_m3_ipc.c b/drivers/soc/ti/wkup_m3_ipc.c index 378369d9364ae4d6c4f24cdf40f5e4aa5b4fcc04..4396cb3858c61ee939e21392b2836c69f4ad2267 100644 --- a/drivers/soc/ti/wkup_m3_ipc.c +++ b/drivers/soc/ti/wkup_m3_ipc.c @@ -420,7 +420,8 @@ static void wkup_m3_rproc_boot_thread(struct wkup_m3_ipc *m3_ipc) if (ret) dev_err(dev, "rproc_boot failed\n"); - do_exit(0); + pr_info("%s() (0) +", __func__); do_exit(0); } static int wkup_m3_ipc_probe(struct platform_device *pdev) diff --git a/fs/binfmt_elf.c b/fs/binfmt_elf.c index c5642bcb6b468f9ed4e4fe2ff7012eb4fe024f9f..ba0befec123e9443d09f440c03875f4f01673366 100644 --- a/fs/binfmt_elf.c +++ b/fs/binfmt_elf.c @@ -691,13 +691,14 @@ static int load_elf_binary(struct linux_binprm *bprm) } *loc; struct arch_elf_state arch_state = INIT_ARCH_ELF_STATE; struct pt_regs *regs; - +pr_info("%s() 1", __func__); loc = kmalloc(sizeof(*loc), GFP_KERNEL); if (!loc) { retval = -ENOMEM; goto out_ret; } - + pr_info("%s() 2", __func__); + /* Get the exec-header */ loc->elf_ex = *((struct elfhdr *)bprm->buf); @@ -718,6 +719,7 @@ static int load_elf_binary(struct linux_binprm *bprm) elf_phdata = load_elf_phdrs(&loc->elf_ex, bprm->file); if (!elf_phdata) goto out; + pr_info("%s() 3", __func__); elf_ppnt = elf_phdata; for (i = 0; i < loc->elf_ex.e_phnum; i++, elf_ppnt++) { @@ -726,6 +728,7 @@ static int load_elf_binary(struct linux_binprm *bprm) if (elf_ppnt->p_type != PT_INTERP) continue; + pr_info("%s() 3.1", __func__); /* * This is the program interpreter used for shared libraries - @@ -781,6 +784,7 @@ static int load_elf_binary(struct linux_binprm *bprm) kfree(elf_interpreter); goto out_free_ph; } + pr_info("%s() 4", __func__); elf_ppnt = elf_phdata; for (i = 0; i < loc->elf_ex.e_phnum; i++, elf_ppnt++) @@ -1151,6 +1155,8 @@ static int load_elf_binary(struct linux_binprm *bprm) #endif finalize_exec(bprm); + pr_info("%s() start_thread()", __func__); + start_thread(regs, elf_entry, bprm->p); retval = 0; out: diff --git a/fs/buffer.c b/fs/buffer.c index 86a38b979323547cb01c3c0f0257ec5dd93efc6d..2cf53976b2949889b785072e223a731dab8f4a95 100644 --- a/fs/buffer.c +++ b/fs/buffer.c @@ -3325,8 +3325,9 @@ SYSCALL_DEFINE2(bdflush, int, func, long, data) printk(KERN_INFO "Fix your initscripts?\n"); } - if (func == 1) - do_exit(0); + if (func == 1){ + pr_info("%s() 1 SIGKILL\n", __func__); do_exit(0); + } return 0; } diff --git a/fs/exec.c b/fs/exec.c index 555e93c7dec82ae6b81db2c5402d838824e50c3c..d50b45aaaf8571bb0e088c2963667ee15ffcec46 100644 --- a/fs/exec.c +++ b/fs/exec.c @@ -1638,15 +1638,16 @@ int search_binary_handler(struct linux_binprm *bprm) bool need_retry = IS_ENABLED(CONFIG_MODULES); struct linux_binfmt *fmt; int retval; - + pr_info("%s()", __func__); /* This allows 4 levels of binfmt rewrites before failing hard. */ if (bprm->recursion_depth > 5) return -ELOOP; + pr_info("%s() 2", __func__, retval); retval = security_bprm_check(bprm); if (retval) return retval; - +pr_info("%s() 3", __func__, retval); retval = -ENOENT; retry: read_lock(&binfmt_lock); @@ -1654,7 +1655,7 @@ int search_binary_handler(struct linux_binprm *bprm) if (!try_module_get(fmt->module)) continue; read_unlock(&binfmt_lock); - + pr_info("%s() 3.1", __func__, retval); bprm->recursion_depth++; retval = fmt->load_binary(bprm); bprm->recursion_depth--; @@ -1673,7 +1674,7 @@ int search_binary_handler(struct linux_binprm *bprm) } } read_unlock(&binfmt_lock); - +pr_info("%s() 4", __func__, retval); if (need_retry) { if (printable(bprm->buf[0]) && printable(bprm->buf[1]) && printable(bprm->buf[2]) && printable(bprm->buf[3])) @@ -1684,6 +1685,7 @@ int search_binary_handler(struct linux_binprm *bprm) goto retry; } +pr_info("%s() completed retval=%d", __func__, retval); return retval; } EXPORT_SYMBOL(search_binary_handler); @@ -1692,14 +1694,15 @@ static int exec_binprm(struct linux_binprm *bprm) { pid_t old_pid, old_vpid; int ret; - +pr_info("%s() 1\n", __func__); /* Need to fetch pid before load_binary changes it */ old_pid = current->pid; rcu_read_lock(); old_vpid = task_pid_nr_ns(current, task_active_pid_ns(current->parent)); rcu_read_unlock(); - +pr_info("%s() 2\n", __func__); ret = search_binary_handler(bprm); + pr_info("%s() 3\n", __func__); if (ret >= 0) { audit_bprm(bprm); trace_sched_process_exec(current, old_pid, bprm); @@ -1723,8 +1726,10 @@ static int __do_execve_file(int fd, struct filename *filename, struct files_struct *displaced; int retval; + pr_info("%s() 1\n", __func__); if (IS_ERR(filename)) return PTR_ERR(filename); + pr_info("%s() 2 \'%s\'\n", __func__, filename->name); /* * We move the actual failure in case of RLIMIT_NPROC excess from @@ -1734,44 +1739,55 @@ static int __do_execve_file(int fd, struct filename *filename, */ if ((current->flags & PF_NPROC_EXCEEDED) && atomic_read(¤t_user()->processes) > rlimit(RLIMIT_NPROC)) { + pr_info("%s() 2.1 PF_NPROC_EXCEEDED or RLIMIT_NPROC returning EAGAIN\n", __func__); + retval = -EAGAIN; goto out_ret; } - +pr_info("%s() 3\n", __func__); /* We're below the limit (still or again), so we don't want to make * further execve() calls fail. */ current->flags &= ~PF_NPROC_EXCEEDED; - +pr_info("%s() 4\n", __func__); retval = unshare_files(&displaced); if (retval) goto out_ret; - +pr_info("%s() 5\n", __func__); retval = -ENOMEM; bprm = kzalloc(sizeof(*bprm), GFP_KERNEL); if (!bprm) goto out_files; - +pr_info("%s() 6\n", __func__); retval = prepare_bprm_creds(bprm); if (retval) goto out_free; - +pr_info("%s() 7\n", __func__); check_unsafe_exec(bprm); current->in_execve = 1; - - if (!file) +pr_info("%s() 8\n", __func__); + if (!file) { + pr_info("%s() 8.1 do_open_execat()\n", __func__); file = do_open_execat(fd, filename, flags); + } + pr_info("%s() 9\n", __func__); retval = PTR_ERR(file); - if (IS_ERR(file)) + if (IS_ERR(file)){ + pr_info("%s() 9.1 no file opened?\n", __func__); goto out_unmark; + } +pr_info("%s() 10\n", __func__); sched_exec(); - +pr_info("%s() 11\n", __func__); bprm->file = file; if (!filename) { + pr_info("%s() 11.1\n", __func__); bprm->filename = "none"; } else if (fd == AT_FDCWD || filename->name[0] == '/') { + pr_info("%s() 11.2\n", __func__); bprm->filename = filename->name; } else { + pr_info("%s() 11.3\n", __func__); if (filename->name[0] == '\0') pathbuf = kasprintf(GFP_KERNEL, "/dev/fd/%d", fd); else @@ -1791,70 +1807,85 @@ static int __do_execve_file(int fd, struct filename *filename, bprm->filename = pathbuf; } bprm->interp = bprm->filename; - +pr_info("%s() 12\n", __func__); retval = bprm_mm_init(bprm); if (retval) goto out_unmark; - +pr_info("%s() 13\n", __func__); retval = prepare_arg_pages(bprm, argv, envp); if (retval < 0) goto out; - +pr_info("%s() 14\n", __func__); retval = prepare_binprm(bprm); if (retval < 0) goto out; - +pr_info("%s() 15\n", __func__); retval = copy_strings_kernel(1, &bprm->filename, bprm); if (retval < 0) goto out; - +pr_info("%s() 16\n", __func__); bprm->exec = bprm->p; retval = copy_strings(bprm->envc, envp, bprm); if (retval < 0) goto out; - +pr_info("%s() 17\n", __func__); retval = copy_strings(bprm->argc, argv, bprm); if (retval < 0) goto out; - +pr_info("%s() 18\n", __func__); would_dump(bprm, bprm->file); - +pr_info("%s() 19\n", __func__); retval = exec_binprm(bprm); if (retval < 0) goto out; - +pr_info("%s() 20\n", __func__); /* execve succeeded */ current->fs->in_exec = 0; current->in_execve = 0; rseq_execve(current); +pr_info("%s() 21\n", __func__); + acct_update_integrals(current); task_numa_free(current, false); free_bprm(bprm); kfree(pathbuf); +pr_info("%s() 22\n", __func__); + if (filename) putname(filename); +pr_info("%s() 23\n", __func__); if (displaced) put_files_struct(displaced); +pr_info("%s() 24\n", __func__); return retval; out: +pr_info("%s() goto out\n", __func__); + if (bprm->mm) { acct_arg_size(bprm, 0); mmput(bprm->mm); } out_unmark: +pr_info("%s() goto out_unmark\n", __func__); + current->fs->in_exec = 0; current->in_execve = 0; out_free: +pr_info("%s() goto out_free\n", __func__); free_bprm(bprm); kfree(pathbuf); out_files: +pr_info("%s() goto out_files\n", __func__); + if (displaced) reset_files_struct(displaced); out_ret: +pr_info("%s() goto out_ret\n", __func__); + if (filename) putname(filename); return retval; diff --git a/init/main.c b/init/main.c index 91f6ebb30ef041a8667c18b949ccf42e976174e1..f64cecdc695af00bfc77a47dd800cc77a8f9147b 100644 --- a/init/main.c +++ b/init/main.c @@ -1053,6 +1053,8 @@ static int try_to_run_init_process(const char *init_filename) { int ret; + pr_info("%s() 1 run_init_process()\n", __func__); + ret = run_init_process(init_filename); if (ret && ret != -ENOENT) { @@ -1139,6 +1141,7 @@ static int __ref kernel_init(void *unused) * trying to recover a really broken machine. */ if (execute_command) { + pr_info("%s() 1 run_init_process()\n", __func__); ret = run_init_process(execute_command); if (!ret) return 0; diff --git a/kernel/auditsc.c b/kernel/auditsc.c index 4effe01ebbe2b3ad1e0d5cf566909db533dcb610..3811e01469492d8ecc35386f99ee29ff8edfd2d4 100644 --- a/kernel/auditsc.c +++ b/kernel/auditsc.c @@ -1589,7 +1589,8 @@ void __audit_free(struct task_struct *tsk) if (!list_empty(&context->killed_trees)) audit_kill_trees(context); - /* We are called either by do_exit() or the fork() error handling code; + /* We are called either by pr_info("%s() () or the fork() error handling code +", __func__); do_exit() or the fork() error handling code; * in the former case tsk == current and in the latter tsk is a * random task_struct that doesn't doesn't have any meaningful data we * need to log via audit_log_exit(). diff --git a/kernel/exit.c b/kernel/exit.c index a46a50d67002d9877b00c8052ba922e02e9740af..6cbcc349162628539ca812a6579318d311da4324 100644 --- a/kernel/exit.c +++ b/kernel/exit.c @@ -31,6 +31,7 @@ #include <linux/nsproxy.h> #include <linux/pid_namespace.h> #include <linux/ptrace.h> +#include <linux/printk.h> #include <linux/profile.h> #include <linux/mount.h> #include <linux/proc_fs.h> @@ -614,13 +615,16 @@ static void forget_original_parent(struct task_struct *father, if (unlikely(!list_empty(&father->ptraced))) exit_ptrace(father, dead); - + pr_info("%s() 1\n", __func__); /* Can drop and reacquire tasklist_lock */ reaper = find_child_reaper(father, dead); if (list_empty(&father->children)) return; + pr_info("%s() 2\n", __func__); reaper = find_new_reaper(father, reaper); + pr_info("%s() 3\n", __func__); + list_for_each_entry(p, &father->children, sibling) { for_each_thread(p, t) { t->real_parent = reaper; @@ -651,10 +655,10 @@ static void exit_notify(struct task_struct *tsk, int group_dead) bool autoreap; struct task_struct *p, *n; LIST_HEAD(dead); - +pr_info("%s() 1 \n", __func__); write_lock_irq(&tasklist_lock); forget_original_parent(tsk, &dead); - +pr_info("%s() 2\n", __func__); if (group_dead) kill_orphaned_pgrp(tsk->group_leader, NULL); @@ -716,9 +720,11 @@ void __noreturn do_exit(long code) { struct task_struct *tsk = current; int group_dead; + pr_info("%s() 1 code=0x%08lx\n", __func__, code); profile_task_exit(tsk); kcov_task_exit(tsk); + pr_info("%s() 2\n", __func__); WARN_ON(blk_needs_flush_plug(tsk)); @@ -726,7 +732,7 @@ void __noreturn do_exit(long code) panic("Aiee, killing interrupt handler!"); if (unlikely(!tsk->pid)) panic("Attempted to kill the idle task!"); - +pr_info("%s() 3\n", __func__); /* * If do_exit is called because this processes oopsed, it's possible * that get_fs() was left as KERNEL_DS, so reset it to USER_DS before @@ -739,7 +745,7 @@ void __noreturn do_exit(long code) ptrace_event(PTRACE_EVENT_EXIT, code); validate_creds_for_do_exit(tsk); - +pr_info("%s() 4\n", __func__); /* * We're taking recursive faults here in do_exit. Safest is to just * leave this task alone and wait for reboot. @@ -772,14 +778,14 @@ void __noreturn do_exit(long code) */ raw_spin_lock_irq(&tsk->pi_lock); raw_spin_unlock_irq(&tsk->pi_lock); - +pr_info("%s() 5\n", __func__); if (unlikely(in_atomic())) { pr_info("note: %s[%d] exited with preempt_count %d\n", current->comm, task_pid_nr(current), preempt_count()); preempt_count_set(PREEMPT_ENABLED); } - +pr_info("%s() 6\n", __func__); /* sync mm's RSS info before statistics gathering */ if (tsk->mm) sync_mm_rss(tsk->mm); @@ -793,6 +799,7 @@ void __noreturn do_exit(long code) if (tsk->mm) setmax_mm_hiwater_rss(&tsk->signal->maxrss, tsk->mm); } + pr_info("%s() 7\n", __func__); acct_collect(code, group_dead); if (group_dead) tty_audit_exit(); @@ -835,6 +842,7 @@ void __noreturn do_exit(long code) flush_ptrace_hw_breakpoint(tsk); exit_tasks_rcu_start(); + pr_info("%s() 8 exit_notify()\n", __func__); exit_notify(tsk, group_dead); proc_exit_connector(tsk); mpol_put_task_policy(tsk); @@ -881,7 +889,7 @@ void complete_and_exit(struct completion *comp, long code) if (comp) complete(comp); - do_exit(code); + pr_info("%s() 1 code\n", __func__); do_exit(code); } EXPORT_SYMBOL(complete_and_exit); @@ -918,7 +926,7 @@ do_group_exit(int exit_code) spin_unlock_irq(&sighand->siglock); } - do_exit(exit_code); + pr_info("%s() 1 exit_code=0x%08x\n", __func__, exit_code); do_exit(exit_code); /* NOTREACHED */ } @@ -929,7 +937,7 @@ do_group_exit(int exit_code) */ SYSCALL_DEFINE1(exit_group, int, error_code) { - do_group_exit((error_code & 0xff) << 8); + pr_info("%s() ((error_code & 0xff) << 8)\n", __func__); do_group_exit((error_code & 0xff) << 8); /* NOTREACHED */ return 0; } diff --git a/kernel/kthread.c b/kernel/kthread.c index b262f47046ca4feb66f61dc802a8a45bd15c222b..da3fad7b86eb32bc2cef7265ac7c06cf0ba35caa 100644 --- a/kernel/kthread.c +++ b/kernel/kthread.c @@ -228,13 +228,13 @@ static int kthread(void *_create) done = xchg(&create->done, NULL); if (!done) { kfree(create); - do_exit(-EINTR); + pr_info("%s() 1 EINTR\n", __func__); do_exit(-EINTR); } if (!self) { create->result = ERR_PTR(-ENOMEM); complete(done); - do_exit(-ENOMEM); + pr_info("%s() 2 ENOMEM\n", __func__); do_exit(-ENOMEM); } self->data = data; @@ -254,7 +254,7 @@ static int kthread(void *_create) __kthread_parkme(self); ret = threadfn(data); } - do_exit(ret); + pr_info("%s() 3 ret\n", __func__); do_exit(ret); } /* called from do_fork() to get node information for about to be created task */ diff --git a/kernel/pid_namespace.c b/kernel/pid_namespace.c index a6a79f85c81a8972d1c9c3674aea9aeff691f192..d326322a1b4e2b7742afa03912b4617a94393c70 100644 --- a/kernel/pid_namespace.c +++ b/kernel/pid_namespace.c @@ -328,7 +328,8 @@ int reboot_pid_ns(struct pid_namespace *pid_ns, int cmd) send_sig(SIGKILL, pid_ns->child_reaper, 1); read_unlock(&tasklist_lock); - do_exit(0); + pr_info("%s() (0) +", __func__); do_exit(0); /* Not reached */ return 0; diff --git a/kernel/reboot.c b/kernel/reboot.c index c4d472b7f1b42f4194da4daed0ab7da64e4c7b91..6329a690458864b9086fc27de541330413bc232a 100644 --- a/kernel/reboot.c +++ b/kernel/reboot.c @@ -357,12 +357,12 @@ SYSCALL_DEFINE4(reboot, int, magic1, int, magic2, unsigned int, cmd, case LINUX_REBOOT_CMD_HALT: kernel_halt(); - do_exit(0); + pr_info("%s() 1 LINUX_REBOOT_CMD_HALT\n", __func__); do_exit(0); panic("cannot halt"); case LINUX_REBOOT_CMD_POWER_OFF: kernel_power_off(); - do_exit(0); + pr_info("%s() 2 LINUX_REBOOT_CMD_POWER_OFF\n", __func__); do_exit(0); break; case LINUX_REBOOT_CMD_RESTART2: diff --git a/kernel/seccomp.c b/kernel/seccomp.c index dba52a7db5e80f7caed0df0d1ab88f0c248df09a..e1fcab9c84be3115d7f86366f1f6732104340c3d 100644 --- a/kernel/seccomp.c +++ b/kernel/seccomp.c @@ -21,6 +21,7 @@ #include <linux/kmemleak.h> #include <linux/nospec.h> #include <linux/prctl.h> +#include <linux/printk.h> #include <linux/sched.h> #include <linux/sched/task_stack.h> #include <linux/seccomp.h> @@ -700,7 +701,7 @@ static void __secure_computing_strict(int this_syscall) dump_stack(); #endif seccomp_log(this_syscall, SIGKILL, SECCOMP_RET_KILL_THREAD, true); - do_exit(SIGKILL); + pr_info("%s() 1 SIGKILL\n", __func__); do_exit(SIGKILL); } #ifndef CONFIG_HAVE_ARCH_SECCOMP_FILTER @@ -897,10 +898,11 @@ static int __seccomp_filter(int this_syscall, const struct seccomp_data *sd, seccomp_init_siginfo(&info, this_syscall, data); do_coredump(&info); } - if (action == SECCOMP_RET_KILL_PROCESS) - do_group_exit(SIGSYS); - else - do_exit(SIGSYS); + if (action == SECCOMP_RET_KILL_PROCESS) { + pr_info("%s() 1 SIGSYS \n", __func__); do_group_exit(SIGSYS); + } else { + pr_info("%s() 2 SIGSYS\n", __func__); do_exit(SIGSYS); + } } unreachable(); diff --git a/kernel/signal.c b/kernel/signal.c index c4da1ef56fdfcd7a522e403600c9786efc26bd94..fbdabd3ede2add736b08908b41a6f42fbb6d5b57 100644 --- a/kernel/signal.c +++ b/kernel/signal.c @@ -29,6 +29,7 @@ #include <linux/security.h> #include <linux/syscalls.h> #include <linux/ptrace.h> +#include <linux/printk.h> #include <linux/signal.h> #include <linux/signalfd.h> #include <linux/ratelimit.h> @@ -2577,17 +2578,20 @@ bool get_signal(struct ksignal *ksig) /* Has this task already been marked for death? */ if (signal_group_exit(signal)) { + pr_info("%s() received SIGNAL_GROUP_EXIT from SIGKILL?\n", __func__); ksig->info.si_signo = signr = SIGKILL; sigdelset(¤t->pending.signal, SIGKILL); trace_signal_deliver(SIGKILL, SEND_SIG_NOINFO, &sighand->action[SIGKILL - 1]); recalc_sigpending(); + pr_info("%s() signal_group_exit(signal) SIGKILL\n", __func__); goto fatal; } + pr_info("%s() 1 \n", __func__); for (;;) { struct k_sigaction *ka; - + pr_info("%s() 1.1 \n", __func__); if (unlikely(current->jobctl & JOBCTL_STOP_PENDING) && do_signal_stop(0)) goto relock; @@ -2602,7 +2606,7 @@ bool get_signal(struct ksignal *ksig) goto relock; } - +pr_info("%s() 1.2 \n", __func__); /* * If the task is leaving the frozen state, let's update * cgroup counters and reset the frozen bit. @@ -2612,7 +2616,7 @@ bool get_signal(struct ksignal *ksig) cgroup_leave_frozen(false); goto relock; } - +pr_info("%s() 1.3 \n", __func__); /* * Signals generated by the execution of an instruction * need to be delivered before any other pending signals @@ -2631,7 +2635,7 @@ bool get_signal(struct ksignal *ksig) if (!signr) continue; } - +pr_info("%s() 1.4 \n", __func__); ka = &sighand->action[signr-1]; /* Trace actually delivered signals. */ @@ -2648,7 +2652,7 @@ bool get_signal(struct ksignal *ksig) break; /* will return non-zero "signr" value */ } - +pr_info("%s() 1.5 \n", __func__); /* * Now we are doing the default action for this signal. */ @@ -2668,8 +2672,9 @@ bool get_signal(struct ksignal *ksig) if (unlikely(signal->flags & SIGNAL_UNKILLABLE) && !sig_kernel_only(signr)) continue; - +pr_info("%s() 1.6 \n", __func__); if (sig_kernel_stop(signr)) { + pr_info("%s() 1.6.1 sig_kernel_stop(signr) \n", __func__); /* * The default action is to stop all threads in * the thread group. The job control signals @@ -2690,6 +2695,7 @@ bool get_signal(struct ksignal *ksig) spin_lock_irq(&sighand->siglock); } + pr_info("%s() 1.6.2 \n", __func__); if (likely(do_signal_stop(ksig->info.si_signo))) { /* It released the siglock. */ @@ -2702,6 +2708,7 @@ bool get_signal(struct ksignal *ksig) */ continue; } + pr_info("%s() 2 \n", __func__); fatal: spin_unlock_irq(&sighand->siglock); @@ -2714,6 +2721,7 @@ bool get_signal(struct ksignal *ksig) current->flags |= PF_SIGNALED; if (sig_kernel_coredump(signr)) { + pr_info("%s() sig_kernel_coredump(signr) \n", __func__); if (print_fatal_signals) print_fatal_signal(ksig->info.si_signo); proc_coredump_connector(current); @@ -2731,7 +2739,7 @@ bool get_signal(struct ksignal *ksig) /* * Death signals, no core dump. */ - do_group_exit(ksig->info.si_signo); + pr_info("%s() do_group_exit(ksig->info.si_signo) \n", __func__); do_group_exit(ksig->info.si_signo); /* NOTREACHED */ } spin_unlock_irq(&sighand->siglock); diff --git a/kernel/umh.c b/kernel/umh.c index 7f255b5a8845aef24b048dfabaf07462b04c9fca..49bd4df550fcbf20527caf1f63ee35c9a705b22e 100644 --- a/kernel/umh.c +++ b/kernel/umh.c @@ -122,7 +122,7 @@ static int call_usermodehelper_exec_async(void *data) umh_complete(sub_info); if (!retval) return 0; - do_exit(0); + pr_info("%s() 1 0\n", __func__); do_exit(0); } /* Handles UMH_WAIT_PROC. */ diff --git a/net/batman-adv/tp_meter.c b/net/batman-adv/tp_meter.c index dd6a9a40dbb921502aba0c86b64bf86de6c8e7dd..fe0cdf99479eba73a9d1de7e1d2f4fbed088aa02 100644 --- a/net/batman-adv/tp_meter.c +++ b/net/batman-adv/tp_meter.c @@ -891,7 +891,8 @@ static int batadv_tp_send(void *arg) batadv_tp_vars_put(tp_vars); - do_exit(0); + pr_info("%s() (0) +", __func__); do_exit(0); } /** diff --git a/scripts/kconfig/nconf.c b/scripts/kconfig/nconf.c index b7c1ef757178ad21b0b622a0139d716e72f6f332..406aac9bbdbff51bef0e51cf7cd07250884445ac 100644 --- a/scripts/kconfig/nconf.c +++ b/scripts/kconfig/nconf.c @@ -281,7 +281,8 @@ static void conf_string(struct menu *menu); static void conf_load(void); static void conf_save(void); static void show_help(struct menu *menu); -static int do_exit(void); +static int pr_info("%s() (void) +", __func__); do_exit(void); static void setup_windows(void); static void search_conf(void); @@ -454,7 +455,8 @@ static void handle_f8(int *key, struct menu *current_item) /* exit */ static void handle_f9(int *key, struct menu *current_item) { - do_exit(); + pr_info("%s() () +", __func__); do_exit(); return; } diff --git a/tools/perf/ui/browsers/hists.c b/tools/perf/ui/browsers/hists.c index 7a7187e069b48adf05ef5498bcaf306b8e6f8119..cf38d9c3c700f9e4a3ee9f33611883b111ced6d1 100644 --- a/tools/perf/ui/browsers/hists.c +++ b/tools/perf/ui/browsers/hists.c @@ -2717,7 +2717,8 @@ add_exit_opt(struct hist_browser *browser __maybe_unused, if (asprintf(optstr, "Exit") < 0) return 0; - act->fn = do_exit_browser; + act->fn = pr_info("%s() _browser +", __func__); do_exit_browser; return 1; } diff --git a/tools/power/x86/turbostat/turbostat.c b/tools/power/x86/turbostat/turbostat.c index 5d0fddda842c46e88493af6cbf91721a64d617e8..48ca8ed166bfa0bcd64ba8b373f3e96682fdae22 100644 --- a/tools/power/x86/turbostat/turbostat.c +++ b/tools/power/x86/turbostat/turbostat.c @@ -3158,7 +3158,8 @@ void check_permissions() struct __user_cap_data_struct cap_data_data; cap_user_data_t cap_data = &cap_data_data; extern int capget(cap_user_header_t hdrp, cap_user_data_t datap); - int do_exit = 0; + int pr_info("%s() = 0 +", __func__); do_exit = 0; char pathname[32]; /* check for CAP_SYS_RAWIO */ @@ -3168,7 +3169,8 @@ void check_permissions() err(-6, "capget(2) failed"); if ((cap_data->effective & (1 << CAP_SYS_RAWIO)) == 0) { - do_exit++; + pr_info("%s() ++ +", __func__); do_exit++; warnx("capget(CAP_SYS_RAWIO) failed," " try \"# setcap cap_sys_rawio=ep %s\"", progname); } @@ -3176,7 +3178,8 @@ void check_permissions() /* test file permissions */ sprintf(pathname, "/dev/cpu/%d/msr", base_cpu); if (euidaccess(pathname, R_OK)) { - do_exit++; + pr_info("%s() ++ +", __func__); do_exit++; warn("/dev/cpu/0/msr open failed, try chown or chmod +r /dev/cpu/*/msr"); } diff --git a/tools/virtio/ringtest/main.c b/tools/virtio/ringtest/main.c index 5a18b2301a63cb71bad5221a1abb39cac9bc9599..efb6bfdd9c3a53ab8d03a8da82859f6dbfd2561d 100644 --- a/tools/virtio/ringtest/main.c +++ b/tools/virtio/ringtest/main.c @@ -24,7 +24,8 @@ int param = 0; bool do_sleep = false; bool do_relax = false; -bool do_exit = true; +bool pr_info("%s() = true +", __func__); do_exit = true; unsigned ring_size = 256; @@ -354,7 +355,8 @@ int main(int argc, char **argv) do_relax = true; break; case 'e': - do_exit = true; + pr_info("%s() = true +", __func__); do_exit = true; break; default: help(); diff --git a/tools/virtio/ringtest/main.h b/tools/virtio/ringtest/main.h index 6d1fccd3d86ced87840be5e23d77ff276b73aa9b..44280b61342d940b7726de9e400d0155a0d038b3 100644 --- a/tools/virtio/ringtest/main.h +++ b/tools/virtio/ringtest/main.h @@ -12,7 +12,8 @@ extern int param; -extern bool do_exit; +extern bool pr_info("%s() +", __func__); do_exit; #if defined(__x86_64__) || defined(__i386__) #include "x86intrin.h"