syzbot


KMSAN: uninit-value in tcf_exts_change

Status: fixed on 2020/05/10 10:41
Subsystems: net
[Documentation on labels]
Reported-by: syzbot+a37cda34d2b8b740a5f1@syzkaller.appspotmail.com
Fix commit: 0d1c3530e1bd net_sched: keep alloc_hash updated after hash allocation
First crash: 1736d, last: 1725d
Discussions (1)
Title Replies (including bot) Last reply
KMSAN: uninit-value in tcf_exts_change 1 (2) 2020/03/16 18:38

Sample crash report:
=====================================================
BUG: KMSAN: uninit-value in tcf_exts_destroy net/sched/cls_api.c:3000 [inline]
BUG: KMSAN: uninit-value in tcf_exts_change+0xc9/0xf0 net/sched/cls_api.c:3059
CPU: 1 PID: 11450 Comm: syz-executor413 Not tainted 5.6.0-rc2-syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011
Call Trace:
 __dump_stack lib/dump_stack.c:77 [inline]
 dump_stack+0x1c9/0x220 lib/dump_stack.c:118
 kmsan_report+0xf7/0x1e0 mm/kmsan/kmsan_report.c:118
 __msan_warning+0x58/0xa0 mm/kmsan/kmsan_instr.c:215
 tcf_exts_destroy net/sched/cls_api.c:3000 [inline]
 tcf_exts_change+0xc9/0xf0 net/sched/cls_api.c:3059
 tcindex_set_parms net/sched/cls_tcindex.c:456 [inline]
 tcindex_change+0x2fe4/0x4130 net/sched/cls_tcindex.c:518
 tc_new_tfilter+0x31a8/0x4f40 net/sched/cls_api.c:2103
 rtnetlink_rcv_msg+0xcb7/0x1570 net/core/rtnetlink.c:5429
 netlink_rcv_skb+0x451/0x650 net/netlink/af_netlink.c:2477
 rtnetlink_rcv+0x50/0x60 net/core/rtnetlink.c:5456
 netlink_unicast_kernel net/netlink/af_netlink.c:1302 [inline]
 netlink_unicast+0xf9e/0x1100 net/netlink/af_netlink.c:1328
 netlink_sendmsg+0x1246/0x14d0 net/netlink/af_netlink.c:1917
 sock_sendmsg_nosec net/socket.c:652 [inline]
 sock_sendmsg net/socket.c:672 [inline]
 ____sys_sendmsg+0x12b6/0x1350 net/socket.c:2343
 ___sys_sendmsg net/socket.c:2397 [inline]
 __sys_sendmsg+0x451/0x5f0 net/socket.c:2430
 __do_sys_sendmsg net/socket.c:2439 [inline]
 __se_sys_sendmsg+0x97/0xb0 net/socket.c:2437
 __x64_sys_sendmsg+0x4a/0x70 net/socket.c:2437
 do_syscall_64+0xb8/0x160 arch/x86/entry/common.c:296
 entry_SYSCALL_64_after_hwframe+0x44/0xa9
RIP: 0033:0x441829
Code: e8 2c e8 ff ff 48 83 c4 18 c3 0f 1f 80 00 00 00 00 48 89 f8 48 89 f7 48 89 d6 48 89 ca 4d 89 c2 4d 89 c8 4c 8b 4c 24 08 0f 05 <48> 3d 01 f0 ff ff 0f 83 8b 09 fc ff c3 66 2e 0f 1f 84 00 00 00 00
RSP: 002b:00007fff944e1698 EFLAGS: 00000246 ORIG_RAX: 000000000000002e
RAX: ffffffffffffffda RBX: 0000000000000003 RCX: 0000000000441829
RDX: 0000000000000000 RSI: 00000000200001c0 RDI: 0000000000000003
RBP: 00000000004a2b10 R08: 0000000120080522 R09: 0000000120080522
R10: 0000000120080522 R11: 0000000000000246 R12: 0000000000402640
R13: 00000000004026d0 R14: 0000000000000000 R15: 0000000000000000

