]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
netdevsim: zero initialize struct iphdr in dummy sk_buff
authorNikola Z. Ivanov <zlatistiv@gmail.com>
Sun, 26 Apr 2026 20:14:34 +0000 (23:14 +0300)
committerJakub Kicinski <kuba@kernel.org>
Tue, 28 Apr 2026 00:03:13 +0000 (17:03 -0700)
commit35eaa6d8d6c2ee65e96f507add856e0eacf24591
tree2e0a73b30e2b7bff1ae09cebdfb252e2502891a1
parent3618442d54f366eeee8f6c83a47861ca22918dfe
netdevsim: zero initialize struct iphdr in dummy sk_buff

Syzbot reports a KMSAN uninit-value originating from
nsim_dev_trap_skb_build, with the allocation also
being performed in the same function.

Fix this by calling skb_put_zero instead of skb_put to
guarantee zero initialization of the whole IP header.

Closes: https://syzkaller.appspot.com/bug?extid=23d7fcd204e3837866ff
Fixes: da58f90f11f5 ("netdevsim: Add devlink-trap support")
Signed-off-by: Nikola Z. Ivanov <zlatistiv@gmail.com>
Reviewed-by: Eric Dumazet <edumazet@google.com>
Link: https://patch.msgid.link/20260426201434.742030-1-zlatistiv@gmail.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
drivers/net/netdevsim/dev.c