From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id A000FC197A0 for ; Thu, 16 Nov 2023 21:05:38 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References: Message-ID:Subject:Cc:To:From:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=TSceRBy9QoUrjBElHab3dLGlwgSZAU1q9g6OnL8qSE8=; b=l+LqdWOUyagnhc IyCIhkB4iHTeDyCZsmI8f0Ov0hXwpTJw1Q6DRrIdZgJPKPYWA1o+tp38rhkbv8nDuTXQQfzcNEOFH Y7qx6r1fFUS95DPlzXg2/sZpjYRAstegIjosI2B8VZlITEc22EB+rPmTPBJHWaMdNHdGS6BmImVC3 2sNcHH3f+Uok0/iRG9OdbcaQ6KNa6Q8WK0SeZSo/BQaStPeXYradCjed7e0kzKHGdd/r9pLpHDYiG 2wsHJUUskaHeLy2S6sDPYT3wLLZ0PzaLdjyVQ65OctlDKDgDEGr6kqGvH+yZKiFAqI5AJf2/+xYnC FawzqLktabL2boRIISqQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1r3jY2-004q7A-1z; Thu, 16 Nov 2023 21:05:14 +0000 Received: from mail-pl1-x634.google.com ([2607:f8b0:4864:20::634]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1r3jXz-004q5f-2F for linux-arm-kernel@lists.infradead.org; Thu, 16 Nov 2023 21:05:12 +0000 Received: by mail-pl1-x634.google.com with SMTP id d9443c01a7336-1cc29f39e7aso10496535ad.0 for ; Thu, 16 Nov 2023 13:05:09 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1700168709; x=1700773509; darn=lists.infradead.org; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=6LnOWp0wbZeObmNmr90HTPFuULXlWCJKvWy7NEbdx0E=; b=X7ihW5vksBZy5xHAXcZv8YLfL4MUypQc3rg5AFKueSN99ZeJy/6GBsoX1jI6oeY9PP n9AQ4u1Kaah1/kpLgIx2H73GTMReAShOjjneyJa5dSItUFNgPVUXnvw3FeDFlHPZiBYs ICKwZ0nPhKWAtBevPkmCyda3A1andUPhI2SYw= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1700168709; x=1700773509; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=6LnOWp0wbZeObmNmr90HTPFuULXlWCJKvWy7NEbdx0E=; b=mdJXokbZPFEBikVQ+KMqa0vzGekGKZTmk6dwcPCIN7zy0jcjEf8RHdm/8Gg3XwTRdm upGw36uwz25HqOGH9CtzfxJALS19t0dAJ7alZiWAVrgdPFxnDf4Ot7iTmZyvPoSs7cOB 1QBOePScPRHKhS4ssNI1d/hI/86fK/9HDflSjbALZCWO5VQIrCtF+N2X6driuC549FK1 G/pc9Iek2mbZB4/JoxMeEXSEdedOwXIrkVUxyQN5pr4/RFriWt4tdSQk9g6hinBSEtl0 9SNNNtDZ1VPX+6DUmpzeWLk0UDZ2zYtFk+VS3wkSGAP2o+LiCUeV1E/txZM98B+eR9bl hOkw== X-Gm-Message-State: AOJu0YwcpKiqRCaNlfA7fKmqmH6537m2iEiaIQnzbRF00F1W7CmzyrQW qcTUfjoWiNhQYwpHJMIYctXgEL41gJT6O/3Kpa4hIw== X-Google-Smtp-Source: AGHT+IHEcDMzDv8F2Oib5Qf07Br9pWMJl9y1OcHWOsIqcz/VA8rMATUHrvctjqpJr/W3EhXRV0fyVQ== X-Received: by 2002:a17:902:8209:b0:1c9:d0a0:ee88 with SMTP id x9-20020a170902820900b001c9d0a0ee88mr3479430pln.62.1700168709074; Thu, 16 Nov 2023 13:05:09 -0800 (PST) Received: from www.outflux.net (198-0-35-241-static.hfc.comcastbusiness.net. [198.0.35.241]) by smtp.gmail.com with ESMTPSA id iy4-20020a170903130400b001b86492d724sm93407plb.223.2023.11.16.13.05.08 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 16 Nov 2023 13:05:08 -0800 (PST) Date: Thu, 16 Nov 2023 13:05:07 -0800 From: Kees Cook To: "Gustavo A. R. Silva" Cc: Felix Fietkau , Lorenzo Bianconi , Ryder Lee , Shayne Chen , Sean Wang , Kalle Valo , 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, linux-hardening@vger.kernel.org Subject: Re: [PATCH][next] wifi: mt76: mt7996: Use DECLARE_FLEX_ARRAY() and fix -Warray-bounds warnings Message-ID: <202311161304.3B03C95B3@keescook> References: MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20231116_130511_786318_C27D3497 X-CRM114-Status: UNSURE ( 9.80 ) X-CRM114-Notice: Please train this message. X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Thu, Nov 16, 2023 at 02:57:24PM -0600, Gustavo A. R. Silva wrote: > Transform zero-length arrays `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:483:61: warning: array subscript is outside array bounds of 'struct [0]' [-Warray-bounds=] > drivers/net/wireless/mediatek/mt76/mt7996/mcu.c:490:58: warning: array subscript is outside array bounds of 'struct [0]' [-Warray-bounds=] > drivers/net/wireless/mediatek/mt76/mt7996/mcu.c:492:58: warning: array subscript is outside array bounds of 'struct [0]' [-Warray-bounds=] > drivers/net/wireless/mediatek/mt76/mt7996/mcu.c:469:61: warning: array subscript is outside array bounds of 'struct [0]' [-Warray-bounds=] > drivers/net/wireless/mediatek/mt76/mt7996/mcu.c:477:66: warning: array subscript is outside array bounds of 'struct [0]' [-Warray-bounds=] > drivers/net/wireless/mediatek/mt76/mt7996/mcu.c:479:66: warning: array subscript is outside array bounds of 'struct [0]' [-Warray-bounds=] > > This results in no differences in binary output, helps with the ongoing > efforts to globally enable -Warray-bounds. > > Signed-off-by: Gustavo A. R. Silva The syntax looks a little funny initially, but yeah, that's how we need to fix it for now. Reviewed-by: Kees Cook -- Kees Cook _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel