[syzbot] [sctp?] KMSAN: uninit-value in sctp_sf_ootb

8 views
Skip to first unread message

syzbot

unread,
Aug 26, 2024, 12:09:27 PMAug 26
to da...@davemloft.net, edum...@google.com, ku...@kernel.org, linux-...@vger.kernel.org, linux...@vger.kernel.org, lucie...@gmail.com, marcelo...@gmail.com, net...@vger.kernel.org, pab...@redhat.com, syzkall...@googlegroups.com
Hello,

syzbot found the following issue on:

HEAD commit: d2bafcf224f3 Merge tag 'cgroup-for-6.11-rc4-fixes' of git:..
git tree: upstream
console output: https://syzkaller.appspot.com/x/log.txt?x=15e9b7f5980000
kernel config: https://syzkaller.appspot.com/x/.config?x=62f882de896675a6
dashboard link: https://syzkaller.appspot.com/bug?extid=f0cbb34d39392f2746ca
compiler: Debian clang version 15.0.6, GNU ld (GNU Binutils for Debian) 2.40

Unfortunately, I don't have any reproducer for this issue yet.

Downloadable assets:
disk image: https://storage.googleapis.com/syzbot-assets/17f6ee87834d/disk-d2bafcf2.raw.xz
vmlinux: https://storage.googleapis.com/syzbot-assets/7783769858d1/vmlinux-d2bafcf2.xz
kernel image: https://storage.googleapis.com/syzbot-assets/45248109d188/bzImage-d2bafcf2.xz

IMPORTANT: if you fix the issue, please add the following tag to the commit:
Reported-by: syzbot+f0cbb3...@syzkaller.appspotmail.com

=====================================================
BUG: KMSAN: uninit-value in sctp_sf_ootb+0x7f5/0xce0 net/sctp/sm_statefuns.c:3702
sctp_sf_ootb+0x7f5/0xce0 net/sctp/sm_statefuns.c:3702
sctp_do_sm+0x181/0x93d0 net/sctp/sm_sideeffect.c:1166
sctp_endpoint_bh_rcv+0xc38/0xf90 net/sctp/endpointola.c:407
sctp_inq_push+0x2ef/0x380 net/sctp/inqueue.c:88
sctp_rcv+0x3831/0x3b20 net/sctp/input.c:243
sctp4_rcv+0x42/0x50 net/sctp/protocol.c:1158
ip_protocol_deliver_rcu+0xb51/0x13d0 net/ipv4/ip_input.c:205
ip_local_deliver_finish+0x336/0x500 net/ipv4/ip_input.c:233
NF_HOOK include/linux/netfilter.h:314 [inline]
ip_local_deliver+0x21f/0x490 net/ipv4/ip_input.c:254
dst_input include/net/dst.h:460 [inline]
ip_rcv_finish+0x4a2/0x520 net/ipv4/ip_input.c:449
NF_HOOK include/linux/netfilter.h:314 [inline]
ip_rcv+0xcd/0x380 net/ipv4/ip_input.c:569
__netif_receive_skb_one_core net/core/dev.c:5661 [inline]
__netif_receive_skb+0x319/0xa00 net/core/dev.c:5775
netif_receive_skb_internal net/core/dev.c:5861 [inline]
netif_receive_skb+0x58/0x660 net/core/dev.c:5921
tun_rx_batched+0x3ee/0x980 drivers/net/tun.c:1549
tun_get_user+0x5677/0x6b50 drivers/net/tun.c:2006
tun_chr_write_iter+0x3af/0x5d0 drivers/net/tun.c:2052
new_sync_write fs/read_write.c:497 [inline]
vfs_write+0xb2f/0x1550 fs/read_write.c:590
ksys_write+0x20f/0x4c0 fs/read_write.c:643
__do_sys_write fs/read_write.c:655 [inline]
__se_sys_write fs/read_write.c:652 [inline]
__x64_sys_write+0x93/0xe0 fs/read_write.c:652
x64_sys_call+0x306a/0x3ba0 arch/x86/include/generated/asm/syscalls_64.h:2
do_syscall_x64 arch/x86/entry/common.c:52 [inline]
do_syscall_64+0xcd/0x1e0 arch/x86/entry/common.c:83
entry_SYSCALL_64_after_hwframe+0x77/0x7f

Uninit was created at:
slab_post_alloc_hook mm/slub.c:3994 [inline]
slab_alloc_node mm/slub.c:4037 [inline]
kmem_cache_alloc_node_noprof+0x6bf/0xb80 mm/slub.c:4080
kmalloc_reserve+0x13d/0x4a0 net/core/skbuff.c:583
pskb_expand_head+0x222/0x19c0 net/core/skbuff.c:2259
__skb_cow include/linux/skbuff.h:3646 [inline]
skb_cow include/linux/skbuff.h:3665 [inline]
ip_rcv_options net/ipv4/ip_input.c:272 [inline]
ip_rcv_finish_core+0xf3d/0x1fe0 net/ipv4/ip_input.c:387
ip_rcv_finish+0x2cc/0x520 net/ipv4/ip_input.c:447
NF_HOOK include/linux/netfilter.h:314 [inline]
ip_rcv+0xcd/0x380 net/ipv4/ip_input.c:569
__netif_receive_skb_one_core net/core/dev.c:5661 [inline]
__netif_receive_skb+0x319/0xa00 net/core/dev.c:5775
netif_receive_skb_internal net/core/dev.c:5861 [inline]
netif_receive_skb+0x58/0x660 net/core/dev.c:5921
tun_rx_batched+0x3ee/0x980 drivers/net/tun.c:1549
tun_get_user+0x5677/0x6b50 drivers/net/tun.c:2006
tun_chr_write_iter+0x3af/0x5d0 drivers/net/tun.c:2052
new_sync_write fs/read_write.c:497 [inline]
vfs_write+0xb2f/0x1550 fs/read_write.c:590
ksys_write+0x20f/0x4c0 fs/read_write.c:643
__do_sys_write fs/read_write.c:655 [inline]
__se_sys_write fs/read_write.c:652 [inline]
__x64_sys_write+0x93/0xe0 fs/read_write.c:652
x64_sys_call+0x306a/0x3ba0 arch/x86/include/generated/asm/syscalls_64.h:2
do_syscall_x64 arch/x86/entry/common.c:52 [inline]
do_syscall_64+0xcd/0x1e0 arch/x86/entry/common.c:83
entry_SYSCALL_64_after_hwframe+0x77/0x7f

CPU: 1 UID: 0 PID: 13990 Comm: syz.3.1326 Not tainted 6.11.0-rc4-syzkaller-00255-gd2bafcf224f3 #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 08/06/2024
=====================================================


---
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 syzk...@googlegroups.com.

syzbot will keep track of this issue. See:
https://goo.gl/tpsmEJ#status for how to communicate with syzbot.

If the report is already addressed, let syzbot know by replying with:
#syz fix: exact-commit-title

If you want to overwrite report's subsystems, reply with:
#syz set subsystems: new-subsystem
(See the list of subsystem names on the web dashboard)

If the report is a duplicate of another one, reply with:
#syz dup: exact-subject-of-another-report

If you want to undo deduplication, reply with:
#syz undup

Xin Long

unread,
Aug 26, 2024, 12:24:50 PMAug 26
to syzbot, da...@davemloft.net, edum...@google.com, ku...@kernel.org, linux-...@vger.kernel.org, linux...@vger.kernel.org, marcelo...@gmail.com, net...@vger.kernel.org, pab...@redhat.com, syzkall...@googlegroups.com
On Mon, Aug 26, 2024 at 12:09 PM syzbot
<syzbot+f0cbb3...@syzkaller.appspotmail.com> wrote:
>
> Hello,
>
> syzbot found the following issue on:
>
> HEAD commit: d2bafcf224f3 Merge tag 'cgroup-for-6.11-rc4-fixes' of git:..
> git tree: upstream
> console output: https://syzkaller.appspot.com/x/log.txt?x=15e9b7f5980000
> kernel config: https://syzkaller.appspot.com/x/.config?x=62f882de896675a6
> dashboard link: https://syzkaller.appspot.com/bug?extid=f0cbb34d39392f2746ca
> compiler: Debian clang version 15.0.6, GNU ld (GNU Binutils for Debian) 2.40
>
> Unfortunately, I don't have any reproducer for this issue yet.
>
> Downloadable assets:
> disk image: https://storage.googleapis.com/syzbot-assets/17f6ee87834d/disk-d2bafcf2.raw.xz
> vmlinux: https://storage.googleapis.com/syzbot-assets/7783769858d1/vmlinux-d2bafcf2.xz
> kernel image: https://storage.googleapis.com/syzbot-assets/45248109d188/bzImage-d2bafcf2.xz
>
> IMPORTANT: if you fix the issue, please add the following tag to the commit:
> Reported-by: syzbot+f0cbb3...@syzkaller.appspotmail.com
>
> =====================================================
> BUG: KMSAN: uninit-value in sctp_sf_ootb+0x7f5/0xce0 net/sctp/sm_statefuns.c:3702
it seems we need a similar fix in sctp_sf_ootb() as:

commit 50619dbf8db77e98d821d615af4f634d08e22698
Author: Marcelo Ricardo Leitner <marcelo...@gmail.com>
Date: Mon Jun 28 16:13:42 2021 -0300

sctp: add size validation when walking chunks


diff --git a/net/sctp/sm_statefuns.c b/net/sctp/sm_statefuns.c
index 5adf0c0a6c1a..71b9feaf36bc 100644
--- a/net/sctp/sm_statefuns.c
+++ b/net/sctp/sm_statefuns.c
@@ -3741,7 +3741,7 @@ enum sctp_disposition sctp_sf_ootb(struct net *net,
}

ch = (struct sctp_chunkhdr *)ch_end;
- } while (ch_end < skb_tail_pointer(skb));
+ } while (ch_end + sizeof(*ch) < skb_tail_pointer(skb));

if (ootb_shut_ack)
return sctp_sf_shut_8_4_5(net, ep, asoc, type, arg, commands);

syzbot

unread,
Oct 28, 2024, 7:57:23 PM (11 days ago) Oct 28
to da...@davemloft.net, edum...@google.com, ho...@kernel.org, ku...@kernel.org, linux-...@vger.kernel.org, linux...@vger.kernel.org, lucie...@gmail.com, marcelo...@gmail.com, net...@vger.kernel.org, pab...@redhat.com, syzkall...@googlegroups.com
syzbot has found a reproducer for the following issue on:

HEAD commit: 819837584309 Linux 6.12-rc5
git tree: upstream
console+strace: https://syzkaller.appspot.com/x/log.txt?x=1211e940580000
kernel config: https://syzkaller.appspot.com/x/.config?x=4d4311df74eee96f
dashboard link: https://syzkaller.appspot.com/bug?extid=f0cbb34d39392f2746ca
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=11eb3230580000
C reproducer: https://syzkaller.appspot.com/x/repro.c?x=11f36ca7980000

Downloadable assets:
disk image: https://storage.googleapis.com/syzbot-assets/dfa054090a8f/disk-81983758.raw.xz
vmlinux: https://storage.googleapis.com/syzbot-assets/54edfdbd151e/vmlinux-81983758.xz
kernel image: https://storage.googleapis.com/syzbot-assets/d63a317b80f9/bzImage-81983758.xz

IMPORTANT: if you fix the issue, please add the following tag to the commit:
Reported-by: syzbot+f0cbb3...@syzkaller.appspotmail.com

