From: Eric Dumazet <eric.dumazet@gmail.com>
To: syzbot <syzbot+b11c500e990cac6ba129@syzkaller.appspotmail.com>,
claudiajkang@gmail.com, davem@davemloft.net,
ennoerlangen@gmail.com, george.mccollister@gmail.com,
glider@google.com, kuba@kernel.org, linux-kernel@vger.kernel.org,
netdev@vger.kernel.org, pabeni@redhat.com,
syzkaller-bugs@googlegroups.com,
George McCollister <george.mccollister@gmail.com>,
Eric Dumazet <edumazet@google.com>
Subject: Re: [syzbot] KMSAN: uninit-value in hsr_fill_frame_info (2)
Date: Wed, 12 Oct 2022 12:25:27 -0700 [thread overview]
Message-ID: <960459eb-c8c3-bb75-f1ea-8995e511f826@gmail.com> (raw)
In-Reply-To: <000000000000d7639205eadb267a@google.com>
On 10/12/22 12:10, syzbot wrote:
> Hello,
>
> syzbot found the following issue on:
>
> HEAD commit: d6e2c8c7eb40 x86: kmsan: enable KMSAN builds for x86
> git tree: https://github.com/google/kmsan.git master
> console+strace: https://syzkaller.appspot.com/x/log.txt?x=143fe3c6f00000
> kernel config: https://syzkaller.appspot.com/x/.config?x=65d9eb7bfd2865c9
> dashboard link: https://syzkaller.appspot.com/bug?extid=b11c500e990cac6ba129
> compiler: clang version 14.0.0 (/usr/local/google/src/llvm-git-monorepo 2b554920f11c8b763cd9ed9003f4e19b919b8e1f), GNU ld (GNU Binutils for Debian) 2.35.2
> syz repro: https://syzkaller.appspot.com/x/repro.syz?x=1257629ef00000
> C reproducer: https://syzkaller.appspot.com/x/repro.c?x=17959c21f00000
Might be related to
commit 48b491a5cc74333c4a6a82fe21cea42c055a3b0b
Author: George McCollister <george.mccollister@gmail.com>
Date: Mon May 24 13:50:54 2021 -0500
net: hsr: fix mac_len checks
Commit 2e9f60932a2c ("net: hsr: check skb can contain struct hsr_ethhdr
in fill_frame_info") added the following which resulted in -EINVAL
always being returned:
if (skb->mac_len < sizeof(struct hsr_ethhdr))
return -EINVAL;
mac_len was not being set correctly so this check completely broke
HSR/PRP since it was always 14, not 20.
Set mac_len correctly and modify the mac_len checks to test in the
correct places since sometimes it is legitimately 14.
Fixes: 2e9f60932a2c ("net: hsr: check skb can contain struct
hsr_ethhdr in fill_frame_info")
Signed-off-by: George McCollister <george.mccollister@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
>
> IMPORTANT: if you fix the issue, please add the following tag to the commit:
> Reported-by: syzbot+b11c500e990cac6ba129@syzkaller.appspotmail.com
>
> hsr0: VLAN not yet supported
> =====================================================
> BUG: KMSAN: uninit-value in hsr_fill_frame_info+0x495/0x770 net/hsr/hsr_forward.c:526
> hsr_fill_frame_info+0x495/0x770 net/hsr/hsr_forward.c:526
> fill_frame_info net/hsr/hsr_forward.c:605 [inline]
> hsr_forward_skb+0x7c4/0x3630 net/hsr/hsr_forward.c:619
> hsr_dev_xmit+0x23a/0x530 net/hsr/hsr_device.c:222
> __netdev_start_xmit include/linux/netdevice.h:4778 [inline]
> netdev_start_xmit include/linux/netdevice.h:4792 [inline]
> xmit_one+0x2f4/0x840 net/core/dev.c:3532
> dev_hard_start_xmit+0x186/0x440 net/core/dev.c:3548
> __dev_queue_xmit+0x22ee/0x3500 net/core/dev.c:4176
> dev_queue_xmit+0x4b/0x60 net/core/dev.c:4209
> packet_snd net/packet/af_packet.c:3063 [inline]
> packet_sendmsg+0x6671/0x7d60 net/packet/af_packet.c:3094
> sock_sendmsg_nosec net/socket.c:705 [inline]
> sock_sendmsg net/socket.c:725 [inline]
> __sys_sendto+0x9ef/0xc70 net/socket.c:2040
> __do_sys_sendto net/socket.c:2052 [inline]
> __se_sys_sendto net/socket.c:2048 [inline]
> __x64_sys_sendto+0x19c/0x210 net/socket.c:2048
> do_syscall_x64 arch/x86/entry/common.c:51 [inline]
> do_syscall_64+0x51/0xa0 arch/x86/entry/common.c:81
> entry_SYSCALL_64_after_hwframe+0x44/0xae
>
> Uninit was created at:
> slab_post_alloc_hook mm/slab.h:754 [inline]
> slab_alloc_node mm/slub.c:3231 [inline]
> __kmalloc_node_track_caller+0xde3/0x14f0 mm/slub.c:4962
> kmalloc_reserve net/core/skbuff.c:354 [inline]
> __alloc_skb+0x545/0xf90 net/core/skbuff.c:426
> alloc_skb include/linux/skbuff.h:1300 [inline]
> alloc_skb_with_frags+0x1df/0xd60 net/core/skbuff.c:5995
> sock_alloc_send_pskb+0xdf4/0xfc0 net/core/sock.c:2600
> packet_alloc_skb net/packet/af_packet.c:2911 [inline]
> packet_snd net/packet/af_packet.c:3006 [inline]
> packet_sendmsg+0x506f/0x7d60 net/packet/af_packet.c:3094
> sock_sendmsg_nosec net/socket.c:705 [inline]
> sock_sendmsg net/socket.c:725 [inline]
> __sys_sendto+0x9ef/0xc70 net/socket.c:2040
> __do_sys_sendto net/socket.c:2052 [inline]
> __se_sys_sendto net/socket.c:2048 [inline]
> __x64_sys_sendto+0x19c/0x210 net/socket.c:2048
> do_syscall_x64 arch/x86/entry/common.c:51 [inline]
> do_syscall_64+0x51/0xa0 arch/x86/entry/common.c:81
> entry_SYSCALL_64_after_hwframe+0x44/0xae
>
> CPU: 1 PID: 3506 Comm: syz-executor134 Not tainted 5.18.0-rc4-syzkaller #0
> Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011
> =====================================================
>
>
> ---
> This report is generated by a bot. It may contain errors.
> See https://goo.gl/tpsmEJ for more information about syzbot.
> syzbot engineers can be reached at syzkaller@googlegroups.com.
>
> syzbot will keep track of this issue. See:
> https://goo.gl/tpsmEJ#status for how to communicate with syzbot.
> syzbot can test patches for this issue, for details see:
> https://goo.gl/tpsmEJ#testing-patches
prev parent reply other threads:[~2022-10-12 19:25 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-10-12 19:10 [syzbot] KMSAN: uninit-value in hsr_fill_frame_info (2) syzbot
2022-10-12 19:25 ` Eric Dumazet [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=960459eb-c8c3-bb75-f1ea-8995e511f826@gmail.com \
--to=eric.dumazet@gmail.com \
--cc=claudiajkang@gmail.com \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=ennoerlangen@gmail.com \
--cc=george.mccollister@gmail.com \
--cc=glider@google.com \
--cc=kuba@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=syzbot+b11c500e990cac6ba129@syzkaller.appspotmail.com \
--cc=syzkaller-bugs@googlegroups.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).