Received: by 2002:a05:6a11:4021:0:0:0:0 with SMTP id ky33csp5008108pxb; Tue, 28 Sep 2021 08:43:34 -0700 (PDT) X-Google-Smtp-Source: ABdhPJy4TRs/x9naRPwWh8tp/e3r07OZueI2wEbzBUxUS92Sh5/h9F3ldYJP6HlGXCROTd9xE/59 X-Received: by 2002:a62:1ac3:0:b0:44b:b424:b49c with SMTP id a186-20020a621ac3000000b0044bb424b49cmr2514214pfa.86.1632843814490; Tue, 28 Sep 2021 08:43:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1632843814; cv=none; d=google.com; s=arc-20160816; b=omBPKUo6YbzNKzq8tnbmEgXhTNY0i62cooiyl2Ati/u4BJnlq/6kxNEIMEVA/yTrgZ wTrMjpfEOJQPsuA2ZkGLj/PXvKS34813eDcLVgfZL35Hyw1rvem5YOYdSdj2KF0ni6FF XK7ilSaQ7OO0qTm91DfWTSr1K+eE/pk8agApWq6PoqslNdP6iovu6ZEW60yRgCajfQQy uQ6FSB+CWkvVfmEwYClm3vdgTM5zn5DDyH9BrwnryhmIKNKlB59obtge2nK73/qHyzrv lbusPZCPC36vDDyV6O/eSnR8pisaALyqp9dFpNzAtr6evmHmCYv8vVYZZxySzthjZwo4 N0aw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=FeWudv9tknX6YulrtF3db6bfsLsZ5Te3WSgiujC+ACg=; b=nkypMwk4Mvdb1PuSaSiwyoPcUr2DvxBYpWZSfjpqbd+SAx0GIuqPrkbZtWyhSSf9V+ k+WgT7SvNdaYI7k629r94yVKSgmlbRcTE2wlxe7fR7hu7FkSwgoRcWjJlJxillErYVmv k6JjMD993aPHxaI4awjjoHcdaqj4lflZJNCCMliQnAnhE/izJ3iQoXIw5M1/Snjr8X32 KFV4FmO4ucwnnzGkhCJs03Yc+8+8aBeIBTBioNfscXWYNR96X7PytIFGeUCHk4Ie5cnu MmLUc8dyB57M7yijhCBQhE/iios89P+LewEyUYwqeHk4t6YmU38RlTCP6vI7OIDtLcez ffyg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b="UJuBy/q/"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id oo10si4405935pjb.169.2021.09.28.08.43.18; Tue, 28 Sep 2021 08:43:34 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b="UJuBy/q/"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S241734AbhI1Pnt (ORCPT + 99 others); Tue, 28 Sep 2021 11:43:49 -0400 Received: from mail.kernel.org ([198.145.29.99]:60456 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S241730AbhI1Pno (ORCPT ); Tue, 28 Sep 2021 11:43:44 -0400 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 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.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