Re: [syzbot] Re: [syzbot] [net?] KMSAN: uninit-value in nsim_get_ringparam

From: syzbot
Date: Thu Jan 23 2025 - 14:47:15 EST


For archival purposes, forwarding an incoming command email to
linux-kernel@xxxxxxxxxxxxxxx, syzkaller-bugs@xxxxxxxxxxxxxxxx.

***

Subject: Re: [syzbot] [net?] KMSAN: uninit-value in nsim_get_ringparam
Author: kuba@xxxxxxxxxx

On Thu, 23 Jan 2025 08:35:28 -0800 syzbot wrote:
> HEAD commit: 7004a2e46d16 Merge tag 'linux_kselftest-nolibc-6.14-rc1' o..
> git tree: upstream
> console+strace: https://syzkaller.appspot.com/x/log.txt?x=171a1c24580000
> kernel config: https://syzkaller.appspot.com/x/.config?x=d6a5cefe7199b4e8
> dashboard link: https://syzkaller.appspot.com/bug?extid=b3bcd80232d00091e061
> compiler: Debian clang version 15.0.6, GNU ld (GNU Binutils for Debian) 2.40
> syz repro: https://syzkaller.appspot.com/x/repro.syz?x=16a2a9f8580000
> C reproducer: https://syzkaller.appspot.com/x/repro.c?x=12baf618580000
>
> Downloadable assets:
> disk image: https://storage.googleapis.com/syzbot-assets/d5b55fed9d79/disk-7004a2e4.raw.xz
> vmlinux: https://storage.googleapis.com/syzbot-assets/70382af6f618/vmlinux-7004a2e4.xz
> kernel image: https://storage.googleapis.com/syzbot-assets/a7609fc3059d/bzImage-7004a2e4.xz
>
> IMPORTANT: if you fix the issue, please add the following tag to the commit:
> Reported-by: syzbot+b3bcd80232d00091e061@xxxxxxxxxxxxxxxxxxxxxxxxx

#syz test

diff --git a/drivers/net/netdevsim/ethtool.c b/drivers/net/netdevsim/ethtool.c
index 3b23f3d3ca2b..5c80fbee7913 100644
--- a/drivers/net/netdevsim/ethtool.c
+++ b/drivers/net/netdevsim/ethtool.c
@@ -74,7 +74,7 @@ static void nsim_get_ringparam(struct net_device *dev,
memcpy(ring, &ns->ethtool.ring, sizeof(ns->ethtool.ring));
kernel_ring->hds_thresh_max = NSIM_HDS_THRESHOLD_MAX;

- if (kernel_ring->tcp_data_split == ETHTOOL_TCP_DATA_SPLIT_UNKNOWN)
+ if (dev->cfg->hds_config == ETHTOOL_TCP_DATA_SPLIT_UNKNOWN)
kernel_ring->tcp_data_split = ETHTOOL_TCP_DATA_SPLIT_ENABLED;
}