Resolves: bz1236437 https://bugzilla.redhat.com/show_bug.cgi?id=1236437
Brew build: https://brewweb.devel.redhat.com/taskinfo?taskID=9499237 This is back ported from upstream. This commit relies on commit "vmcore: prevent PT_NOTE p_memsz overflow during header update". commit c4082f36fa3eeb5d4fadc50241b6e3a388561f80 Author: WANG Chao <[email protected]> Date: Mon Apr 7 15:38:51 2014 -0700 vmcore: continue vmcore initialization if PT_NOTE is found empty Currently when an empty PT_NOTE is detected, vmcore initialization fails. It sounds too harsh. Because PT_NOTE could be empty, for example, one offlined a cpu but never restarted kdump service, and after crash, PT_NOTE program header is there but no data contains. It's better to warn about the empty PT_NOTE and continue to initialise vmcore. And ultimately the multiple PT_NOTE are merged into a single one, all empty PT_NOTE are discarded naturally during the merge. So empty PT_NOTE is not visible to user space and vmcore is as good as expected. Signed-off-by: WANG Chao <[email protected]> Cc: Vivek Goyal <[email protected]> Cc: HATAYAMA Daisuke <[email protected]> Cc: Greg Pearson <[email protected]> Cc: Baoquan He <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]> Signed-off-by: Baoquan He <[email protected]> --- fs/proc/vmcore.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/fs/proc/vmcore.c b/fs/proc/vmcore.c index 97c950b..ecc7604 100644 --- a/fs/proc/vmcore.c +++ b/fs/proc/vmcore.c @@ -260,7 +260,6 @@ static int __init merge_note_headers_elf64(char *elfptr, size_t *elfsz, kfree(notes_section); if (real_sz == 0) { pr_warn("Warning: Zero PT_NOTE entries found\n"); - return -EINVAL; } } @@ -347,7 +346,6 @@ static int __init merge_note_headers_elf32(char *elfptr, size_t *elfsz, kfree(notes_section); if (real_sz == 0) { pr_warn("Warning: Zero PT_NOTE entries found\n"); - return -EINVAL; } } -- 2.1.0 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/

