[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <Z6DqbURqt0EDg5mV@smile.fi.intel.com>
Date: Mon, 3 Feb 2025 18:10:21 +0200
From: Andy Shevchenko <andriy.shevchenko@...ux.intel.com>
To: Greg Kroah-Hartman <gregkh@...uxfoundation.org>
Cc: "Rafael J. Wysocki" <rafael@...nel.org>,
Danilo Krummrich <dakr@...nel.org>, Lyude Paul <lyude@...hat.com>,
Alexander Lobakin <aleksander.lobakin@...el.com>,
Bjorn Helgaas <bhelgaas@...gle.com>,
Jonathan Cameron <Jonathan.Cameron@...wei.com>,
Liam Girdwood <lgirdwood@...il.com>, Lukas Wunner <lukas@...ner.de>,
Mark Brown <broonie@...nel.org>,
MaĆra Canal <mairacanal@...eup.net>,
Robin Murphy <robin.murphy@....com>,
Simona Vetter <simona.vetter@...ll.ch>,
Zijun Hu <quic_zijuhu@...cinc.com>, linux-kernel@...r.kernel.org,
linux-usb@...r.kernel.org, rust-for-linux@...r.kernel.org
Subject: Re: [PATCH 1/3] driver core: add a faux bus for use when a simple
device/bus is needed
On Mon, Feb 03, 2025 at 06:05:20PM +0200, Andy Shevchenko wrote:
> On Mon, Feb 03, 2025 at 04:35:45PM +0100, Greg Kroah-Hartman wrote:
> > On Mon, Feb 03, 2025 at 05:11:03PM +0200, Andy Shevchenko wrote:
> > > On Mon, Feb 03, 2025 at 03:25:17PM +0100, Greg Kroah-Hartman wrote:
...
> > > > + faux_obj = kzalloc(sizeof(*faux_obj) + strlen(name) + 1, GFP_KERNEL);
> > >
> > > Potential overflow. To avoid one may use struct_size() from overflow.h.
> >
> > Users should not be providing the string here. Again, this comes from
> > platform.c.
>
> I'm not sure I follow. The name parameter is not limited anyhow, so one may
> provide non-terminated string and strlen() will return an arbitrary number.
> Potentially this can lead to big numbers and become an overflow when gets
> to a parameter for kmalloc(). This most likely never happen in real life,
> but still the overflow is possible.
After reading your other messages I got what you are talking about here.
Now it's all clear.
--
With Best Regards,
Andy Shevchenko
Powered by blists - more mailing lists