Linux-ARM-Kernel Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: mark.rutland@arm.com (Mark Rutland)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH] arm64: disable KASAN for save_trace()
Date: Sun, 11 Nov 2018 17:23:33 +0000	[thread overview]
Message-ID: <20181111172333.ov25gdmlsmhc6ysp@salmiak> (raw)
In-Reply-To: <1541938036-29498-1-git-send-email-zhizhouzhang@asrmicro.com>

On Sun, Nov 11, 2018 at 08:07:16PM +0800, Zhizhou Zhang wrote:
> save_trace() which is called from walk_stackframe() always try to
> read/write caller's stack. This results KASAN stack-out-of-bounds
> warning. So mute it.

The save_trace() function should never perform an out-of-bounds access on the
caller's stack, so this is papering over a bug elsewhere.

Can you please given an example report from KASAN?

Thanks,
Mark.

> 
> Signed-off-by: Zhizhou Zhang <zhizhouzhang@asrmicro.com>
> ---
>  arch/arm64/kernel/stacktrace.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/arch/arm64/kernel/stacktrace.c b/arch/arm64/kernel/stacktrace.c
> index 4989f7e..e93ca67 100644
> --- a/arch/arm64/kernel/stacktrace.c
> +++ b/arch/arm64/kernel/stacktrace.c
> @@ -107,7 +107,7 @@ struct stack_trace_data {
>  	unsigned int skip;
>  };
>  
> -static int save_trace(struct stackframe *frame, void *d)
> +static int __no_sanitize_address save_trace(struct stackframe *frame, void *d)
>  {
>  	struct stack_trace_data *data = d;
>  	struct stack_trace *trace = data->trace;
> -- 
> 2.7.4
> 
> 
> _______________________________________________
> linux-arm-kernel mailing list
> linux-arm-kernel at lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

  reply	other threads:[~2018-11-11 17:23 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-11-11 12:07 [PATCH] arm64: disable KASAN for save_trace() Zhizhou Zhang
2018-11-11 17:23 ` Mark Rutland [this message]
2018-11-12  7:38   ` Zhang Zhizhou(张治洲)
2018-11-13 17:29     ` Mark Rutland

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=20181111172333.ov25gdmlsmhc6ysp@salmiak \
    --to=mark.rutland@arm.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    /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