mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-30 03:27:44 -04:00
do_coredump: fix the "ispipe" error check
do_coredump() assumes that if format_corename() fails it should return -ENOMEM. This is not true, for example cn_print_exe_file() can propagate the error from d_path. Even if it was true, this is too fragile. Change the code to check "ispipe < 0". Signed-off-by: Oleg Nesterov <[email protected]> Signed-off-by: Jiri Slaby <[email protected]> Reviewed-by: Neil Horman <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
This commit is contained in:
parent
2c563731fe
commit
99b6456748
1 changed files with 6 additions and 6 deletions
12
fs/exec.c
12
fs/exec.c
|
|
@ -2133,16 +2133,16 @@ void do_coredump(long signr, int exit_code, struct pt_regs *regs)
|
|||
|
||||
ispipe = format_corename(&cn, signr);
|
||||
|
||||
if (ispipe == -ENOMEM) {
|
||||
printk(KERN_WARNING "format_corename failed\n");
|
||||
printk(KERN_WARNING "Aborting core\n");
|
||||
goto fail_corename;
|
||||
}
|
||||
|
||||
if (ispipe) {
|
||||
int dump_count;
|
||||
char **helper_argv;
|
||||
|
||||
if (ispipe < 0) {
|
||||
printk(KERN_WARNING "format_corename failed\n");
|
||||
printk(KERN_WARNING "Aborting core\n");
|
||||
goto fail_corename;
|
||||
}
|
||||
|
||||
if (cprm.limit == 1) {
|
||||
/*
|
||||
* Normally core limits are irrelevant to pipes, since
|
||||
|
|
|
|||
Loading…
Reference in a new issue