lkml.org 
[lkml]   [2024]   [Feb]   [29]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH v4 7/8] net-device: Use new helpers from overflow.h in netdevice APIs
On Wed, Feb 28, 2024 at 04:01:49PM -0800, Kees Cook wrote:
> On Wed, Feb 28, 2024 at 02:41:48PM -0800, Jakub Kicinski wrote:
> > On Wed, 28 Feb 2024 13:46:10 -0800 Kees Cook wrote:

..

> But I still like the idea -- Gustavo has been solving these cases with
> having two structs, e.g.:
>
> struct net_device {
> ...unchanged...
> };
>
> struct net_device_alloc {
> struct net_device dev;
> u32 priv_size;
> u8 priv_data[] __counted_by(priv_size) __aligned(NETDEV_ALIGN);
> };
>
> And internals can use struct net_device_alloc...

I just realized that I made same approach in

f6d7f050e258 ("spi: Don't use flexible array in struct spi_message definition")
75e308ffc4f0 ("spi: Use struct_size() helper")


--
With Best Regards,
Andy Shevchenko



\
 
 \ /
  Last update: 2024-05-27 15:28    [W:0.129 / U:1.740 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site