Re: [ovs-dev] [PATCH 02/12] skbuff: Proactively round up to kmalloc bucket size

2022-09-22 Thread Jakub Kicinski
On Wed, 21 Sep 2022 20:10:03 -0700 Kees Cook wrote: > diff --git a/net/core/skbuff.c b/net/core/skbuff.c > index 974e7138..4fe4c7544c1d 100644 > --- a/net/core/skbuff.c > +++ b/net/core/skbuff.c > @@ -427,14 +427,15 @@ struct sk_buff *__alloc_skb(unsigned int size, gfp_t > gfp_mask, >

[ovs-dev] [PATCH 02/12] skbuff: Proactively round up to kmalloc bucket size

2022-09-22 Thread Kees Cook
Instead of discovering the kmalloc bucket size _after_ allocation, round up proactively so the allocation is explicitly made for the full size, allowing the compiler to correctly reason about the resulting size of the buffer through the existing __alloc_size() hint. This will allow for kernels