From: Mark Rutland <mark.rutland@arm.com>
To: Yang Shi <yang.shi@linaro.org>
Cc: aryabinin@virtuozzo.com, will.deacon@arm.com,
catalin.marinas@arm.com, linux-kernel@vger.kernel.org,
linux-arm-kernel@lists.infradead.org, linux-mm@kvack.org,
linaro-kernel@lists.linaro.org
Subject: Re: [v2 PATCH] arm64: kasan: instrument user memory access API
Date: Mon, 6 Jun 2016 18:07:39 +0100 [thread overview]
Message-ID: <20160606170738.GD23505@leverpostej> (raw)
In-Reply-To: <1464382863-11879-1-git-send-email-yang.shi@linaro.org>
On Fri, May 27, 2016 at 02:01:03PM -0700, Yang Shi wrote:
> The upstream commit 1771c6e1a567ea0ba2cccc0a4ffe68a1419fd8ef
> ("x86/kasan: instrument user memory access API") added KASAN instrument to
> x86 user memory access API, so added such instrument to ARM64 too.
>
> Define __copy_to/from_user in C in order to add kasan_check_read/write call,
> rename assembly implementation to __arch_copy_to/from_user.
>
> Tested by test_kasan module.
>
> Signed-off-by: Yang Shi <yang.shi@linaro.org>
> ---
> v2:
> Adopted the comment from Andrey and Mark to add kasan_check_read/write into
> __copy_to/from_user.
>
> arch/arm64/include/asm/uaccess.h | 25 +++++++++++++++++++++----
> arch/arm64/kernel/arm64ksyms.c | 4 ++--
> arch/arm64/lib/copy_from_user.S | 4 ++--
> arch/arm64/lib/copy_to_user.S | 4 ++--
> 4 files changed, 27 insertions(+), 10 deletions(-)
>
> diff --git a/arch/arm64/include/asm/uaccess.h b/arch/arm64/include/asm/uaccess.h
> index 0685d74..4dc9a8f 100644
> --- a/arch/arm64/include/asm/uaccess.h
> +++ b/arch/arm64/include/asm/uaccess.h
> @@ -23,6 +23,7 @@
> */
> #include <linux/string.h>
> #include <linux/thread_info.h>
> +#include <linux/kasan-checks.h>
Nit: please move this before the other includes, to keep these ordered
alphabetically.
Other than that, this looks correct to me, and seems to have addressed
the issue from v1. I've given this a spin on v4.7-rc2, with and without
CONFIG_UBSAN enabled. So FWIW, with the minor fix above:
Reviewed-by: Mark Rutland <mark.rutland@arm.com>
Tested-by: Mark Rutland <mark.rutland@arm.com>
As this isn't a fix, I assume that this is for Catalin to pick for v4.8.
Thanks,
Mark.
--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org. For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>
prev parent reply other threads:[~2016-06-06 17:07 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-05-27 21:01 [v2 PATCH] arm64: kasan: instrument user memory access API Yang Shi
2016-05-30 8:26 ` Andrey Ryabinin
2016-06-06 16:37 ` Shi, Yang
2016-06-06 17:07 ` Mark Rutland [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=20160606170738.GD23505@leverpostej \
--to=mark.rutland@arm.com \
--cc=aryabinin@virtuozzo.com \
--cc=catalin.marinas@arm.com \
--cc=linaro-kernel@lists.linaro.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=will.deacon@arm.com \
--cc=yang.shi@linaro.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;
as well as URLs for NNTP newsgroup(s).