From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.0 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI, SIGNED_OFF_BY,SPF_PASS autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 968EBC43381 for ; Mon, 1 Apr 2019 10:33:11 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 5F89A20693 for ; Mon, 1 Apr 2019 10:33:11 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="RNWyY7f6" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 5F89A20693 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=huawei.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+infradead-linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender:Content-Type: Content-Transfer-Encoding:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:Date:Message-ID:From: References:To:Subject:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=VvzGc0pZM6Z7pWFH6hRYwDL0cxUMiBLvmMvFHGJA+2E=; b=RNWyY7f6Uk/tWnSXgtiTHrIZi lYBLLcKJQi0ItkTaWIor//rHppE5CFDgQv4n7ZgWTj9jik30J6NkMSEG6Kg/GXx1kW7MMMCMZdHQU uN+mxc3Y1mzDf+Kwd8sR0o9MRRlfsHkr+wj0eYfq/A/s63eHchZOk/J7+WSBVJYPU/0Ie1s7rhz5N rhbzOTNNOMNO55CnTsbESD041kxmpVptap5t5BgMUY52/pgM+shQmiU5aeF3Ph3+F7isnKGOSSSWZ oEGmfk+XoYAgdtkwSeiLEwCol0O86wrsQEBVVHUP95DiFTbNhp5xiwC+2JDMIw4dT6q2/9rPddCzi 0aS1B98Tg==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1hAuFW-0004sW-TV; Mon, 01 Apr 2019 10:33:06 +0000 Received: from szxga07-in.huawei.com ([45.249.212.35] helo=huawei.com) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1hAuFS-0004rz-Cv for linux-arm-kernel@lists.infradead.org; Mon, 01 Apr 2019 10:33:05 +0000 Received: from DGGEMS414-HUB.china.huawei.com (unknown [172.30.72.58]) by Forcepoint Email with ESMTP id 52C541AD0D3BB02EE928; Mon, 1 Apr 2019 18:32:56 +0800 (CST) Received: from [127.0.0.1] (10.177.31.55) by DGGEMS414-HUB.china.huawei.com (10.3.19.214) with Microsoft SMTP Server id 14.3.408.0; Mon, 1 Apr 2019 18:32:48 +0800 Subject: Re: [PATCH] arm64: fix wrong check of on_sdei_stack in nmi context To: Wei Li , , , , , , References: <20190401035557.22191-1-liwei391@huawei.com> From: Heyi Guo Message-ID: <69846aa4-ef2e-6124-b39d-c9be7d055473@huawei.com> Date: Mon, 1 Apr 2019 18:32:46 +0800 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:45.0) Gecko/20100101 Thunderbird/45.7.1 MIME-Version: 1.0 In-Reply-To: <20190401035557.22191-1-liwei391@huawei.com> X-Originating-IP: [10.177.31.55] X-CFilter-Loop: Reflected X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20190401_033302_598504_EC288C72 X-CRM114-Status: GOOD ( 12.50 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: wanghaibin 00208455 , julien.thierry@arm.com, linux-arm-kernel@lists.infradead.org, huawei.libin@huawei.com, guohanjun@huawei.com Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset="us-ascii"; Format="flowed" Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+infradead-linux-arm-kernel=archiver.kernel.org@lists.infradead.org On 2019/4/1 11:55, Wei Li wrote: > When doing unwind_frame() in the context of pseudo nmi (need enable > CONFIG_ARM64_PSEUDO_NMI), reaching the botton of the stack (fp == 0, botton -> bottom? Heyi > pc != 0), function on_sdei_stack() will return true while the sdei acpi > table is not inited in fact. This will cause a "NULL pointer dereference" > oops when going on. > > Signed-off-by: Wei Li > --- > arch/arm64/kernel/sdei.c | 6 ++++++ > 1 file changed, 6 insertions(+) > > diff --git a/arch/arm64/kernel/sdei.c b/arch/arm64/kernel/sdei.c > index 5ba4465e44f0..ea94cf8f9dc6 100644 > --- a/arch/arm64/kernel/sdei.c > +++ b/arch/arm64/kernel/sdei.c > @@ -94,6 +94,9 @@ static bool on_sdei_normal_stack(unsigned long sp, struct stack_info *info) > unsigned long low = (unsigned long)raw_cpu_read(sdei_stack_normal_ptr); > unsigned long high = low + SDEI_STACK_SIZE; > > + if (!low) > + return false; > + > if (sp < low || sp >= high) > return false; > > @@ -111,6 +114,9 @@ static bool on_sdei_critical_stack(unsigned long sp, struct stack_info *info) > unsigned long low = (unsigned long)raw_cpu_read(sdei_stack_critical_ptr); > unsigned long high = low + SDEI_STACK_SIZE; > > + if (!low) > + return false; > + > if (sp < low || sp >= high) > return false; > _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel