Received: by 2002:a05:6a11:4021:0:0:0:0 with SMTP id ky33csp31629pxb; Tue, 28 Sep 2021 14:42:19 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxzv1KkvldHva4ZMs76U7g5a2R2sEeVaVGAb7jrD1WiyBNmM5suqd/sfHZwZUHViQcQ6MGn X-Received: by 2002:a62:8fd7:0:b0:44b:bb49:63c8 with SMTP id n206-20020a628fd7000000b0044bbb4963c8mr2871947pfd.52.1632865339632; Tue, 28 Sep 2021 14:42:19 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1632865339; cv=none; d=google.com; s=arc-20160816; b=srVWPfo9nG9zGycnOwS4X2G5KLYyJLJH65h2swb5xGEx9OBwdmL1sjpvfu43S7G0EY FmS17upEnOMPW0Z/bR6xmz5RQwSmlVYwZbNOpGwQYxiOTJJ5yu03/LtPQjxQSP/hh0r7 /i1UkJ219Ezdy+hfXxB7bqSgx582Fzn2I1nLnW7H+ncOEsQfDhNS6pVu6j7jB7w5iNOY UpmU0TQJ47J78FcoAhIXZvOThTgT+xyJDUAt8MBSL5wESJiKi0wtSggidyD9E2bnjOI1 o1m3Yy97BRrA7uaOwUFN320jPv3LWTa5nwXW31yuE4HpdV792cpI3BqNKYxmn4OqAu4Y htuQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=gDh9+EkJ1XaioXG706gkM4MC/zvXOsIVOcJCDT0kPlA=; b=FloI5HN6S4TZv9btUeP9L+3rHlj02kmk27TP5vVhn0RJOZWww0usFDP7fFfLPPlVjD LLIAduhrs8qrb0Zm2BXAvKQIJgFEXBRNqV7EqCk2GkEywZ/7FFF2Bq2jXh48Slyv5X7H zPES7dMwiKdRCG/ccQmxCaULnltX274Phv6PBenfXKudZo1tf90FSlGn8mvr2dlNRURr 503e6CDqE4WeTuUAxKxuL4X6JNSZlK1RMw7wQSjeNFBrOyFZ6VT37+C+G09BE7ZYpLIu pRYWeFuSVo8LG7TLItnw5rf7caFxbfUu84vvCA+pWX0cKJTBx9YOcvhF1E81gfWjguIE es1Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=By1oZKn5; 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=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id u2si173776plh.133.2021.09.28.14.42.07; Tue, 28 Sep 2021 14:42:19 -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=@linaro.org header.s=google header.b=By1oZKn5; 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=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S242908AbhI1Vlj (ORCPT + 99 others); Tue, 28 Sep 2021 17:41:39 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39954 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232358AbhI1Vli (ORCPT ); Tue, 28 Sep 2021 17:41:38 -0400 Received: from mail-ed1-x536.google.com (mail-ed1-x536.google.com [IPv6:2a00:1450:4864:20::536]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 974ACC06161C for ; Tue, 28 Sep 2021 14:39:58 -0700 (PDT) Received: by mail-ed1-x536.google.com with SMTP id ba1so541449edb.4 for ; Tue, 28 Sep 2021 14:39:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=gDh9+EkJ1XaioXG706gkM4MC/zvXOsIVOcJCDT0kPlA=; b=By1oZKn5ZK9lpmbNq9hmZ9zb4Q5xi6mybeF9MwvF2f8trWsWis+vN0IT+3VXJSeKXg +R2RtWPiXDlLjsZdkcekT6ysH7JpyHG94Tb6k2xKDjnRIaKq+kjoKO5tAoU2tc+19nam +7xiU8S3OSUHHeCLbkbYDUPPTslbhFrmnmT6mxCIaOMOiEHurXSexF/D7Esh5QgCbea9 ErtdN+oWwQhRV4WmBJpeylpvRpPKQoE2BJfE+GA8sJyXrJhZvt26Pftiwbdi/Unzm16Q PM4yejiUuDuVmAfug58LWDePo2zbeT9FpSmz2FFInlZVP67VbX06bMLh63VA5F+Xtbw8 PZ3w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=gDh9+EkJ1XaioXG706gkM4MC/zvXOsIVOcJCDT0kPlA=; b=EwrltK8f3zolrKUyPfOx42UPxdtd/+qxtyCkc600mD19jX1mdBstAzn+RUc8+DGxbK NGmWiypCXA8vKKDfjw4KGIwM99ZuVhLQk7QpVIoCNIoIdAxt8ITymtB57VhafyS8tAmK KynY7nC6vZiv/VViEpTBInalJ6WEJvsWXxA3MArCdxl6vrLOCZ1SVaLPsxGBQu/YmPu5 4mtfW8TnsNtpxMM/noMtEue7VDtsOXEk7Mr0doQfXtNFRUCGgYVZE+dxo0mYWUNoEnuT P7aB19qHOsrT4aAal/u8MPoBkw9emSwOfcDbt8sk9yjA9mvLZolZRcw66B9EKW6da4e3 imnw== X-Gm-Message-State: AOAM530S7gWVGd6khUh/zBNFYXdK32lnxOgz+7x92W2OmnsJEe3zlkeq z4XJJoK7M40N96dKgR0H24eoy4vVgsxSOFhFwfXkFw== X-Received: by 2002:a17:906:8618:: with SMTP id o24mr6777111ejx.189.1632865197080; Tue, 28 Sep 2021 14:39:57 -0700 (PDT) MIME-Version: 1.0 References: <20210928154143.2106903-1-arnd@kernel.org> <20210928154143.2106903-4-arnd@kernel.org> In-Reply-To: <20210928154143.2106903-4-arnd@kernel.org> From: Linus Walleij Date: Tue, 28 Sep 2021 23:39:46 +0200 Message-ID: Subject: Re: [PATCH 03/14] ARM: remove duplicate memcpy() definition To: Arnd Bergmann Cc: Russell King , Linux ARM , linux-kernel , Arnd Bergmann , Ard Biesheuvel , Nathan Chancellor , Nick Desaulniers , llvm@lists.linux.dev Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Sep 28, 2021 at 5:42 PM Arnd Bergmann wrote: > 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 Solves this, right? https://lore.kernel.org/lkml/202105091112.F5rmd4By-lkp@intel.com/ Can you put in a reported-by and Link: to this so we got it tracked? > #ifdef CONFIG_KERNEL_XZ > +#undef memmove > #define memmove memmove > +#undef memcpy > #define memcpy memcpy > #include "../../../../lib/decompress_unxz.c" > #endif That's clever, maybe drop a small comment in the code why we do this pretty unintuitive looking thing and how this works? Reviewed-by: Linus Walleij Yours, Linus Walleij