Re: UBSAN: annotation to skip sanitization in variable that will wrap

2024-08-15 Thread Breno Leitao
Hello Justin, On Wed, Aug 14, 2024 at 02:05:49PM -0700, Justin Stitt wrote: > > I am seeing some signed-integer-overflow in percpu reference counters. > > it is brave of you to enable this sanitizer :>) UBSAN has been somehow useful to pick some problems, so, I try to invest some time understand

UBSAN: annotation to skip sanitization in variable that will wrap

2024-08-14 Thread Breno Leitao
Hello, I am seeing some signed-integer-overflow in percpu reference counters. UBSAN: signed-integer-overflow in ./arch/arm64/include/asm/atomic_lse.h:204:1 -9223372036854775808 - 1 cannot be represented in type 's64' (aka 'long long') Call trace: handle_overflo

[PATCH net-next v3] netdevice: define and allocate &net_device _properly_

2024-07-10 Thread Breno Leitao
loc_netdev_mqs14811450 -31 On x86_64 with several NICs of different vendors, I was never able to get a &net_device pointer not aligned to the cacheline size after the change. Signed-off-by: Alexander Lobakin Signed-off-by: Breno Leitao Reviewed-by: Przemek Kitszel Reviewe

Re: [PATCH net-next v2] netdevice: define and allocate &net_device _properly_

2024-07-10 Thread Breno Leitao
Hello Eric, On Tue, Jul 09, 2024 at 08:27:45AM -0700, Eric Dumazet wrote: > On Tue, Jul 9, 2024 at 5:54 AM Breno Leitao wrote: > > @@ -2596,7 +2599,7 @@ void dev_net_set(struct net_device *dev, struct net > > *net) > > */ > > static inline void *netdev_priv(c

Re: [PATCH net-next v2] netdevice: define and allocate &net_device _properly_

2024-07-09 Thread Breno Leitao
On Tue, Jul 09, 2024 at 08:27:45AM -0700, Eric Dumazet wrote: > On Tue, Jul 9, 2024 at 5:54 AM Breno Leitao wrote: > > @@ -2596,7 +2599,7 @@ void dev_net_set(struct net_device *dev, struct net > > *net) > > */ > > static inline void *netdev_priv(c

Re: [PATCH net-next v2] netdevice: define and allocate &net_device _properly_

2024-07-09 Thread Breno Leitao
On Tue, Jul 09, 2024 at 07:11:28PM +0100, Simon Horman wrote: > On Tue, Jul 09, 2024 at 05:54:25AM -0700, Breno Leitao wrote: > > From: Alexander Lobakin > > > > In fact, this structure contains a flexible array at the end, but > > historically its size, alignment e

[PATCH net-next v2] netdevice: define and allocate &net_device _properly_

2024-07-09 Thread Breno Leitao
loc_netdev_mqs14811450 -31 On x86_64 with several NICs of different vendors, I was never able to get a &net_device pointer not aligned to the cacheline size after the change. Signed-off-by: Alexander Lobakin Signed-off-by: Breno Leitao Reviewed-by: Przemek Kitszel

Re: [PATCH net-next] netdevice: define and allocate &net_device _properly_

2024-06-21 Thread Breno Leitao
On Fri, Jun 14, 2024 at 05:00:54AM -0700, Breno Leitao wrote: > On Wed, May 08, 2024 at 11:13:21AM +0200, Alexander Lobakin wrote: > > From: Jakub Kicinski > > Date: Tue, 7 May 2024 11:10:35 -0700 > > > > > On Tue, 7 May 2024 14:39:37 +0200 Alexander Lobakin w

Re: [PATCH net-next] netdevice: define and allocate &net_device _properly_

2024-06-14 Thread Breno Leitao
On Wed, May 08, 2024 at 11:13:21AM +0200, Alexander Lobakin wrote: > From: Jakub Kicinski > Date: Tue, 7 May 2024 11:10:35 -0700 > > > On Tue, 7 May 2024 14:39:37 +0200 Alexander Lobakin wrote: > >> There are several instances of the structure embedded into other > >> structures, but also there'

Re: [PATCH] netdev: Use flexible array for trailing private bytes

2024-03-06 Thread Breno Leitao
On Thu, Feb 29, 2024 at 10:59:10PM -0800, Jakub Kicinski wrote: > On Thu, 29 Feb 2024 13:30:22 -0800 Kees Cook wrote: > > Introduce a new struct net_device_priv that contains struct net_device > > but also accounts for the commonly trailing bytes through the "size" and > > "data" members. > > I'm