linux-toolchains.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Andrey Konovalov <andreyknvl@gmail.com>
To: Marco Elver <elver@google.com>
Cc: Peter Zijlstra <peterz@infradead.org>,
	Ingo Molnar <mingo@kernel.org>, Jakub Jelinek <jakub@redhat.com>,
	linux-toolchains@vger.kernel.org,
	Andrey Ryabinin <ryabinin.a.a@gmail.com>,
	Alexander Potapenko <glider@google.com>,
	Dmitry Vyukov <dvyukov@google.com>,
	Andrew Morton <akpm@linux-foundation.org>,
	Nathan Chancellor <nathan@kernel.org>,
	Nick Desaulniers <ndesaulniers@google.com>,
	kasan-dev@googlegroups.com, linux-kernel@vger.kernel.org,
	linux-mm@kvack.org, linux-kbuild@vger.kernel.org
Subject: Re: [PATCH -tip v4 4/4] kasan, x86: Don't rename memintrinsics in uninstrumented files
Date: Fri, 17 Feb 2023 14:10:28 +0100	[thread overview]
Message-ID: <CA+fCnZd+BQo=+YzhJ4DXz6EK_M9UnGVRi8X1h3tV8cXXYS=T8A@mail.gmail.com> (raw)
In-Reply-To: <Y+94tm7xoeTGqPgs@elver.google.com>

On Fri, Feb 17, 2023 at 1:53 PM Marco Elver <elver@google.com> wrote:
>
> Now that memcpy/memset/memmove are no longer overridden by KASAN, we can
> just use the normal symbol names in uninstrumented files.
>
> Drop the preprocessor redefinitions.
>
> Fixes: 69d4c0d32186 ("entry, kasan, x86: Disallow overriding mem*() functions")
> Signed-off-by: Marco Elver <elver@google.com>
> ---
> v4:
> * New patch.
> ---
>  arch/x86/include/asm/string_64.h | 19 -------------------
>  1 file changed, 19 deletions(-)
>
> diff --git a/arch/x86/include/asm/string_64.h b/arch/x86/include/asm/string_64.h
> index 888731ccf1f6..c1e14cee0722 100644
> --- a/arch/x86/include/asm/string_64.h
> +++ b/arch/x86/include/asm/string_64.h
> @@ -85,25 +85,6 @@ char *strcpy(char *dest, const char *src);
>  char *strcat(char *dest, const char *src);
>  int strcmp(const char *cs, const char *ct);
>
> -#if (defined(CONFIG_KASAN) && !defined(__SANITIZE_ADDRESS__))
> -/*
> - * For files that not instrumented (e.g. mm/slub.c) we
> - * should use not instrumented version of mem* functions.
> - */
> -
> -#undef memcpy
> -#define memcpy(dst, src, len) __memcpy(dst, src, len)
> -#undef memmove
> -#define memmove(dst, src, len) __memmove(dst, src, len)
> -#undef memset
> -#define memset(s, c, n) __memset(s, c, n)
> -
> -#ifndef __NO_FORTIFY
> -#define __NO_FORTIFY /* FORTIFY_SOURCE uses __builtin_memcpy, etc. */
> -#endif
> -
> -#endif
> -
>  #ifdef CONFIG_ARCH_HAS_UACCESS_FLUSHCACHE
>  #define __HAVE_ARCH_MEMCPY_FLUSHCACHE 1
>  void __memcpy_flushcache(void *dst, const void *src, size_t cnt);
> --
> 2.39.2.637.g21b0678d19-goog
>

Reviewed-by: Andrey Konovalov <andreyknvl@gmail.com>

Thank you, Marco!

  reply	other threads:[~2023-02-17 13:10 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-02-16 23:45 [PATCH -tip v4 1/3] kasan: Emit different calls for instrumentable memintrinsics Marco Elver
2023-02-16 23:45 ` [PATCH -tip v4 2/3] kasan: Treat meminstrinsic as builtins in uninstrumented files Marco Elver
2023-02-17 11:07   ` Andrey Konovalov
2023-02-17 12:55     ` Marco Elver
2023-02-16 23:45 ` [PATCH -tip v4 3/3] kasan: test: Fix test for new meminstrinsic instrumentation Marco Elver
2023-02-17  9:11   ` Alexander Potapenko
2023-02-17 11:07   ` Andrey Konovalov
2023-02-17 11:07 ` [PATCH -tip v4 1/3] kasan: Emit different calls for instrumentable memintrinsics Andrey Konovalov
2023-02-17 12:53 ` [PATCH -tip v4 4/4] kasan, x86: Don't rename memintrinsics in uninstrumented files Marco Elver
2023-02-17 13:10   ` Andrey Konovalov [this message]
2023-02-17 17:37 ` [PATCH -tip v4 1/3] kasan: Emit different calls for instrumentable memintrinsics Naresh Kamboju

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='CA+fCnZd+BQo=+YzhJ4DXz6EK_M9UnGVRi8X1h3tV8cXXYS=T8A@mail.gmail.com' \
    --to=andreyknvl@gmail.com \
    --cc=akpm@linux-foundation.org \
    --cc=dvyukov@google.com \
    --cc=elver@google.com \
    --cc=glider@google.com \
    --cc=jakub@redhat.com \
    --cc=kasan-dev@googlegroups.com \
    --cc=linux-kbuild@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=linux-toolchains@vger.kernel.org \
    --cc=mingo@kernel.org \
    --cc=nathan@kernel.org \
    --cc=ndesaulniers@google.com \
    --cc=peterz@infradead.org \
    --cc=ryabinin.a.a@gmail.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;
as well as URLs for NNTP newsgroup(s).