Re: [syzbot] linux-next test error: WARNING in set_peer

2022-09-13 Thread Kees Cook
diffoscope shows the bounds check gets updated to the full union size: │ - cmp$0x11,%edx │ + cmp$0x1d,%edx and the field name changes in the warning: $ strings clang/drivers/net/wireguard/netlink.o.after | grep ^field field "" at drivers/net/wireguard/netlink.c:446 -- Kees Cook

[PATCH v2 net-next 1/2] skbuff: Move conditional preprocessor directives out of struct sk_buff

2021-11-20 Thread Kees Cook
[1] https://www.spinics.net/lists/linux-sparse/msg10857.html Signed-off-by: Kees Cook --- include/linux/skbuff.h | 36 +++- net/core/filter.c | 10 +- 2 files changed, 24 insertions(+), 22 deletions(-) diff --git a/include/linux/skbuff.h b/include/linu

[PATCH v2 net-next 2/2] skbuff: Switch structure bounds to struct_group()

2021-11-20 Thread Kees Cook
with a struct_group(). This will allow memcpy() and sizeof() to more easily reason about sizes, and improve readability. "pahole" shows no size nor member offset changes to struct sk_buff. "objdump -d" shows no object code changes (outside of WARNs affected by source line nu

[PATCH v2 net-next 0/2] skbuff: Switch structure bounds to struct_group()

2021-11-20 Thread Kees Cook
Hi, This is a pair of patches to add struct_group() to struct sk_buff. The first is needed to work around sparse-specific complaints, and is new for v2. The second patch is the same as originally sent as v1. -Kees Kees Cook (2): skbuff: Move conditional preprocessor directives out of struct

Re: [PATCH] skbuff: Switch structure bounds to struct_group()

2021-11-19 Thread Kees Cook
On Fri, Nov 19, 2021 at 10:53:05AM -0800, Jakub Kicinski wrote: > On Fri, 19 Nov 2021 10:41:44 -0800 Jakub Kicinski wrote: > > On Fri, 19 Nov 2021 10:26:19 -0800 Kees Cook wrote: > > > On Thu, Nov 18, 2021 at 11:13:55PM -0800, Jakub Kicinski wrote: > > > > This adds

Re: [PATCH] skbuff: Switch structure bounds to struct_group()

2021-11-19 Thread Kees Cook
On Thu, Nov 18, 2021 at 11:13:55PM -0800, Jakub Kicinski wrote: > On Thu, 18 Nov 2021 10:36:15 -0800 Kees Cook wrote: > > In preparation for FORTIFY_SOURCE performing compile-time and run-time > > field bounds checking for memcpy(), memmove(), and memset(), avoid > > intenti

Re: [PATCH] skbuff: Switch structure bounds to struct_group()

2021-11-19 Thread Kees Cook
On Thu, Nov 18, 2021 at 11:13:55PM -0800, Jakub Kicinski wrote: > On Thu, 18 Nov 2021 10:36:15 -0800 Kees Cook wrote: > > In preparation for FORTIFY_SOURCE performing compile-time and run-time > > field bounds checking for memcpy(), memmove(), and memset(), avoid > > intenti

[PATCH] skbuff: Switch structure bounds to struct_group()

2021-11-18 Thread Kees Cook
with a struct_group(). This will allow memcpy() and sizeof() to more easily reason about sizes, and improve readability. "pahole" shows no size nor member offset changes to struct sk_buff. "objdump -d" shows no object code changes (outside of WARNs affected by source line nu

[PATCH v2 07/63] skbuff: Switch structure bounds to struct_group()

2021-08-18 Thread Kees Cook
changes). Cc: "Jason A. Donenfeld" Cc: "David S. Miller" Cc: Jakub Kicinski Cc: Jonathan Lemon Cc: Alexander Lobakin Cc: Jakub Sitnicki Cc: Marco Elver Cc: Willem de Bruijn Cc: wireguard@lists.zx2c4.com Cc: net...@vger.kernel.org Signed-off-by: Kees Cook Reviewed