From patchwork Mon Mar 22 16:02:42 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 406160 Delivered-To: patch@linaro.org Received: by 2002:a17:906:5290:0:0:0:0 with SMTP id c16csp1347366ejm; Mon, 22 Mar 2021 09:04:19 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwA+rRoxBWVpdiSW6lfTauOWoM8+42x7wJ8RrRJgL+pZNIgVs93OyLeIkJD9co73qsnzXRU X-Received: by 2002:a63:ee4e:: with SMTP id n14mr269137pgk.422.1616429059584; Mon, 22 Mar 2021 09:04:19 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1616429059; cv=none; d=google.com; s=arc-20160816; b=WGx4eTYajH6GMnvHYFLP31JzJ5QuDp8KiZTVtobXNDoNN20PS7xK3/UKC0Gc0FWdDY aT5mz54XPJK67SSZgytr6TWhXYpIyiAFjSHN6J0RSQmkBjs69+IozLFoY80YvWxtSOVF RhFRqFvSU7hRAEWHRBpXnQ/+OBI5/kZcIXKYOXy4OX+iEAZ9FdulmqFpqdCwtuC9I9V7 oOPJ7NOmK0HZB5OMB0nxYM/FgwRe5EdzNviL3r8XdAzKGJzZJDxB2CxvE5cGPfFfmUZ0 7Gn4ZuBbdbLSnC57x/IVBeP/800voHA6ydQSv+qRJCsXgPtj443knQviF2HOMt+LHQqw eYpw== 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=cxWtR5wxbjLsGywuj2lEC2+Dqh4ifYoIbnnuy1o4YPU=; b=bYI6TecxgNutkibuLNBDOHgTKRc1GFC8iy1A134GNz5fGU2fFRvD9V3T15al3IsgUv o9wa0EgFlTjhLAMBaEmXK+MyqZDpkyUBDlK91W8GBWPfBY2pJWLGDLjTxWZFUYf3IqMx oD3agExIbCKvITmhafB01TL3UTuMZiLcCF8tE3HGMlvEtTExndU/ajSNJBT4rZEgWJGk umbTnWh0VsyQtB7XVLBjJsVnXSPA8nt9R7LX+yZJBlzqs/8/bsipd/QRNI51m+bJvq/9 GXfZGaXW5TPXc0EgHp4V5WomEpGjUst7rndXavhJuYIhLckeuVAYYSsDapo5jgmOaLt9 wmPQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@kernel.org header.s=k20201202 header.b=PJL0qpPD; spf=pass (google.com: best guess record for domain of dri-devel-bounces@lists.freedesktop.org designates 131.252.210.177 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. [131.252.210.177]) by mx.google.com with ESMTPS id y6si5573943pgl.402.2021.03.22.09.04.19 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 22 Mar 2021 09:04:19 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of dri-devel-bounces@lists.freedesktop.org designates 131.252.210.177 as permitted sender) client-ip=131.252.210.177; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@kernel.org header.s=k20201202 header.b=PJL0qpPD; spf=pass (google.com: best guess record for domain of dri-devel-bounces@lists.freedesktop.org designates 131.252.210.177 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 683876E4AA; Mon, 22 Mar 2021 16:04:18 +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 10B686E4AA; Mon, 22 Mar 2021 16:04:17 +0000 (UTC) Received: by mail.kernel.org (Postfix) with ESMTPSA id 60C55619A7; Mon, 22 Mar 2021 16:04:10 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1616429056; bh=n4YjjyF/BQX1oLI53brWrn/ZFErJefAlbdz/B6a/LhI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=PJL0qpPDqSs2z7UPLYK5QVJo9sc76O7NWlWo5JPHSsPqGyDVDF4pF7hWXIkB1JA75 QpQt35+7BgO8L8Mn3URqgy3oEgZ8mXFVdUTizaV6t4aX9h9ExQGoEX/rwcyz2jamB2 scTuPUkDJISJZufdWGtFTIeZztxCxD3lXQOLujQyrS4sySOSS+Y/vZY+qg8LWnqJQL I/Aimz84KOYue+E+Dz/GzEJ2kjYrLgh/PeozYrKn1GELVG7ePD4iEbNB0WU3el9Rvz crDXO284w80Ehtcr/BjQheDrwVIVIOc3LE73CNZdbBcsVLFqijc8sIiXIjFKbmSQwm LtmW3NkvnLTfA== From: Arnd Bergmann To: linux-kernel@vger.kernel.org, Martin Sebor , Kalle Valo , "David S. Miller" , Jakub Kicinski Subject: [PATCH 04/11] ath11: Wstringop-overread warning Date: Mon, 22 Mar 2021 17:02:42 +0100 Message-Id: <20210322160253.4032422-5-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: Maharaja Kennadyrajan , Carl Huang , dri-devel@lists.freedesktop.org, Johannes Berg , linux-scsi@vger.kernel.org, x86@kernel.org, Aloka Dixit , James Smart , tboot-devel@lists.sourceforge.net, ath11k@lists.infradead.org, Serge Hallyn , Arnd Bergmann , Ritesh Singh , "James E.J. Bottomley" , Ning Sun , Anders Larsen , cgroups@vger.kernel.org, linux-arm-kernel@lists.infradead.org, Rajkumar Manoharan , Pradeep Kumar Chitrapu , netdev@vger.kernel.org, linux-wireless@vger.kernel.org, linux-security-module@vger.kernel.org, Tejun Heo , Simon Kelley , intel-gfx@lists.freedesktop.org, Felix Fietkau Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" From: Arnd Bergmann gcc-11 with the kernel address sanitizer prints a warning for this driver: In function 'ath11k_peer_assoc_h_vht', inlined from 'ath11k_peer_assoc_prepare' at drivers/net/wireless/ath/ath11k/mac.c:1632:2: drivers/net/wireless/ath/ath11k/mac.c:1164:13: error: 'ath11k_peer_assoc_h_vht_masked' reading 16 bytes from a region of size 4 [-Werror=stringop-overread] 1164 | if (ath11k_peer_assoc_h_vht_masked(vht_mcs_mask)) | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ drivers/net/wireless/ath/ath11k/mac.c: In function 'ath11k_peer_assoc_prepare': drivers/net/wireless/ath/ath11k/mac.c:1164:13: note: referencing argument 1 of type 'const u16 *' {aka 'const short unsigned int *'} drivers/net/wireless/ath/ath11k/mac.c:969:1: note: in a call to function 'ath11k_peer_assoc_h_vht_masked' 969 | ath11k_peer_assoc_h_vht_masked(const u16 vht_mcs_mask[NL80211_VHT_NSS_MAX]) | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ According to analysis from gcc developers, this is a glitch in the way gcc tracks the size of struct members. This should really get fixed in gcc, but it's also easy to work around this instance by changing the function prototype to no include the length of the array. Link: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=99673 Signed-off-by: Arnd Bergmann --- drivers/net/wireless/ath/ath11k/mac.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) -- 2.29.2 _______________________________________________ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel diff --git a/drivers/net/wireless/ath/ath11k/mac.c b/drivers/net/wireless/ath/ath11k/mac.c index b391169576e2..5cb7ed53f3c4 100644 --- a/drivers/net/wireless/ath/ath11k/mac.c +++ b/drivers/net/wireless/ath/ath11k/mac.c @@ -966,7 +966,7 @@ ath11k_peer_assoc_h_ht_masked(const u8 ht_mcs_mask[IEEE80211_HT_MCS_MASK_LEN]) } static bool -ath11k_peer_assoc_h_vht_masked(const u16 vht_mcs_mask[NL80211_VHT_NSS_MAX]) +ath11k_peer_assoc_h_vht_masked(const u16 vht_mcs_mask[]) { int nss;