From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from sipsolutions.net (s3.sipsolutions.net [168.119.38.16]) (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 AB8FD1925AB; Fri, 25 Oct 2024 20:25:45 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=168.119.38.16 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1729887947; cv=none; b=V/SNKIIOWmJkEM8qeTrMxmkJBbkm2yWHOVhaJszOibxIRrD/adHZ+B0Sgxq2RhkDTEzRU2C4lFg9slEzDBr0syKNA8GsXW5HbB/Jma8bdOgkhAUI9yZS9j9KQ+Xmn7XVkX/hKi5XDUJWCWEAdGKV+4iU582pIaHC9cMrlgEdpzY= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1729887947; c=relaxed/simple; bh=+uvNZhiKMfXPyAmXlafRXJFnq8VZYZZxiNWopDKs70A=; h=Message-ID:Subject:From:To:Cc:Date:In-Reply-To:References: Content-Type:MIME-Version; b=l1lYFEFApe/VFmke3WzeboYQfqAUKnE+e+PLqChLZiRMUVESNo8WPIgzW3lO0zJZ8SzrEmBRpcRhxLoLzKlxHcsAYmUo+gSq0axE5EIkpz73w3fl/I/edyU0VOL915HEyn7mPmvXh4uUWp6ez7Leuy59k4Ra61ZXWBtxgLvRncA= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=sipsolutions.net; spf=pass smtp.mailfrom=sipsolutions.net; dkim=pass (2048-bit key) header.d=sipsolutions.net header.i=@sipsolutions.net header.b=AmBqbuWH; arc=none smtp.client-ip=168.119.38.16 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=sipsolutions.net Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=sipsolutions.net Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=sipsolutions.net header.i=@sipsolutions.net header.b="AmBqbuWH" DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=sipsolutions.net; s=mail; h=MIME-Version:Content-Transfer-Encoding: Content-Type:References:In-Reply-To:Date:Cc:To:From:Subject:Message-ID:Sender :Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From:Resent-To: Resent-Cc:Resent-Message-ID; bh=mmfjn9qAXgCKtjiC5i7/9rC4rJePLAhu4PSD7Uub1g0=; t=1729887945; x=1731097545; b=AmBqbuWH0et39XBZpflftQjd2m15mIsR3Tcb/t7TW0vcPCg +cIOVSGxVNTl2f2Kx3rMPCVF9yZxLqiPwEkaL9KabtMy2H76rzEgf0WKGJ4wSh/hbIThy7aunpDPh oRZiCyrU+mZMSoOjEliLxkvS3tRhw2UMKXfDCoZ+3xrCsJ9Z6nBHYLzQkWUcGZW/Gv7ioatar7ga2 BGFq9Ns0eiHQS+yUT8qK+GPX7Rn7nwnu08aeMc0V6UtJK5Mxa4pZBtKHxn4kWntL/tqJpvpFIeu+Z 6FtNjsMUi4wOztruScYULkuvIn7pMYUitE7GhGXt/TVRzGWtiaxnbZokc5jV0H2A==; Received: by sipsolutions.net with esmtpsa (TLS1.3:ECDHE_X25519__RSA_PSS_RSAE_SHA256__AES_256_GCM:256) (Exim 4.98) (envelope-from ) id 1t4QsP-00000004gmH-2Dd7; Fri, 25 Oct 2024 22:25:41 +0200 Message-ID: <5c48b4529bf552d5c16b4dcc951c653f37b6a68e.camel@sipsolutions.net> Subject: Re: [PATCH][next] wifi: mac80211: ieee80211_i: Avoid dozens of -Wflex-array-member-not-at-end warnings From: Johannes Berg To: "Gustavo A. R. Silva" , "Gustavo A. R. Silva" Cc: linux-wireless@vger.kernel.org, linux-kernel@vger.kernel.org, linux-hardening@vger.kernel.org, Aditya Kumar Singh Date: Fri, 25 Oct 2024 22:25:40 +0200 In-Reply-To: <3471e59f-a414-479f-8fb0-aa1a26aecf16@embeddedor.com> References: <3471e59f-a414-479f-8fb0-aa1a26aecf16@embeddedor.com> Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable User-Agent: Evolution 3.52.4 (3.52.4-2.fc40) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-malware-bazaar: not-scanned On Fri, 2024-10-25 at 14:22 -0600, Gustavo A. R. Silva wrote: >=20 > > > - struct ieee80211_chanctx_conf conf; > > > - > > > bool radar_detected; > > > + > > > + /* MUST be last - ends in a flexible-array member. */ > > > + struct ieee80211_chanctx_conf conf; > > > }; > >=20 > > Oi. That's not just a warnings problem, that's actually a pretty stupid > > bug, this will surely get used and radar_detected will alias stuff that > > the driver puts there - at least for drivers using chanctx_data_size, > > which is a couple: ath9k, iwlmvm, mt792x, rwt89 and hwsim. > >=20 > > Could you resend with a description that this is a bugfix and > >=20 > > Fixes: bca8bc0399ac ("wifi: mac80211: handle ieee80211_radar_detected()= for MLO") >=20 > Yeah, I was actually going to mention this commit, as it's the one that i= ntroduced > that `bool radar_detected` to the flex struct. However, it wasn't obvious= to me > how `struct ieee80211_chanctx_conf conf` could overwrite `radar_detected`= as I didn't > see `conf->drv_priv` being accessed through `struct struct ieee80211_chan= ctx_conf`. You have to look at the drivers, see hwsim_clear_chanctx_magic() for example; I wonder why hwsim_check_chanctx_magic() never caught this. > > please? Or I can do it myself I guess, but ... >=20 > Sure thing. I can CC stable as well. Thanks! No need for stable, it got introduced in 6.12-rc1 only. johannes