syzbot


KASAN: use-after-free Read in tcindex_dump

Status: auto-closed as invalid on 2020/07/07 00:51
Reported-by: syzbot+3accc93df8538e75f1d9@syzkaller.appspotmail.com
First crash: 1720d, last: 1720d
Similar bugs (2)
Kernel Title Repro Cause bisect Fix bisect Count Last Reported Patched Status
linux-4.14 KASAN: use-after-free Read in tcindex_dump 2 750d 810d 0/1 auto-obsoleted due to no activity on 2023/03/03 20:07
upstream KASAN: use-after-free Read in tcindex_dump net syz 1 1721d 1718d 15/28 fixed on 2020/05/10 10:42

Sample crash report:
==================================================================
BUG: KASAN: use-after-free in tcindex_dump+0xbb3/0xc20 net/sched/cls_tcindex.c:635
Read of size 8 at addr ffff888043c49520 by task syz-executor.0/9409

CPU: 1 PID: 9409 Comm: syz-executor.0 Not tainted 4.19.108-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+0x188/0x20d lib/dump_stack.c:118
 print_address_description.cold+0x7c/0x212 mm/kasan/report.c:256
 kasan_report_error mm/kasan/report.c:354 [inline]
 kasan_report mm/kasan/report.c:412 [inline]
 kasan_report.cold+0x88/0x2b9 mm/kasan/report.c:396
 tcindex_dump+0xbb3/0xc20 net/sched/cls_tcindex.c:635
 tcf_fill_node+0x55b/0x910 net/sched/cls_api.c:1101
 tfilter_notify+0x12f/0x270 net/sched/cls_api.c:1125
 tc_new_tfilter+0xae2/0x1450 net/sched/cls_api.c:1326
 rtnetlink_rcv_msg+0x453/0xaf0 net/core/rtnetlink.c:4777
 netlink_rcv_skb+0x160/0x410 net/netlink/af_netlink.c:2455
 netlink_unicast_kernel net/netlink/af_netlink.c:1318 [inline]
 netlink_unicast+0x4d7/0x6a0 net/netlink/af_netlink.c:1344
 netlink_sendmsg+0x80b/0xcd0 net/netlink/af_netlink.c:1909
 sock_sendmsg_nosec net/socket.c:622 [inline]
 sock_sendmsg+0xcf/0x120 net/socket.c:632
 ___sys_sendmsg+0x803/0x920 net/socket.c:2115
 __sys_sendmsg+0xec/0x1b0 net/socket.c:2153
 do_syscall_64+0xf9/0x620 arch/x86/entry/common.c:293
 entry_SYSCALL_64_after_hwframe+0x49/0xbe
RIP: 0033:0x45c4a9
Code: ad b6 fb ff c3 66 2e 0f 1f 84 00 00 00 00 00 66 90 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 7b b6 fb ff c3 66 2e 0f 1f 84 00 00 00 00
RSP: 002b:00007f743fb24c78 EFLAGS: 00000246 ORIG_RAX: 000000000000002e
RAX: ffffffffffffffda RBX: 00007f743fb256d4 RCX: 000000000045c4a9
RDX: 0000000000000000 RSI: 00000000200002c0 RDI: 000000000000000e
RBP: 000000000076c060 R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000246 R12: 00000000ffffffff
R13: 00000000000009fa R14: 00000000004cc777 R15: 000000000076c06c

Allocated by task 9400:
 set_track mm/kasan/kasan.c:460 [inline]
 kasan_kmalloc mm/kasan/kasan.c:553 [inline]
 kasan_kmalloc+0xbf/0xe0 mm/kasan/kasan.c:531
 __do_kmalloc mm/slab.c:3727 [inline]
 __kmalloc+0x15b/0x770 mm/slab.c:3736
 kmalloc_array include/linux/slab.h:637 [inline]
 kcalloc include/linux/slab.h:648 [inline]
 tcindex_alloc_perfect_hash+0x57/0x350 net/sched/cls_tcindex.c:278
 tcindex_set_parms+0x153b/0x19d0 net/sched/cls_tcindex.c:405
 tcindex_change+0x200/0x2d3 net/sched/cls_tcindex.c:517
 tc_new_tfilter+0xa6b/0x1450 net/sched/cls_api.c:1320
 rtnetlink_rcv_msg+0x453/0xaf0 net/core/rtnetlink.c:4777
 netlink_rcv_skb+0x160/0x410 net/netlink/af_netlink.c:2455
 netlink_unicast_kernel net/netlink/af_netlink.c:1318 [inline]
 netlink_unicast+0x4d7/0x6a0 net/netlink/af_netlink.c:1344
 netlink_sendmsg+0x80b/0xcd0 net/netlink/af_netlink.c:1909
 sock_sendmsg_nosec net/socket.c:622 [inline]
 sock_sendmsg+0xcf/0x120 net/socket.c:632
 ___sys_sendmsg+0x803/0x920 net/socket.c:2115
 __sys_sendmsg+0xec/0x1b0 net/socket.c:2153
 do_syscall_64+0xf9/0x620 arch/x86/entry/common.c:293
 entry_SYSCALL_64_after_hwframe+0x49/0xbe

Freed by task 23:
 set_track mm/kasan/kasan.c:460 [inline]
 __kasan_slab_free+0xf7/0x140 mm/kasan/kasan.c:521
 __cache_free mm/slab.c:3503 [inline]
 kfree+0xce/0x220 mm/slab.c:3822
 tcindex_partial_destroy_work+0x2e/0x50 net/sched/cls_tcindex.c:261
 process_one_work+0x91f/0x1640 kernel/workqueue.c:2153
 worker_thread+0x96/0xe20 kernel/workqueue.c:2296
 kthread+0x34a/0x420 kernel/kthread.c:246
 ret_from_fork+0x24/0x30 arch/x86/entry/entry_64.S:415

The buggy address belongs to the object at ffff888043c49500
 which belongs to the cache kmalloc-16384 of size 16384
The buggy address is located 32 bytes inside of
 16384-byte region [ffff888043c49500, ffff888043c4d500)
The buggy address belongs to the page:
page:ffffea00010f1200 count:1 mapcount:0 mapping:ffff88812c3d5200 index:0x0 compound_mapcount: 0
flags: 0xfffe0000008100(slab|head)
raw: 00fffe0000008100 ffffea0001103c08 ffffea00010efe08 ffff88812c3d5200
raw: 0000000000000000 ffff888043c49500 0000000100000001 0000000000000000
page dumped because: kasan: bad access detected

Memory state around the buggy address:
 ffff888043c49400: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
 ffff888043c49480: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
>ffff888043c49500: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
                               ^
 ffff888043c49580: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
 ffff888043c49600: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
==================================================================
audit: type=1400 audit(1583715052.653:76): avc:  denied  { map } for  pid=9443 comm="syz-executor.4" path="socket:[37029]" dev="sockfs" ino=37029 scontext=unconfined_u:system_r:insmod_t:s0-s0:c0.c1023 tcontext=unconfined_u:system_r:insmod_t:s0-s0:c0.c1023 tclass=packet_socket permissive=1

Crashes (1):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2020/03/09 00:51 linux-4.19.y 7472c4028e23 2e9971bb .config console log report ci2-linux-4-19
* Struck through repros no longer work on HEAD.