[PATCH v4 7/8] net-device: Use new helpers from overflow.h in netdevice APIs
Andy Shevchenko
andriy.shevchenko at linux.intel.com
Wed Feb 28 13:53:17 PST 2024
On Wed, Feb 28, 2024 at 01:46:10PM -0800, Kees Cook wrote:
> On Wed, Feb 28, 2024 at 10:41:37PM +0200, Andy Shevchenko wrote:
...
> > static inline void *netdev_priv(const struct net_device *dev)
> > {
> > - return (char *)dev + ALIGN(sizeof(struct net_device), NETDEV_ALIGN);
> > + return struct_data_pointer(dev, NETDEV_ALIGN);
> > }
>
> I really don't like hiding these trailing allocations from the compiler.
> Why can't something like this be done (totally untested):
Below is interesting idea, now at least I started understanding your previous
comments.
--
With Best Regards,
Andy Shevchenko
More information about the linux-arm-kernel
mailing list