From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 8DD943FCB for ; Tue, 28 Sep 2021 15:42:05 +0000 (UTC) Received: by mail.kernel.org (Postfix) with ESMTPSA id 51D8B61262; Tue, 28 Sep 2021 15:42:03 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1632843725; bh=rrsS5AFXKM3ytp6XhzCbbxVjilQ1UQwXqY9Io+ZYNdU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=UJuBy/q/WJQB014QxBCA9uTGswQUARzuNSoMTQG/u99ldLPqd45P0HmXTa33CjXdr I6vM5elhjvNPWqt25H0Qho3MIjNbUz5Z00KBzcNhFFyOAlmDL+cOA5YLi+5SPk1Z/v 95z2Y/dVs+/EBNq11//rqv6mZOLO+v5sfYMmS5Sa2CBGisYVyshF2DGpF4FH26Q6qF yT+jJQOD6985t2jW6sQ+cwxhWLePIihxaghxQm51f1+auWwlJT8rKPYEiIbvMHCnXx napmWkXl4p8AivKfMvXq3Uj5Zf+rj9VWCduFoiUnWMvlxyzxDLdaVtmRQX3+GkXMdo lyCoZLyHfZ7zg== From: Arnd Bergmann To: Russell King Cc: linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, Arnd Bergmann , Ard Biesheuvel , Linus Walleij , Nathan Chancellor , Nick Desaulniers , llvm@lists.linux.dev Subject: [PATCH 03/14] ARM: remove duplicate memcpy() definition Date: Tue, 28 Sep 2021 17:41:32 +0200 Message-Id: <20210928154143.2106903-4-arnd@kernel.org> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20210928154143.2106903-1-arnd@kernel.org> References: <20210928154143.2106903-1-arnd@kernel.org> Precedence: bulk X-Mailing-List: llvm@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit From: Arnd Bergmann Both the decompressor code and the kasan logic try to override the memcpy() and memmove() definitions, which leading to a clash in a KASAN-enabled kernel with XZ decompression: arch/arm/boot/compressed/decompress.c:50:9: error: 'memmove' macro redefined [-Werror,-Wmacro-redefined] #define memmove memmove ^ arch/arm/include/asm/string.h:59:9: note: previous definition is here #define memmove(dst, src, len) __memmove(dst, src, len) ^ arch/arm/boot/compressed/decompress.c:51:9: error: 'memcpy' macro redefined [-Werror,-Wmacro-redefined] #define memcpy memcpy ^ arch/arm/include/asm/string.h:58:9: note: previous definition is here #define memcpy(dst, src, len) __memcpy(dst, src, len) ^ Here we want the set of functions from the decompressor, so undefine the other macros before the override. Fixes: d6d51a96c7d6 ("ARM: 9014/2: Replace string mem* functions for KASan") Fixes: a7f464f3db93 ("ARM: 7001/2: Wire up support for the XZ decompressor") Signed-off-by: Arnd Bergmann --- arch/arm/boot/compressed/decompress.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/arch/arm/boot/compressed/decompress.c b/arch/arm/boot/compressed/decompress.c index aa075d8372ea..5b387c60accd 100644 --- a/arch/arm/boot/compressed/decompress.c +++ b/arch/arm/boot/compressed/decompress.c @@ -47,7 +47,9 @@ extern char * strchrnul(const char *, int); #endif #ifdef CONFIG_KERNEL_XZ +#undef memmove #define memmove memmove +#undef memcpy #define memcpy memcpy #include "../../../../lib/decompress_unxz.c" #endif -- 2.29.2 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 mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 1652CC433EF for ; Tue, 28 Sep 2021 15:44:08 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id D5BEE6124A for ; Tue, 28 Sep 2021 15:44:07 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org D5BEE6124A Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=kernel.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=pA5szcMKGoBNKAsd+lAoqLOgUslulxWyZPaS6gnfzOk=; b=FrKiq20D5Np+PO w/ohXXEsaaLC4PauetpugoctQasGsuWyYAL+G694fjMVS3mgIM6KvIGvp2NUHrU4Ym8cxImZRE02w 4fr4pgV0tTBXkU4xOErldCzpd8YSn9a7QwgpbP1h3Yha/8uHNMTPMo1f2DPXY0Hi/siz5WiX4JJx+ CVHXMdinauEzHnLrmBvtrtjO/lVTnywEESPOD/0Q3EJYyw8wNTmw5XUrLzgKe2E4hPR5DvwlJwcUb yh2CuNdunWzrSTGOjUjmL6ta7WRKP9ikAD5TtZcV5Ov+9GC3Hm9ldFxDSkReFABNWzLx5d1EzUXaP xPN98zSJXo/ss7pVAeEw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1mVFFk-007oJ3-SC; Tue, 28 Sep 2021 15:42:45 +0000 Received: from mail.kernel.org ([198.145.29.99]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1mVFF7-007o5p-9t for linux-arm-kernel@lists.infradead.org; Tue, 28 Sep 2021 15:42:06 +0000 Received: by mail.kernel.org (Postfix) with ESMTPSA id 51D8B61262; Tue, 28 Sep 2021 15:42:03 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1632843725; bh=rrsS5AFXKM3ytp6XhzCbbxVjilQ1UQwXqY9Io+ZYNdU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=UJuBy/q/WJQB014QxBCA9uTGswQUARzuNSoMTQG/u99ldLPqd45P0HmXTa33CjXdr I6vM5elhjvNPWqt25H0Qho3MIjNbUz5Z00KBzcNhFFyOAlmDL+cOA5YLi+5SPk1Z/v 95z2Y/dVs+/EBNq11//rqv6mZOLO+v5sfYMmS5Sa2CBGisYVyshF2DGpF4FH26Q6qF yT+jJQOD6985t2jW6sQ+cwxhWLePIihxaghxQm51f1+auWwlJT8rKPYEiIbvMHCnXx napmWkXl4p8AivKfMvXq3Uj5Zf+rj9VWCduFoiUnWMvlxyzxDLdaVtmRQX3+GkXMdo lyCoZLyHfZ7zg== From: Arnd Bergmann To: Russell King Cc: linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, Arnd Bergmann , Ard Biesheuvel , Linus Walleij , Nathan Chancellor , Nick Desaulniers , llvm@lists.linux.dev Subject: [PATCH 03/14] ARM: remove duplicate memcpy() definition Date: Tue, 28 Sep 2021 17:41:32 +0200 Message-Id: <20210928154143.2106903-4-arnd@kernel.org> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20210928154143.2106903-1-arnd@kernel.org> References: <20210928154143.2106903-1-arnd@kernel.org> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210928_084205_388490_652B414F X-CRM114-Status: GOOD ( 11.40 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org From: Arnd Bergmann Both the decompressor code and the kasan logic try to override the memcpy() and memmove() definitions, which leading to a clash in a KASAN-enabled kernel with XZ decompression: arch/arm/boot/compressed/decompress.c:50:9: error: 'memmove' macro redefined [-Werror,-Wmacro-redefined] #define memmove memmove ^ arch/arm/include/asm/string.h:59:9: note: previous definition is here #define memmove(dst, src, len) __memmove(dst, src, len) ^ arch/arm/boot/compressed/decompress.c:51:9: error: 'memcpy' macro redefined [-Werror,-Wmacro-redefined] #define memcpy memcpy ^ arch/arm/include/asm/string.h:58:9: note: previous definition is here #define memcpy(dst, src, len) __memcpy(dst, src, len) ^ Here we want the set of functions from the decompressor, so undefine the other macros before the override. Fixes: d6d51a96c7d6 ("ARM: 9014/2: Replace string mem* functions for KASan") Fixes: a7f464f3db93 ("ARM: 7001/2: Wire up support for the XZ decompressor") Signed-off-by: Arnd Bergmann --- arch/arm/boot/compressed/decompress.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/arch/arm/boot/compressed/decompress.c b/arch/arm/boot/compressed/decompress.c index aa075d8372ea..5b387c60accd 100644 --- a/arch/arm/boot/compressed/decompress.c +++ b/arch/arm/boot/compressed/decompress.c @@ -47,7 +47,9 @@ extern char * strchrnul(const char *, int); #endif #ifdef CONFIG_KERNEL_XZ +#undef memmove #define memmove memmove +#undef memcpy #define memcpy memcpy #include "../../../../lib/decompress_unxz.c" #endif -- 2.29.2 _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel