Linux-ARM-Kernel Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Heyi Guo <guoheyi@huawei.com>
To: Wei Li <liwei391@huawei.com>, <catalin.marinas@arm.com>,
	<will.deacon@arm.com>, <mark.rutland@arm.com>,
	<labbott@redhat.com>, <alex.popov@linux.com>,
	<james.morse@arm.com>
Cc: wanghaibin 00208455 <wanghaibin.wang@huawei.com>,
	julien.thierry@arm.com, linux-arm-kernel@lists.infradead.org,
	huawei.libin@huawei.com, guohanjun@huawei.com
Subject: Re: [PATCH] arm64: fix wrong check of on_sdei_stack in nmi context
Date: Mon, 1 Apr 2019 18:32:46 +0800	[thread overview]
Message-ID: <69846aa4-ef2e-6124-b39d-c9be7d055473@huawei.com> (raw)
In-Reply-To: <20190401035557.22191-1-liwei391@huawei.com>



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 <liwei391@huawei.com>
> ---
>   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

  parent reply	other threads:[~2019-04-01 10:33 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-04-01  3:55 [PATCH] arm64: fix wrong check of on_sdei_stack in nmi context Wei Li
2019-04-01  9:49 ` Julien Thierry
2019-04-01 10:32 ` Heyi Guo [this message]
2019-04-02 17:13 ` Catalin Marinas

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=69846aa4-ef2e-6124-b39d-c9be7d055473@huawei.com \
    --to=guoheyi@huawei.com \
    --cc=alex.popov@linux.com \
    --cc=catalin.marinas@arm.com \
    --cc=guohanjun@huawei.com \
    --cc=huawei.libin@huawei.com \
    --cc=james.morse@arm.com \
    --cc=julien.thierry@arm.com \
    --cc=labbott@redhat.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=liwei391@huawei.com \
    --cc=mark.rutland@arm.com \
    --cc=wanghaibin.wang@huawei.com \
    --cc=will.deacon@arm.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox