From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 9AFE9C6FA8E for ; Sun, 26 Feb 2023 05:03:54 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229581AbjBZFDw (ORCPT ); Sun, 26 Feb 2023 00:03:52 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40500 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229609AbjBZFDv (ORCPT ); Sun, 26 Feb 2023 00:03:51 -0500 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 02AF412857 for ; Sat, 25 Feb 2023 21:03:50 -0800 (PST) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 8653060BE9 for ; Sun, 26 Feb 2023 05:03:49 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id E029AC433D2; Sun, 26 Feb 2023 05:03:48 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linux-foundation.org; s=korg; t=1677387829; bh=skXkGkJGoGG/pJA6DcbK010HznhLgvD1KuGFJWvmE/w=; h=Date:To:From:Subject:From; b=u16lBHgxcBwy2NR2haI93ZvnKUrne+AjnQiIHfSD0dUYJ5hbpw1H9v0+OyWgE27uE kUFGjGk5De375BK9ykOHgOAE2ILTaltkDyt489sGdhHcFghhhBHObUo4tB1zfZ3Dnj MenGxM7v1btKrRlSP6SwJF69/CWu3Xm55EBm0q5w= Date: Sat, 25 Feb 2023 21:03:48 -0800 To: mm-commits@vger.kernel.org, vincenzo.frascino@arm.com, tglx@linutronix.de, ryabinin.a.a@gmail.com, peterz@infradead.org, nicolas@fjasle.eu, ndesaulniers@google.com, nathan@kernel.org, naresh.kamboju@linaro.org, mingo@redhat.com, lkft@linaro.org, keescook@chromium.org, jakub@redhat.com, glider@google.com, dvyukov@google.com, dave.hansen@linux.intel.com, bp@alien8.de, andreyknvl@gmail.com, elver@google.com, akpm@linux-foundation.org From: Andrew Morton Subject: + kasan-x86-dont-rename-memintrinsics-in-uninstrumented-files.patch added to mm-hotfixes-unstable branch Message-Id: <20230226050348.E029AC433D2@smtp.kernel.org> Precedence: bulk Reply-To: linux-kernel@vger.kernel.org List-ID: X-Mailing-List: mm-commits@vger.kernel.org The patch titled Subject: kasan, x86: don't rename memintrinsics in uninstrumented files has been added to the -mm mm-hotfixes-unstable branch. Its filename is kasan-x86-dont-rename-memintrinsics-in-uninstrumented-files.patch This patch will shortly appear at https://git.kernel.org/pub/scm/linux/kernel/git/akpm/25-new.git/tree/patches/kasan-x86-dont-rename-memintrinsics-in-uninstrumented-files.patch This patch will later appear in the mm-hotfixes-unstable branch at git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm Before you just go and hit "reply", please: a) Consider who else should be cc'ed b) Prefer to cc a suitable mailing list as well c) Ideally: find the original patch on the mailing list and do a reply-to-all to that, adding suitable additional cc's *** Remember to use Documentation/process/submit-checklist.rst when testing your code *** The -mm tree is included into linux-next via the mm-everything branch at git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm and is updated there every 2-3 working days ------------------------------------------------------ From: Marco Elver Subject: kasan, x86: don't rename memintrinsics in uninstrumented files Date: Fri, 24 Feb 2023 09:59:42 +0100 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. Link: https://lkml.kernel.org/r/20230224085942.1791837-4-elver@google.com Fixes: 69d4c0d32186 ("entry, kasan, x86: Disallow overriding mem*() functions") Signed-off-by: Marco Elver Reviewed-by: Andrey Konovalov Cc: Alexander Potapenko Cc: Andrey Ryabinin Cc: Borislav Petkov (AMD) Cc: Dave Hansen Cc: Dmitry Vyukov Cc: Ingo Molnar Cc: Jakub Jelinek Cc: Kees Cook Cc: Linux Kernel Functional Testing Cc: Naresh Kamboju Cc: Nathan Chancellor Cc: Nick Desaulniers Cc: Nicolas Schier Cc: Peter Zijlstra (Intel) Cc: Thomas Gleixner Cc: Vincenzo Frascino Signed-off-by: Andrew Morton --- --- a/arch/x86/include/asm/string_64.h~kasan-x86-dont-rename-memintrinsics-in-uninstrumented-files +++ 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); _ Patches currently in -mm which might be from elver@google.com are kasan-emit-different-calls-for-instrumentable-memintrinsics.patch kasan-treat-meminstrinsic-as-builtins-in-uninstrumented-files.patch kasan-test-fix-test-for-new-meminstrinsic-instrumentation.patch kasan-x86-dont-rename-memintrinsics-in-uninstrumented-files.patch