syz-executor341 uses obsolete (PF_INET,SOCK_PACKET)
=====================================================
BUG: KMSAN: uninit-value in sctp_sf_ootb+0x7f5/0xce0 net/sctp/sm_statefuns.c:3712
sctp_sf_ootb+0x7f5/0xce0 net/sctp/sm_statefuns.c:3712
sctp_do_sm+0x181/0x93d0 net/sctp/sm_sideeffect.c:1166
sctp_endpoint_bh_rcv+0xc38/0xf90 net/sctp/endpointola.c:407
sctp_inq_push+0x2ef/0x380 net/sctp/inqueue.c:88
sctp_rcv+0x3831/0x3b20 net/sctp/input.c:243
sctp4_rcv+0x42/0x50 net/sctp/protocol.c:1159
ip_protocol_deliver_rcu+0xb51/0x13d0 net/ipv4/ip_input.c:205
ip_local_deliver_finish+0x336/0x500 net/ipv4/ip_input.c:233
NF_HOOK include/linux/netfilter.h:314 [inline]
ip_local_deliver+0x21f/0x490 net/ipv4/ip_input.c:254
dst_input include/net/dst.h:460 [inline]
ip_rcv_finish+0x4a2/0x520 net/ipv4/ip_input.c:449
NF_HOOK include/linux/netfilter.h:314 [inline]
ip_rcv+0xcd/0x380 net/ipv4/ip_input.c:569
__netif_receive_skb_one_core net/core/dev.c:5666 [inline]
__netif_receive_skb+0x319/0xa00 net/core/dev.c:5779
netif_receive_skb_internal net/core/dev.c:5865 [inline]
netif_receive_skb+0x58/0x660 net/core/dev.c:5924
tun_rx_batched+0x3ee/0x980 drivers/net/tun.c:1550
tun_get_user+0x5783/0x6c60 drivers/net/tun.c:2007
tun_chr_write_iter+0x3ac/0x5d0 drivers/net/tun.c:2053
new_sync_write fs/read_write.c:590 [inline]
vfs_write+0xb2b/0x1540 fs/read_write.c:683
ksys_write+0x24f/0x4c0 fs/read_write.c:736
__do_sys_write fs/read_write.c:748 [inline]
__se_sys_write fs/read_write.c:745 [inline]
__x64_sys_write+0x93/0xe0 fs/read_write.c:745
x64_sys_call+0x306a/0x3ba0 arch/x86/include/generated/asm/syscalls_64.h:2
do_syscall_x64 arch/x86/entry/common.c:52 [inline]
do_syscall_64+0xcd/0x1e0 arch/x86/entry/common.c:83
entry_SYSCALL_64_after_hwframe+0x77/0x7f

Uninit was created at:
slab_post_alloc_hook mm/slub.c:4091 [inline]
slab_alloc_node mm/slub.c:4134 [inline]
kmem_cache_alloc_node_noprof+0x6bf/0xb80 mm/slub.c:4186
kmalloc_reserve+0x13d/0x4a0 net/core/skbuff.c:587
__alloc_skb+0x363/0x7b0 net/core/skbuff.c:678
alloc_skb include/linux/skbuff.h:1322 [inline]
alloc_skb_with_frags+0xc8/0xd00 net/core/skbuff.c:6612
sock_alloc_send_pskb+0xa81/0xbf0 net/core/sock.c:2883
tun_alloc_skb drivers/net/tun.c:1526 [inline]
tun_get_user+0x20f4/0x6c60 drivers/net/tun.c:1851
tun_chr_write_iter+0x3ac/0x5d0 drivers/net/tun.c:2053
new_sync_write fs/read_write.c:590 [inline]
vfs_write+0xb2b/0x1540 fs/read_write.c:683
ksys_write+0x24f/0x4c0 fs/read_write.c:736
__do_sys_write fs/read_write.c:748 [inline]
__se_sys_write fs/read_write.c:745 [inline]
__x64_sys_write+0x93/0xe0 fs/read_write.c:745
x64_sys_call+0x306a/0x3ba0 arch/x86/include/generated/asm/syscalls_64.h:2
do_syscall_x64 arch/x86/entry/common.c:52 [inline]
do_syscall_64+0xcd/0x1e0 arch/x86/entry/common.c:83
entry_SYSCALL_64_after_hwframe+0x77/0x7f

CPU: 0 UID: 0 PID: 5818 Comm: syz-executor341 Not tainted 6.12.0-rc5-syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 09/13/2024
=====================================================


---
If you want syzbot to run the reproducer, reply with:
#syz test: git://repo/address.git branch-or-commit-hash
If you attach or paste a git patch, syzbot will apply it before testing.

Xin Long

unread,
Oct 29, 2024, 1:53:07 PM (10 days ago) Oct 29
to syzbot, da...@davemloft.net, edum...@google.com, ho...@kernel.org, ku...@kernel.org, linux-...@vger.kernel.org, linux...@vger.kernel.org, marcelo...@gmail.com, net...@vger.kernel.org, pab...@redhat.com, syzkall...@googlegroups.com
Sorry for forgetting the proposed fix. Here is the one I just posted.

https://lore.kernel.org/netdev/a29ebb6d8b9f8affd0f9abb296faafafe...@gmail.com/T/#u
Reply all
Reply to author
Forward
0 new messages