[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20240228144148.5c227487@kernel.org>
Date: Wed, 28 Feb 2024 14:41:48 -0800
From: Jakub Kicinski <kuba@...nel.org>
To: Kees Cook <keescook@...omium.org>
Cc: Andy Shevchenko <andriy.shevchenko@...ux.intel.com>, Vinod Koul
<vkoul@...nel.org>, Linus Walleij <linus.walleij@...aro.org>, Jonathan
Cameron <Jonathan.Cameron@...wei.com>, Mark Brown <broonie@...nel.org>,
linux-arm-kernel@...ts.infradead.org, dmaengine@...r.kernel.org,
linux-kernel@...r.kernel.org, linux-iio@...r.kernel.org,
linux-spi@...r.kernel.org, netdev@...r.kernel.org,
linux-hardening@...r.kernel.org, Jonathan Cameron <jic23@...nel.org>,
Lars-Peter Clausen <lars@...afoo.de>, "David S. Miller"
<davem@...emloft.net>, Eric Dumazet <edumazet@...gle.com>, Paolo Abeni
<pabeni@...hat.com>, "Gustavo A. R. Silva" <gustavoars@...nel.org>
Subject: Re: [PATCH v4 7/8] net-device: Use new helpers from overflow.h in
netdevice APIs
On Wed, 28 Feb 2024 13:46:10 -0800 Kees Cook wrote:
> I really don't like hiding these trailing allocations from the compiler.
> Why can't something like this be done (totally untested):
>
>
> diff --git a/include/linux/netdevice.h b/include/linux/netdevice.h
> index 118c40258d07..dae6df4fb177 100644
> --- a/include/linux/netdevice.h
> +++ b/include/linux/netdevice.h
> @@ -2475,6 +2475,8 @@ struct net_device {
> /** @page_pools: page pools created for this netdevice */
> struct hlist_head page_pools;
> #endif
> + u32 priv_size;
> + u8 priv_data[] __counted_by(priv_size) __aligned(NETDEV_ALIGN);
I like, FWIW, please submit! :)
Powered by blists - more mailing lists