Uninit was created at:
 kmsan_save_stack_with_flags+0x3c/0x90 mm/kmsan/kmsan.c:144
 kmsan_internal_alloc_meta_for_pages mm/kmsan/kmsan_shadow.c:307 [inline]
 kmsan_alloc_page+0x12a/0x310 mm/kmsan/kmsan_shadow.c:336
 __alloc_pages_nodemask+0x5712/0x5e80 mm/page_alloc.c:4775
 alloc_pages_current+0x67d/0x990 mm/mempolicy.c:2211
 alloc_pages include/linux/gfp.h:534 [inline]
 alloc_slab_page+0x111/0x12f0 mm/slub.c:1530
 allocate_slab mm/slub.c:1675 [inline]
 new_slab+0x2bc/0x1130 mm/slub.c:1741
 new_slab_objects mm/slub.c:2492 [inline]
 ___slab_alloc+0x1533/0x1f30 mm/slub.c:2643
 __slab_alloc mm/slub.c:2683 [inline]
 slab_alloc_node mm/slub.c:2757 [inline]
 slab_alloc mm/slub.c:2802 [inline]
 kmem_cache_alloc_trace+0xb0a/0xd70 mm/slub.c:2819
 kmalloc include/linux/slab.h:555 [inline]
 kzalloc include/linux/slab.h:669 [inline]
 tcindex_set_parms net/sched/cls_tcindex.c:325 [inline]
 tcindex_change+0x5bd/0x4130 net/sched/cls_tcindex.c:518
 tc_new_tfilter+0x31a8/0x4f40 net/sched/cls_api.c:2103
 rtnetlink_rcv_msg+0xcb7/0x1570 net/core/rtnetlink.c:5429
 netlink_rcv_skb+0x451/0x650 net/netlink/af_netlink.c:2477
 rtnetlink_rcv+0x50/0x60 net/core/rtnetlink.c:5456
 netlink_unicast_kernel net/netlink/af_netlink.c:1302 [inline]
 netlink_unicast+0xf9e/0x1100 net/netlink/af_netlink.c:1328
 netlink_sendmsg+0x1246/0x14d0 net/netlink/af_netlink.c:1917
 sock_sendmsg_nosec net/socket.c:652 [inline]
 sock_sendmsg net/socket.c:672 [inline]
 ____sys_sendmsg+0x12b6/0x1350 net/socket.c:2343
 ___sys_sendmsg net/socket.c:2397 [inline]
 __sys_sendmsg+0x451/0x5f0 net/socket.c:2430
 __do_sys_sendmsg net/socket.c:2439 [inline]
 __se_sys_sendmsg+0x97/0xb0 net/socket.c:2437
 __x64_sys_sendmsg+0x4a/0x70 net/socket.c:2437
 do_syscall_64+0xb8/0x160 arch/x86/entry/common.c:296
 entry_SYSCALL_64_after_hwframe+0x44/0xa9
=====================================================

Crashes (5):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2020/03/09 16:13 https://github.com/google/kmsan.git master 8bbbc5cf3dca 2e9971bb .config console log report syz C ci-upstream-kmsan-gce
2020/03/09 11:59 https://github.com/google/kmsan.git master 8bbbc5cf3dca 2e9971bb .config console log report syz C ci-upstream-kmsan-gce
2020/03/09 07:38 https://github.com/google/kmsan.git master 8bbbc5cf3dca 2e9971bb .config console log report syz C ci-upstream-kmsan-gce
2020/03/20 06:49 https://github.com/google/kmsan.git master a58741ac26cc 2c31c529 .config console log report syz C ci-upstream-kmsan-gce-386
2020/03/20 02:45 https://github.com/google/kmsan.git master a58741ac26cc 2c31c529 .config console log report syz ci-upstream-kmsan-gce-386
* Struck through repros no longer work on HEAD.