linux/drivers/net/netdevsim
Nikola Z. Ivanov 6e2cfd0904 netdevsim: zero initialize struct iphdr in dummy sk_buff
[ Upstream commit 35eaa6d8d6 ]

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: da58f90f11 ("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>
Signed-off-by: Sasha Levin <sashal@kernel.org>
History 2026-06-01 17:35:42 +02:00
..
bpf.c netdevsim: Avoid allocation warnings triggered from user space 2022-08-17 14:23:36 +02:00
bus.c Driver core update for 5.15-rc1 2021-09-01 08:44:42 -07:00
dev.c netdevsim: zero initialize struct iphdr in dummy sk_buff 2026-06-01 17:35:42 +02:00
ethtool.c netdevsim: don't overwrite read only ethtool parms 2021-12-22 09:32:40 +01:00
fib.c netdevsim: Add trailing zero to terminate the string in nsim_nexthop_bucket_activity_write() 2024-11-08 16:25:53 +01:00
health.c netdevsim: prevent bad user input in nsim_dev_health_break_write() 2025-01-09 13:28:31 +01:00
ipsec.c netdevsim: print human readable IP address 2025-03-13 12:50:46 +01:00
Makefile netdevsim: Add dummy psample implementation 2021-03-14 15:00:43 -07:00
netdev.c net: Use u64_stats_fetch_begin_irq() for stats fetch. 2022-09-08 12:28:07 +02:00
netdevsim.h net: netdevsim: try to close UDP port harness races 2025-03-13 12:50:12 +01:00
psample.c netdevsim: Only use sampling truncation length when valid 2021-04-22 13:23:56 -07:00
udp_tunnels.c net: netdevsim: try to close UDP port harness races 2025-03-13 12:50:12 +01:00