[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <69fae096f556414c96a71747f49d1e08@AcuMS.aculab.com>
Date: Thu, 30 Jan 2020 10:37:07 +0000
From: David Laight <David.Laight@...LAB.COM>
To: 'Greg KH' <gregkh@...uxfoundation.org>,
'Eric Biggers' <ebiggers@...nel.org>
CC: 'Tetsuo Handa' <penguin-kernel@...ove.sakura.ne.jp>,
"'gustavo@...eddedor.com'" <gustavo@...eddedor.com>,
"'linux-kernel@...r.kernel.org'" <linux-kernel@...r.kernel.org>
Subject: RE: [PATCH] hpet: Fix struct_size() in kzalloc()
> ...
> > > > - hpetp = kzalloc(struct_size(hpetp, hp_dev, hdp->hd_nirqs - 1),
> > > > + hpetp = kzalloc(struct_size(hpetp, hp_dev, hdp->hd_nirqs),
> > > > GFP_KERNEL);
> > > >
> > > > if (!hpetp)
> > > > --
> > >
> > > Yep, "char: hpet: Use flexible-array member" started causing random boot
> > > failures on mainline for me. Tetsuo beat me to sending the fix.
> > >
> > > Only thing I'll add is that GFP_KERNEL can now fit on the previous line.
> >
> > Gustavo already sent a fix for this, I didn't realize it was causing
> > boot problems, I'll forward it on to Linus soon.
>
> grep -r --include '*.c' 'struct_size.*- 1'
> gives 4 other matches.
> I bet they all have the same bug.
> There might be others that simple pattern doesn't find.
kvm_main.c is ok - although why it reallocates 1 entry smaller on
delete is any bodies guess.
megaraid_sas_fusion.c is broken, header has seq[1]
(and lots of __packed).
iavf_virtchnl.c is broken, header has list[1].
ice_sched.c is broken, header has generic[1].
David
-
Registered Address Lakeside, Bramley Road, Mount Farm, Milton Keynes, MK1 1PT, UK
Registration No: 1397386 (Wales)
Powered by blists - more mailing lists