Re: [PATCH v3] wifi: mwifiex: replace one-element arrays with flexible array members
From: Dan Carpenter
Date: Thu Jul 16 2026 - 02:56:41 EST
On Thu, Jul 16, 2026 at 08:32:46AM +0200, Francesco Dolcini wrote:
> On Thu, Jul 16, 2026 at 09:27:23AM +0300, Dan Carpenter wrote:
> > On Thu, Jul 16, 2026 at 08:16:38AM +0200, Francesco Dolcini wrote:
> > > On Thu, Jul 16, 2026 at 03:17:28AM +0300, Georgi Valkov wrote:
> > > > Replace deprecated one-element arrays with flexible array members.
> > > > CONFIG_FORTIFY_SOURCE reports the following warning when
> > > > one-element arrays are used as variable-length buffers:
> > > >
> > > > sta_cmd.c:1033 mwifiex_sta_prepare_cmd
> > > > memcpy: detected field-spanning write (size 84) of single field
> > > > "domain->triplet" at .../marvell/mwifiex/sta_cmd.c:1033 (size 3)
> > > >
> > > > Convert affected structs to use flexible array members.
> > > > - Preserve existing wire layouts.
> > > > - Use DECLARE_FLEX_ARRAY() for structs inside affected unions.
> > > >
> > > > Tested-on: WRT3200ACM, OpenWrt
> > > > Signed-off-by: Georgi Valkov <gvalkov@xxxxxxxxx>
> > >
> > > Cc: stable@xxxxxxxxxxxxxxx # 6.12+
> > > Reviewed-by: Francesco Dolcini <francesco.dolcini@xxxxxxxxxxx>
> >
> > Are we CCing stable for this sort of thing? How many FORTIFY_SOURCE
> > warnings are still remaining?
>
> Yes, you are right, my mistake.
>
> Johannes, please be sure to not have the stable tag in once you apply the
> patch.
Wait... No no. It was a serious question. I guess these warnings
are pretty annoying for a real user on WRT so it's fine to CC stable.
I just assumed these warnings were more common still.
regards,
dan carpenter