Received: by 2002:a05:7412:8d10:b0:f3:1519:9f41 with SMTP id bj16csp6672091rdb; Fri, 15 Dec 2023 05:29:48 -0800 (PST) X-Google-Smtp-Source: AGHT+IEbrmZwQq/yS0TDpb2neDdfEeWZhUb/YA+N1c89L7XlLBHWBDjfyE01Kl2ml3ECZ12A/lE7 X-Received: by 2002:a05:6e02:188a:b0:35f:871f:ae58 with SMTP id o10-20020a056e02188a00b0035f871fae58mr2068168ilu.102.1702646988702; Fri, 15 Dec 2023 05:29:48 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1702646988; cv=none; d=google.com; s=arc-20160816; b=vTDch+EI59oQbCBZ1Y6vf/bJWQBGqBcJWUkk9O6M4S6FIoTyorWxwB2A1+RxfPMq0o 8W29rgyCSXy86vh3iJAUpZVtTLLdH5vIlprZGD4kipl2C2DAAZVq1tbEpO5SzEENnQEo 4PGFnMaUGhVzzEUXD344AHZPiTs6CrfDnCLCuAL60dezKykGuPdFmr8YTwmwIkc5gAYk I/8gQX+jUfCUog1CI78gOp3ld+V0rGcpqU8h5M6TfOQvoKSWQ1WgTFQ/38lKpdzcq/uG 4CUa7iyeGdW01Hk4u711qj7VfiGXWR8fZ03ssAlQb6IxBPMRs6p+DKTydCl1DLfiX6gI 4uKA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=date:message-id:user-agent:cc:to:references:in-reply-to:from :subject:content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:dkim-signature; bh=KncFRUpaOfY4ZyVFYisto1+yJSIGRF5jXKHz5t+icNI=; fh=394WqOqPAKB3qDt9YXvq4vxddE86NE0ZN13UHGRh2Z4=; b=KUNE9EP+VZ7ikMj/EXITa0MR0Fe+6V9oJiaE1PXlts2yRY2eRXxuOxm/ENiDQVb6b+ K0ky/+l+c8vvnyH99gkRF6jP/fUcwSD2DKHmiACqWRVuf1t5Wst+qH3nEa6fKLQJ1PCb HAz5EwYvzHeqn6gVD7vvFpzFb2cPC6DFZVMlg+sM7uZYRB9BE6EUd+hByRgKOHB81/da uS80yiSfoYoO57Zbaqd8CNjHO7lvpb4J/d2q4uDAbsGr85sCKbYlpOLMyA2kIShWTjjM R8C6V/axZqOf3Au+IRAz6A3ikThZ2ksihyXhglVz8g1T0dongoZK/qV/lhk8BfFzZ/CK yv0w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=JXsLTunK; spf=pass (google.com: domain of linux-wireless+bounces-836-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-wireless+bounces-836-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id y125-20020a636483000000b005ca1c765c3csi7694034pgb.610.2023.12.15.05.29.48 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 15 Dec 2023 05:29:48 -0800 (PST) Received-SPF: pass (google.com: domain of linux-wireless+bounces-836-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) client-ip=2604:1380:45e3:2400::1; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=JXsLTunK; spf=pass (google.com: domain of linux-wireless+bounces-836-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-wireless+bounces-836-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sv.mirrors.kernel.org (Postfix) with ESMTPS id 58A582858FA for ; Fri, 15 Dec 2023 13:29:48 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 82DB02DB81; Fri, 15 Dec 2023 13:29:41 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="JXsLTunK" X-Original-To: linux-wireless@vger.kernel.org Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (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 5CBA72DB75; Fri, 15 Dec 2023 13:29:41 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 0408EC433C7; Fri, 15 Dec 2023 13:29:37 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1702646980; bh=rpyS4v8W+CuN4+EjjXEahB1+6g1qTTqMvB9+ugujzJg=; h=Subject:From:In-Reply-To:References:To:Cc:Date:From; b=JXsLTunKMBBISI4ECLjoovakgd/auY72meweT5jEaGxWUmWWMPpUZ0/zdNwREoc2g 2aS2ZNCm1VcCgKfG9UUbi1WD7ytS5cCUCgEypqXTrz2rzw7bDJr566wVPY4/Pny+JZ 9e+Ey7VpBE4EOB0iIPpVVjiFfWnmnA44lv/DdIN36uMLpGqTXCll4jaanDarSgmOP2 ZKcszw82ho2s3UYGfr7Wgo8tVp1rJ/hNwk1umGZv2WpM+73haNqFR0Rz01Xs04Y/af xJEUIKZhkdybjvF/4OYAtLELSFBU4uAHRvGWHL0FUfH+95hDrJL/ICpWFM3DS5YP2S sCWwwaOTG5JxQ== Content-Type: text/plain; charset="utf-8" Precedence: bulk X-Mailing-List: linux-wireless@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: Re: [PATCH v2][wireless-next/for-next] wifi: mt76: mt7996: Use DECLARE_FLEX_ARRAY() and fix -Warray-bounds warnings From: Kalle Valo In-Reply-To: References: To: "Gustavo A. R. Silva" Cc: Felix Fietkau , Lorenzo Bianconi , Ryder Lee , Shayne Chen , Sean Wang , Matthias Brugger , AngeloGioacchino Del Regno , linux-wireless@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-mediatek@lists.infradead.org, "Gustavo A. R. Silva" , linux-hardening@vger.kernel.org User-Agent: pwcli/0.1.1-git (https://github.com/kvalo/pwcli/) Python/3.11.2 Message-ID: <170264697580.1759617.6397953788753678096.kvalo@kernel.org> Date: Fri, 15 Dec 2023 13:29:37 +0000 (UTC) "Gustavo A. R. Silva" wrote: > Transform zero-length arrays `rate`, `adm_stat` and `msdu_cnt` into > proper flexible-array members in anonymous union in `struct > mt7996_mcu_all_sta_info_event` via the DECLARE_FLEX_ARRAY() > helper; and fix multiple -Warray-bounds warnings: > > drivers/net/wireless/mediatek/mt76/mt7996/mcu.c:544:61: warning: array subscript is outside array bounds of 'struct [0]' [-Warray-bounds=] > drivers/net/wireless/mediatek/mt76/mt7996/mcu.c:551:58: warning: array subscript is outside array bounds of 'struct [0]' [-Warray-bounds=] > drivers/net/wireless/mediatek/mt76/mt7996/mcu.c:553:58: warning: array subscript is outside array bounds of 'struct [0]' [-Warray-bounds=] > drivers/net/wireless/mediatek/mt76/mt7996/mcu.c:530:61: warning: array subscript is outside array bounds of 'struct [0]' [-Warray-bounds=] > drivers/net/wireless/mediatek/mt76/mt7996/mcu.c:538:66: warning: array subscript is outside array bounds of 'struct [0]' [-Warray-bounds=] > drivers/net/wireless/mediatek/mt76/mt7996/mcu.c:540:66: warning: array subscript is outside array bounds of 'struct [0]' [-Warray-bounds=] > drivers/net/wireless/mediatek/mt76/mt7996/mcu.c:520:57: warning: array subscript is outside array bounds of 'struct all_sta_trx_rate[0]' [-Warray-bounds=] > drivers/net/wireless/mediatek/mt76/mt7996/mcu.c:526:76: warning: array subscript is outside array bounds of 'struct all_sta_trx_rate[0]' [-Warray-bounds=] > drivers/net/wireless/mediatek/mt76/mt7996/mcu.c:526:76: warning: array subscript is outside array bounds of 'struct all_sta_trx_rate[0]' [-Warray-bounds=] > drivers/net/wireless/mediatek/mt76/mt7996/mcu.c:526:76: warning: array subscript is outside array bounds of 'struct all_sta_trx_rate[0]' [-Warray-bounds=] > drivers/net/wireless/mediatek/mt76/mt7996/mcu.c:526:76: warning: array subscript is outside array bounds of 'struct all_sta_trx_rate[0]' [-Warray-bounds=] > > This results in no differences in binary output, helps with the ongoing > efforts to globally enable -Warray-bounds. > > Reviewed-by: Kees Cook > Signed-off-by: Gustavo A. R. Silva I'll take this directly wireless-next, ok? -- https://patchwork.kernel.org/project/linux-wireless/patch/ZXiU9ayVCslt3qiI@work/ https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches