From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754321AbbGPIr4 (ORCPT ); Thu, 16 Jul 2015 04:47:56 -0400 Received: from mx1.redhat.com ([209.132.183.28]:33281 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754702AbbGPIrw (ORCPT ); Thu, 16 Jul 2015 04:47:52 -0400 From: Baoquan He To: linux-kernel@vger.kernel.org, ncroxon@redhat.com, dyoung@redhat.com, mhuang@redhat.com Cc: Baoquan He Subject: [RHEL6.8 Patch 3/3] vmcore: continue vmcore initialization if PT_NOTE is found empty Date: Thu, 16 Jul 2015 16:47:01 +0800 Message-Id: <1437036437-25408-7-git-send-email-bhe@redhat.com> In-Reply-To: <1437036437-25408-1-git-send-email-bhe@redhat.com> References: <1437036437-25408-1-git-send-email-bhe@redhat.com> Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 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 Cc: Vivek Goyal Cc: HATAYAMA Daisuke Cc: Greg Pearson Cc: Baoquan He Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds Signed-off-by: Baoquan He --- 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