Received: by 2002:ab2:1689:0:b0:1f7:5705:b850 with SMTP id d9csp1536778lqa; Mon, 29 Apr 2024 11:09:55 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCVtVM6qgJ6pAwoAGHXUNb2WIVV/9a5ID9ROYlpgVkn/8X7c9XQatZIdExWCZ0bQxltMUtwtHKYbD2iCOOhJghi5k6BkKvq0Ci6PxafTmw== X-Google-Smtp-Source: AGHT+IEVI8XI1F5knoAsqlEKdCkzv94JWciaiyqLnyda5i66hIb0s+RjW4YKp/aU8L/y4g+k+Cge X-Received: by 2002:a17:906:eb4f:b0:a58:fc3b:8c6e with SMTP id mc15-20020a170906eb4f00b00a58fc3b8c6emr3131814ejb.69.1714414195610; Mon, 29 Apr 2024 11:09:55 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1714414195; cv=pass; d=google.com; s=arc-20160816; b=pwWxqgFC9riMQjXhfBJ6xqEUNhCWyPhup+zK1SWZkII/25GmBK+QlD8dmOBrZSm2h5 0g4TZcNcKmEIibSNwb0Wi/IlPh7Rlm/VEWaackm5AWPf1XaVRl6K28+gnYUCco9OWAt8 1EuUdC4BvDHtaBrbGOeCE6+t/ov+4uxEWcKBO2s5SnkoM0vAD+pEQyoIDhIvws3JTGFy WA1SXNygJxsdWd/SfaM/D2OhF4ROaWuh+F1ZL80F/vH5r6ycYfh4i8GKcdeky/ADHzyK JkBKUtE8Z9yDQjKtQ5hbkdXJgiUiLM2bk20f1Tb87hnjdLiWDqag0ftfcN3haCeeQVci ry1w== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:content-disposition:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:message-id:subject:cc :to:from:date:dkim-signature; bh=+37QTrLTPLr7Kc5c3JRWh1bRwAteHaqsrzK+UmsL3Bk=; fh=a0ZEDBKXKkURj5gaR2o1AEXgaAe8vFgarmx0poVPW6o=; b=QPnu8riKq+7nLlFBO/YLPu/ShtlNpt4zpijNV2adLFKFTFSchmx1irdH1WTXu2LbC4 QxMc7bXAPrujKJs6VJOknTNRXQ/g+1Q+tkp5JhHwFCUDoqfuAnak9+1HIzXLgXA5GxLD OPkhOwwevigV4DGqPb45bMSVcdyxVPG5gQYp7bh2r+Ex6BWm5DBwUgmbcX+RCfNLrkGj 2nEDYaxWxYa+d6FaRaaZ98nf8d+pbF9MMfRrcMNbPNjeP3OZ1ZvX+pYuzDYEGF8cwL+l 1Gj891E7nnwnEvYHDc936p8pKQXg3vlKCP6JD1Dqadf2Sgj7OEHVdi5vJg1XlEsDHw6X nj9w==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=lsuajCu9; arc=pass (i=1 spf=pass spfdomain=chromium.org dkim=pass dkdomain=chromium.org dmarc=pass fromdomain=chromium.org); spf=pass (google.com: domain of linux-wireless+bounces-7002-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-wireless+bounces-7002-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id ce13-20020a170906b24d00b00a588075f57fsi7695002ejb.971.2024.04.29.11.09.55 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 29 Apr 2024 11:09:55 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-wireless+bounces-7002-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) client-ip=147.75.80.249; Authentication-Results: mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=lsuajCu9; arc=pass (i=1 spf=pass spfdomain=chromium.org dkim=pass dkdomain=chromium.org dmarc=pass fromdomain=chromium.org); spf=pass (google.com: domain of linux-wireless+bounces-7002-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-wireless+bounces-7002-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.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 am.mirrors.kernel.org (Postfix) with ESMTPS id 419051F20F34 for ; Mon, 29 Apr 2024 18:09:55 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 6E944128399; Mon, 29 Apr 2024 18:09:47 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=chromium.org header.i=@chromium.org header.b="lsuajCu9" X-Original-To: linux-wireless@vger.kernel.org Received: from mail-pl1-f177.google.com (mail-pl1-f177.google.com [209.85.214.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 790998614C for ; Mon, 29 Apr 2024 18:09:45 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.214.177 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714414187; cv=none; b=H4j4VcScKDrCPyAWNlsnP7C6FRNk7YI64nINchnnAQMYrk1ca6JEMUVkL3S21z14LhGWGgpVhHAxa1Lzj207VLSik0EHcRcjwHsHwdYKZnPgKb0VYKi6nBjxdmEyV0KRepvfl7HrQRPGQx0yhQCCffNMELB+wWCffUv96Hiu30E= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714414187; c=relaxed/simple; bh=Z2LOlsSUnMgywQTJQ+7IHJraqyXovy/jnHsooFxUr2Y=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=rEtUovddXuyS8LdkvZL2s8JgkHfLZKM7wKIXQcUqLYa4pw2+hOHdBtOmBUefYLq8y1HraraAWmw9IwUkO4qIxBDihUUp4EZ9DFdMNdTzSd/bwJV62mNt6g1xcf3qkfa/It4Nfq9xGY/27EezBRzPajOqehPCVlb+tpJa/CToWjI= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=chromium.org; spf=pass smtp.mailfrom=chromium.org; dkim=pass (1024-bit key) header.d=chromium.org header.i=@chromium.org header.b=lsuajCu9; arc=none smtp.client-ip=209.85.214.177 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=chromium.org Received: by mail-pl1-f177.google.com with SMTP id d9443c01a7336-1e8f68f8e0dso34546945ad.3 for ; Mon, 29 Apr 2024 11:09:45 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1714414185; x=1715018985; darn=vger.kernel.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=+37QTrLTPLr7Kc5c3JRWh1bRwAteHaqsrzK+UmsL3Bk=; b=lsuajCu9lzKisZS0vlaiK3l5CfrLPvM3MsxE/vnIpIx4TJCjD5I+Hh1uo8HaxWmdTY N04Wn1cCkUUmtK0GaLpxqw9x3ymfL1bVgJ3U7Yh+OCwBQN/1bMZfDiLzQDjPQOEbVE51 fy37YznGKXXXAyGK4sdIIr9ks+PrxxlCl64U0= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1714414185; x=1715018985; 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=+37QTrLTPLr7Kc5c3JRWh1bRwAteHaqsrzK+UmsL3Bk=; b=T9E4tIMSdFX+pc7TLSoMcXVXm9sIdJIewS+AiJeES32tMDJv+JKZ3MT6FQAEe9psSP 3m5o8mDvsML/1I8jGCGbVu1MJ8caVPJZAM1TiHBzEWw/H7bDwRMesopXHTXUekahdM+L P0vb/NjcZ3D4szZvyNCyMxT26QVI+eQYcbkKUorSVejvUAZ8ERWN8URbjSNFhICf7hui RDdz9PbO1rwB0Rw8hn/s0TeHtfAz8itw5mBMk2SCdq+tGfpJjMMBft+qRhuxiKMm1SNI LjzbJyo3Igyie5GoH0Yie5Z28PthmvYR228XLSb6ajB9WypEmpjabOWDKHKOaaU31thW Z7Iw== X-Forwarded-Encrypted: i=1; AJvYcCXyr98+R/iuycE8PQcQBvFgBE+7yjb6q3ZWkZ22KN6Jw0pNabichOfGiFAy3XGVB1Jf+b9IEn4/dvm31GaC0vgsegg57OCq64PLdey8W5Y= X-Gm-Message-State: AOJu0YxlfRgYbWFT5xJ6tgdD+Q7YsO3Pxa7tO135gQ4oC1SHCFgcE75L r8R4fj6pmresEzXG7tC3mG+QYAVVnD1oB8R4i27nfYsC4sQwwbOBns6mq5wCqQ== X-Received: by 2002:a17:903:22c5:b0:1eb:e40:3e07 with SMTP id y5-20020a17090322c500b001eb0e403e07mr9620367plg.62.1714414184798; Mon, 29 Apr 2024 11:09:44 -0700 (PDT) Received: from www.outflux.net ([198.0.35.241]) by smtp.gmail.com with ESMTPSA id h8-20020a170902704800b001e868e29fabsm20585009plt.251.2024.04.29.11.09.44 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 29 Apr 2024 11:09:44 -0700 (PDT) Date: Mon, 29 Apr 2024 11:09:43 -0700 From: Kees Cook To: Kalle Valo Cc: "Gustavo A. R. Silva" , Jeff Johnson , linux-wireless@vger.kernel.org, linux-kernel@vger.kernel.org, linux-hardening@vger.kernel.org Subject: Re: [PATCH v2][next] wifi: wil6210: wmi: Use __counted_by() in struct wmi_set_link_monitor_cmd and avoid -Wfamnae warning Message-ID: <202404291109.331E1704@keescook> References: <171222554691.1806092.8730005090791383928.kvalo@kernel.org> <202404291008.51DB333F@keescook> <877cggqdwb.fsf@kernel.org> Precedence: bulk X-Mailing-List: linux-wireless@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <877cggqdwb.fsf@kernel.org> On Mon, Apr 29, 2024 at 08:25:56PM +0300, Kalle Valo wrote: > Kees Cook writes: > > > On Thu, Apr 04, 2024 at 10:12:28AM +0000, Kalle Valo wrote: > > > >> "Gustavo A. R. Silva" wrote: > >> > >> > Prepare for the coming implementation by GCC and Clang of the > >> > __counted_by attribute. Flexible array members annotated with > >> > __counted_by can have their accesses bounds-checked at run-time > >> > via CONFIG_UBSAN_BOUNDS (for array indexing) and CONFIG_FORTIFY_SOURCE > >> > (for strcpy/memcpy-family functions). > >> > > >> > Also, -Wflex-array-member-not-at-end is coming in GCC-14, and we are > >> > getting ready to enable it globally. > >> > > >> > So, use the `DEFINE_FLEX()` helper for an on-stack definition of > >> > a flexible structure where the size of the flexible-array member > >> > is known at compile-time, and refactor the rest of the code, > >> > accordingly. > >> > > >> > So, with these changes, fix the following warning: > >> > drivers/net/wireless/ath/wil6210/wmi.c:4018:49: warning: structure > >> > containing a flexible array member is not at the end of another > >> > structure [-Wflex-array-member-not-at-end] > >> > > >> > Link: https://github.com/KSPP/linux/issues/202 > >> > Signed-off-by: Gustavo A. R. Silva > >> > Reviewed-by: Jeff Johnson > >> > Signed-off-by: Kalle Valo > >> > >> Patch applied to ath-next branch of ath.git, thanks. > >> > >> cbb0697e0ded wifi: wil6210: wmi: Use __counted_by() in struct > >> wmi_set_link_monitor_cmd and avoid -Wfamnae warning > > > > Hi, > > > > I was just walking through our patch tracker and noticed that I don't > > see this patch include in -next yet (as of next-20240429). Is there a > > flush of the ath-next queue planned soon? Or did I miss some change? > > Yeah, wireless-next was pulled last week so most likely we will create > ath-next pull request this week. > > BTW we are planning to move ath.git to a new location, rename branches > etc. I think we'll see if we can also setup it so that it can be pulled > to linux-next, so that you don't need to ask this every time ;) > > (Just joking of course, there a lot of benefits from having the tree in > linux-next) Ah-ha! Thanks. Yeah, sorry if I keep asking about that. It's different from other trees, so it doesn't stick in my head. :) I should keep better notes! -- Kees Cook