From: He Zhe <zhe.he@windriver.com>
To: linux@armlinux.org.uk, linux-arm-kernel@lists.infradead.org,
linux-kernel@vger.kernel.org, nathan@kernel.org,
ndesaulniers@google.com, trix@redhat.com
Subject: Re: [PATCH] ARM: uaccess: Disable KASAN for uaccess_with_memcpy.c
Date: Mon, 15 Aug 2022 15:45:02 +0800 [thread overview]
Message-ID: <df52247f-3b53-c570-8229-f123305de7d0@windriver.com> (raw)
In-Reply-To: <20220711094859.4769-1-zhe.he@windriver.com>
Oops, some reviewers were missing at first.
Zhe
On 7/11/22 17:48, He Zhe wrote:
> uaccess_with_memcpy.c accesses user-space address on purpose. We should
> disable KASAN instrumentation for it, otherwise we would have call traces
> like the following.
>
> BUG: KASAN: user-memory-access in __clear_user_memset+0x154/0x21c
> Write of size 4032 at addr 00501040 by task init/1
>
> CPU: 1 PID: 1 Comm: init Not tainted 5.15.52-yocto-standard #1
> Hardware name: Xilinx Zynq Platform
> [<80116be8>] (unwind_backtrace) from [<8010ea3c>] (show_stack+0x18/0x1c)
> [<8010ea3c>] (show_stack) from [<80fc287c>] (dump_stack_lvl+0x40/0x4c)
> [<80fc287c>] (dump_stack_lvl) from [<80391148>] (kasan_report+0x19c/0x1cc)
> [<80391148>] (kasan_report) from [<80391b78>] (kasan_check_range+0x20/0x174)
> [<80391b78>] (kasan_check_range) from [<8039230c>] (memset+0x20/0x3c)
> [<8039230c>] (memset) from [<808112f0>] (__clear_user_memset+0x154/0x21c)
> [<808112f0>] (__clear_user_memset) from [<8044a9d4>] (clear_user+0x44/0x5c)
> [<8044a9d4>] (clear_user) from [<8044aa0c>] (padzero+0x20/0x38)
> [<8044aa0c>] (padzero) from [<8044ca00>] (load_elf_binary+0x994/0x1740)
> [<8044ca00>] (load_elf_binary) from [<803b4ed0>] (bprm_execve+0x420/0x8ec)
> [<803b4ed0>] (bprm_execve) from [<803b5bc0>] (kernel_execve+0x15c/0x190)
> [<803b5bc0>] (kernel_execve) from [<80fb9bf0>] (try_to_run_init_process+0x14/0x40)
> [<80fb9bf0>] (try_to_run_init_process) from [<80fccd3c>] (kernel_init+0xc8/0x148)
> [<80fccd3c>] (kernel_init) from [<80100130>] (ret_from_fork+0x14/0x24)
>
> Signed-off-by: He Zhe <zhe.he@windriver.com>
> ---
> arch/arm/lib/Makefile | 1 +
> 1 file changed, 1 insertion(+)
>
> diff --git a/arch/arm/lib/Makefile b/arch/arm/lib/Makefile
> index 6d2ba454f25b..ddeb46efed80 100644
> --- a/arch/arm/lib/Makefile
> +++ b/arch/arm/lib/Makefile
> @@ -27,6 +27,7 @@ endif
>
> # using lib_ here won't override already available weak symbols
> obj-$(CONFIG_UACCESS_WITH_MEMCPY) += uaccess_with_memcpy.o
> +KASAN_SANITIZE_uaccess_with_memcpy.o := n
>
> lib-$(CONFIG_MMU) += $(mmu-y)
>
prev parent reply other threads:[~2022-08-15 7:46 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-07-11 9:48 He Zhe
2022-08-15 7:45 ` He Zhe [this message]
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=df52247f-3b53-c570-8229-f123305de7d0@windriver.com \
--to=zhe.he@windriver.com \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux@armlinux.org.uk \
--cc=nathan@kernel.org \
--cc=ndesaulniers@google.com \
--cc=trix@redhat.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
all inboxes | Powered by JetHome®