From patchwork Mon Mar 22 16:02:39 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 406157 Delivered-To: patch@linaro.org Received: by 2002:a17:906:5290:0:0:0:0 with SMTP id c16csp1346637ejm; Mon, 22 Mar 2021 09:03:24 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyUvqA4IO9kxgOnFGm3MPfk0CtPk/QOdgaz7tWYiWg0YG+cxwgZdTYY2gmq0T8sv4FPWKv5 X-Received: by 2002:a62:4e57:0:b029:203:93bc:3cb with SMTP id c84-20020a624e570000b029020393bc03cbmr525693pfb.56.1616429003867; Mon, 22 Mar 2021 09:03:23 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1616429003; cv=none; d=google.com; s=arc-20160816; b=BckKY9dTY1r0kOeley6ujc2X8Km7KjScIJN/nh7DhfcBzW7E0ejDT9O+2BSEkf9qZV r3wqIYmtbmAeFD/fVM0zE1J6I4t/T9Lh/vijy0ezPX1d3DPxA7WShVZzANvPHNUS9iGL mWOTLvj3aHWIYyVOBrkpgq8HvgxZ3oqj2MAI7oAtK2GUemCCfxBi9fG6bwNjcx2Tez4T Ba01WX4r1mGxj8s+kaCMZXkCAJ6vq7wwCmEEcNkecLqigM4LNCQxhmuWLOiBw0VELPs9 O8grenXq405OuvpuXCwYeYYcsNc4DgBW1XtiOuZCnQaDhEvK8VIfG54jEHveu2e0000r iIfA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:cc:list-subscribe :list-help:list-post:list-archive:list-unsubscribe:list-id :precedence:mime-version:references:in-reply-to:message-id:date :subject:to:from:dkim-signature:delivered-to; bh=SdH9lcvW+ZlIYhYJciSzUA7rE2XrQdMmVS4dx57vfYg=; b=PojsbW46b33/e0LlTppminz25LR1kA1kv+h01D+9n0Buh+02T+Y/CbqIC7kjHX2Kri 1lpLnwFGUZJ7JnkXiGlAtH8x6BUEea3XOYhc8nNxvIN3Ra5rU0k8mdCZTsVKjw0eRb1X rIAD1TokzAKek3u+AH3T3GGT9YQ9vHhD1CX+GH4s/jadC4i0NN+orxt2yuSlR0/Fnqsk 4nggrXVtyqkGitHrybO5WgxrdRCvFdCJEfw0Xden6APqEedZKRa7aps04hLW6X+xEmlh 6g0V7zRCzIViQHKPOecpnD9EuaesDxOxhutGHXhexj1AdnPbPWpFvnvicvtls5EX2C8A Fzyg== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@kernel.org header.s=k20201202 header.b=VRbsfgY+; spf=pass (google.com: best guess record for domain of dri-devel-bounces@lists.freedesktop.org designates 2610:10:20:722:a800:ff:fe36:1795 as permitted sender) smtp.mailfrom=dri-devel-bounces@lists.freedesktop.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from gabe.freedesktop.org (gabe.freedesktop.org. [2610:10:20:722:a800:ff:fe36:1795]) by mx.google.com with ESMTPS id w8si15192149pgs.103.2021.03.22.09.03.23 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 22 Mar 2021 09:03:23 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of dri-devel-bounces@lists.freedesktop.org designates 2610:10:20:722:a800:ff:fe36:1795 as permitted sender) client-ip=2610:10:20:722:a800:ff:fe36:1795; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@kernel.org header.s=k20201202 header.b=VRbsfgY+; spf=pass (google.com: best guess record for domain of dri-devel-bounces@lists.freedesktop.org designates 2610:10:20:722:a800:ff:fe36:1795 as permitted sender) smtp.mailfrom=dri-devel-bounces@lists.freedesktop.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 1584289EBB; Mon, 22 Mar 2021 16:03:22 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by gabe.freedesktop.org (Postfix) with ESMTPS id DB2476E500; Mon, 22 Mar 2021 16:03:20 +0000 (UTC) Received: by mail.kernel.org (Postfix) with ESMTPSA id C5EBC61992; Mon, 22 Mar 2021 16:03:15 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1616429000; bh=3vH1tW/3dz/29rKeu66QIybhctPu7u2aaTt+yHw+ixQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=VRbsfgY+z8kWvWs+txugnu/XzSTF1os4UBObTbMaVvuShG2tPdw5ChRNTsdoitI1c Os5gXEmTV19Hh0dH4sglqm/fSEpSE1o+cdD5mtmVZ292EJ017mpHo8q2zl1C63RDvy 9IP52tHZwWSskub+gnvqqJxnuA90avLg12n2yst/hTpywQNyH7pGS5SlpLOCg1l1zv SC2S1tGwIlfSqI7YXPTsk7il0mAFtLumFo7AO2H+payHYwT3xe1jEFpNJbjQ5KEMrV fL6MEJv6J7008Lwon/8167XZUtB/IGdDaiFW7a3KldjWew3Xisi5j0MtsrpiR6liOq jy3MXhpKCZK+w== From: Arnd Bergmann To: linux-kernel@vger.kernel.org, Martin Sebor , Thomas Gleixner , Ingo Molnar , Borislav Petkov , x86@kernel.org Subject: [PATCH 01/11] x86: compressed: avoid gcc-11 -Wstringop-overread warning Date: Mon, 22 Mar 2021 17:02:39 +0100 Message-Id: <20210322160253.4032422-2-arnd@kernel.org> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20210322160253.4032422-1-arnd@kernel.org> References: <20210322160253.4032422-1-arnd@kernel.org> MIME-Version: 1.0 X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: dri-devel@lists.freedesktop.org, "H. Peter Anvin" , linux-scsi@vger.kernel.org, James Smart , tboot-devel@lists.sourceforge.net, Kalle Valo , ath11k@lists.infradead.org, Serge Hallyn , Kees Cook , Arnd Bergmann , "James E.J. Bottomley" , Ning Sun , Anders Larsen , cgroups@vger.kernel.org, linux-arm-kernel@lists.infradead.org, netdev@vger.kernel.org, linux-wireless@vger.kernel.org, linux-security-module@vger.kernel.org, Tejun Heo , Simon Kelley , intel-gfx@lists.freedesktop.org Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" From: Arnd Bergmann gcc gets confused by the comparison of a pointer to an integer listeral, with the assumption that this is an offset from a NULL pointer and that dereferencing it is invalid: In file included from arch/x86/boot/compressed/misc.c:18: In function ‘parse_elf’, inlined from ‘extract_kernel’ at arch/x86/boot/compressed/misc.c:442:2: arch/x86/boot/compressed/../string.h:15:23: error: ‘__builtin_memcpy’ reading 64 bytes from a region of size 0 [-Werror=stringop-overread] 15 | #define memcpy(d,s,l) __builtin_memcpy(d,s,l) | ^~~~~~~~~~~~~~~~~~~~~~~ arch/x86/boot/compressed/misc.c:283:9: note: in expansion of macro ‘memcpy’ 283 | memcpy(&ehdr, output, sizeof(ehdr)); | ^~~~~~ I could not find any good workaround for this, but as this is only a warning for a failure during early boot, removing the line entirely works around the warning. This should probably get addressed in gcc instead, before 11.1 gets released. Signed-off-by: Arnd Bergmann --- arch/x86/boot/compressed/misc.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/arch/x86/boot/compressed/misc.c b/arch/x86/boot/compressed/misc.c index 3a214cc3239f..9ada64e66cb7 100644 --- a/arch/x86/boot/compressed/misc.c +++ b/arch/x86/boot/compressed/misc.c @@ -430,8 +430,6 @@ asmlinkage __visible void *extract_kernel(void *rmode, memptr heap, error("Destination address too large"); #endif #ifndef CONFIG_RELOCATABLE - if ((unsigned long)output != LOAD_PHYSICAL_ADDR) - error("Destination address does not match LOAD_PHYSICAL_ADDR"); if (virt_addr != LOAD_PHYSICAL_ADDR) error("Destination virtual address changed when not relocatable"); #endif