Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753498AbcKIAob (ORCPT ); Tue, 8 Nov 2016 19:44:31 -0500 Received: from mail-wm0-f43.google.com ([74.125.82.43]:36374 "EHLO mail-wm0-f43.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751662AbcKIAo3 (ORCPT ); Tue, 8 Nov 2016 19:44:29 -0500 MIME-Version: 1.0 In-Reply-To: <1478312159-32968-1-git-send-email-lipengcheng8@huawei.com> References: <1478312159-32968-1-git-send-email-lipengcheng8@huawei.com> From: Kees Cook Date: Tue, 8 Nov 2016 16:44:27 -0800 X-Google-Sender-Auth: GzNIGiegLyPVuWpGrfan2dZ4VLA Message-ID: Subject: Re: [PATCH] pstore/dump: solution pstore data abort. To: Li Pengcheng Cc: Anton Vorontsov , Colin Cross , Tony Luck , LKML , liuhailong5@huawei.com, lizhong11@hisilicon.com, liuyongfu@hisilicon.com, dan.zhao@hisilicon.com, suzhuangluan@hisilicon.com Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1063 Lines: 33 On Fri, Nov 4, 2016 at 7:15 PM, Li Pengcheng wrote: > If not return,data abort will happen > when two threads call pstore_dump at the same time. > > Signed-off-by: Liu Hailong > Signed-off-by: Li Pengcheng > Signed-off-by: Li Zhong > --- > fs/pstore/platform.c | 1 + > 1 file changed, 1 insertion(+) > > diff --git a/fs/pstore/platform.c b/fs/pstore/platform.c > index 14984d9..60e6db6 100644 > --- a/fs/pstore/platform.c > +++ b/fs/pstore/platform.c > @@ -493,6 +493,7 @@ static void pstore_dump(struct kmsg_dumper *dumper, > if (!is_locked) { > pr_err("pstore dump routine blocked in %s path, may corrupt error record\n" > , in_nmi() ? "NMI" : why); > + return; > } > } else { > spin_lock_irqsave(&psinfo->buf_lock, flags); > -- > 1.9.1 Ah, thanks! I've queued this for -next. -Kees -- Kees Cook Nexus Security