Thread (38 messages) 38 messages, 9 authors, 2024-03-03

Re: [PATCH v4 7/8] net-device: Use new helpers from overflow.h in netdevice APIs

From: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Date: 2024-02-28 21:53:25
Also in: dmaengine, linux-arm-kernel, linux-hardening, linux-iio, linux-spi, lkml

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:
...
quoted
 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

Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help