syzbot


KASAN: use-after-free Read in tipc_group_bc_cong

Status: fixed on 2019/01/11 01:22
Subsystems: tipc
[Documentation on labels]
Reported-by: syzbot+10a9db47c3a0e13eb31c@syzkaller.appspotmail.com
Fix commit: 143ece654f9f tipc: check tsk->group in tipc_wait_for_cond()
First crash: 1994d, last: 1983d
Duplicate bugs (1)
duplicates (1):
Title Repro Cause bisect Fix bisect Count Last Reported Patched Status
KASAN: use-after-free Read in tipc_group_cong tipc syz 1 1992d 1991d 0/26 closed as dup on 2018/12/13 09:47
Discussions (4)
Title Replies (including bot) Last reply
[PATCH 4.19 000/170] 4.19.14-stable review 194 (194) 2019/01/11 07:09
[Patch net] tipc: check tsk->group in tipc_wait_for_cond() 3 (3) 2018/12/14 23:49
KASAN: use-after-free Read in tipc_group_cong 4 (5) 2018/12/13 15:56
KASAN: use-after-free Read in tipc_group_bc_cong 0 (1) 2018/12/10 05:01

Sample crash report:
audit: type=1800 audit(1545120296.025:30): pid=5900 uid=0 auid=4294967295 ses=4294967295 subj==unconfined op=collect_data cause=failed(directio) comm="startpar" name="rmnologin" dev="sda1" ino=2423 res=0
sshd (6039) used greatest stack depth: 15744 bytes left
==================================================================
BUG: KASAN: use-after-free in tipc_group_bc_cong+0x327/0x3f0 net/tipc/group.c:448
Read of size 2 at addr ffff8881d877a974 by task syz-executor108/6058

CPU: 1 PID: 6058 Comm: syz-executor108 Not tainted 4.20.0-rc7+ #376
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+0x244/0x39d lib/dump_stack.c:113
 print_address_description.cold.7+0x9/0x1ff mm/kasan/report.c:256
 kasan_report_error mm/kasan/report.c:354 [inline]
 kasan_report.cold.8+0x242/0x309 mm/kasan/report.c:412
 __asan_report_load2_noabort+0x14/0x20 mm/kasan/report.c:431
 tipc_group_bc_cong+0x327/0x3f0 net/tipc/group.c:448
 tipc_send_group_bcast+0x50a/0xd90 net/tipc/socket.c:1023
 __tipc_sendmsg+0xeec/0x1d40 net/tipc/socket.c:1307
 tipc_sendmsg+0x50/0x70 net/tipc/socket.c:1272
 sock_sendmsg_nosec net/socket.c:621 [inline]
 sock_sendmsg+0xd5/0x120 net/socket.c:631
 ___sys_sendmsg+0x51d/0x930 net/socket.c:2116
 __sys_sendmmsg+0x246/0x6d0 net/socket.c:2211
 __do_sys_sendmmsg net/socket.c:2240 [inline]
 __se_sys_sendmmsg net/socket.c:2237 [inline]
 __x64_sys_sendmmsg+0x9d/0x100 net/socket.c:2237
 do_syscall_64+0x1b9/0x820 arch/x86/entry/common.c:290
 entry_SYSCALL_64_after_hwframe+0x49/0xbe
RIP: 0033:0x446339
Code: e8 2c b3 02 00 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 2b 09 fc ff c3 66 2e 0f 1f 84 00 00 00 00
RSP: 002b:00007f15687d7db8 EFLAGS: 00000297 ORIG_RAX: 0000000000000133
RAX: ffffffffffffffda RBX: 00000000006dac38 RCX: 0000000000446339
RDX: 0000000000000142 RSI: 0000000020000000 RDI: 0000000000000006
RBP: 00000000006dac30 R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000297 R12: 00000000006dac3c
R13: 00007ffe412e39af R14: 00007f15687d89c0 R15: 00000000006dad2c

Allocated by task 6058:
 save_stack+0x43/0xd0 mm/kasan/kasan.c:448
 set_track mm/kasan/kasan.c:460 [inline]
 kasan_kmalloc+0xc7/0xe0 mm/kasan/kasan.c:553
 kmem_cache_alloc_trace+0x152/0x750 mm/slab.c:3620
 kmalloc include/linux/slab.h:546 [inline]
 kzalloc include/linux/slab.h:741 [inline]
 tipc_group_create+0x152/0xa70 net/tipc/group.c:171
 tipc_sk_join net/tipc/socket.c:2829 [inline]
 tipc_setsockopt+0x2d1/0xd70 net/tipc/socket.c:2944
 __sys_setsockopt+0x1ba/0x3c0 net/socket.c:1902
 __do_sys_setsockopt net/socket.c:1913 [inline]
 __se_sys_setsockopt net/socket.c:1910 [inline]
 __x64_sys_setsockopt+0xbe/0x150 net/socket.c:1910
 do_syscall_64+0x1b9/0x820 arch/x86/entry/common.c:290
 entry_SYSCALL_64_after_hwframe+0x49/0xbe

Freed by task 6059:
 save_stack+0x43/0xd0 mm/kasan/kasan.c:448
 set_track mm/kasan/kasan.c:460 [inline]
 __kasan_slab_free+0x102/0x150 mm/kasan/kasan.c:521
 kasan_slab_free+0xe/0x10 mm/kasan/kasan.c:528
 __cache_free mm/slab.c:3498 [inline]
 kfree+0xcf/0x230 mm/slab.c:3817
 tipc_group_delete+0x2e4/0x3f0 net/tipc/group.c:227
 tipc_sk_leave+0x113/0x220 net/tipc/socket.c:2863
 tipc_setsockopt+0x97d/0xd70 net/tipc/socket.c:2947
 __sys_setsockopt+0x1ba/0x3c0 net/socket.c:1902
 __do_sys_setsockopt net/socket.c:1913 [inline]
 __se_sys_setsockopt net/socket.c:1910 [inline]
 __x64_sys_setsockopt+0xbe/0x150 net/socket.c:1910
 do_syscall_64+0x1b9/0x820 arch/x86/entry/common.c:290
 entry_SYSCALL_64_after_hwframe+0x49/0xbe

The buggy address belongs to the object at ffff8881d877a900
 which belongs to the cache kmalloc-192 of size 192
The buggy address is located 116 bytes inside of
 192-byte region [ffff8881d877a900, ffff8881d877a9c0)
The buggy address belongs to the page:
page:ffffea000761de80 count:1 mapcount:0 mapping:ffff8881da800040 index:0x0
flags: 0x2fffc0000000200(slab)
raw: 02fffc0000000200 ffffea000761edc8 ffffea00075dc188 ffff8881da800040
raw: 0000000000000000 ffff8881d877a000 0000000100000010 0000000000000000
page dumped because: kasan: bad access detected

Memory state around the buggy address:
 ffff8881d877a800: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
 ffff8881d877a880: fb fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc
>ffff8881d877a900: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
                                                             ^
 ffff8881d877a980: fb fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc
 ffff8881d877aa00: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
==================================================================

Crashes (280):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2018/12/18 08:07 upstream 1a9430db2835 def91db3 .config console log report syz C ci-upstream-kasan-gce
2018/12/17 22:16 upstream 7566ec393f41 def91db3 .config console log report syz C ci-upstream-kasan-gce-smack-root
2018/12/17 18:28 upstream 7566ec393f41 def91db3 .config console log report syz C ci-upstream-kasan-gce-root
2018/12/17 18:21 upstream 7566ec393f41 def91db3 .config console log report syz C ci-upstream-kasan-gce-selinux-root
2018/12/17 05:34 upstream 7566ec393f41 def91db3 .config console log report syz C ci-upstream-kasan-gce-smack-root
2018/12/16 20:41 upstream 6531e115b7ab def91db3 .config console log report syz C ci-upstream-kasan-gce-root
2018/12/16 16:04 upstream 6531e115b7ab def91db3 .config console log report syz C ci-upstream-kasan-gce
2018/12/16 16:03 upstream 6531e115b7ab def91db3 .config console log report syz C ci-upstream-kasan-gce-selinux-root
2018/12/12 12:46 upstream f5d582777bcb c3b10a5d .config console log report syz C ci-upstream-kasan-gce-selinux-root
2018/12/12 08:48 upstream f5d582777bcb 7795ae03 .config console log report syz C ci-upstream-kasan-gce-smack-root
2018/12/12 08:07 upstream f5d582777bcb 7795ae03 .config console log report syz C ci-upstream-kasan-gce-root
2018/12/12 07:40 upstream f5d582777bcb 7795ae03 .config console log report syz C ci-upstream-kasan-gce
2018/12/12 04:57 upstream f5d582777bcb 7795ae03 .config console log report syz C ci-upstream-kasan-gce-selinux-root
2018/12/12 04:28 upstream f5d582777bcb 7795ae03 .config console log report syz C ci-upstream-kasan-gce-selinux-root
2018/12/12 02:54 upstream f5d582777bcb 7795ae03 .config console log report syz C ci-upstream-kasan-gce
2018/12/12 02:52 upstream f5d582777bcb 7795ae03 .config console log report syz C ci-upstream-kasan-gce-smack-root
2018/12/12 02:37 upstream f5d582777bcb 7795ae03 .config console log report syz C ci-upstream-kasan-gce-root
2018/12/12 01:47 upstream f5d582777bcb 7795ae03 .config console log report syz C ci-upstream-kasan-gce-root
2018/12/12 01:20 upstream f5d582777bcb 7795ae03 .config console log report syz C ci-upstream-kasan-gce-root
2018/12/12 01:14 upstream f5d582777bcb 7795ae03 .config console log report syz C ci-upstream-kasan-gce-smack-root
2018/12/10 04:46 upstream 0844895a2e51 96cc4c50 .config console log report syz C ci-upstream-kasan-gce-selinux-root
2018/12/17 18:58 upstream 7566ec393f41 def91db3 .config console log report syz C ci-upstream-kasan-gce-386
2018/12/17 07:52 upstream 7566ec393f41 def91db3 .config console log report syz C ci-upstream-kasan-gce-386
2018/12/12 05:35 upstream f5d582777bcb 7795ae03 .config console log report syz C ci-upstream-kasan-gce-386
2018/12/12 01:29 upstream f5d582777bcb 7795ae03 .config console log report syz C ci-upstream-kasan-gce-386
2018/12/12 06:17 net-old 2f1a9f666751 7795ae03 .config console log report syz C ci-upstream-net-this-kasan-gce
2018/12/12 03:15 net-old 2f1a9f666751 7795ae03 .config console log report syz C ci-upstream-net-this-kasan-gce
2018/12/12 02:27 net-old 2f1a9f666751 7795ae03 .config console log report syz C ci-upstream-net-this-kasan-gce
2018/12/10 01:50 net-old 35cc3cefc4de 96cc4c50 .config console log report syz C ci-upstream-net-this-kasan-gce
2018/12/16 15:58 net-next-old c151acc6e9ff def91db3 .config console log report syz C ci-upstream-net-kasan-gce
2018/12/12 14:27 net-next-old e1a76515b0c2 c3b10a5d .config console log report syz C ci-upstream-net-kasan-gce
2018/12/12 11:40 net-next-old e1a76515b0c2 c3b10a5d .config console log report syz C ci-upstream-net-kasan-gce
2018/12/12 08:21 net-next-old 0bd72117fba2 7795ae03 .config console log report syz C ci-upstream-net-kasan-gce
2018/12/12 07:53 net-next-old 0bd72117fba2 7795ae03 .config console log report syz C ci-upstream-net-kasan-gce
2018/12/12 07:27 net-next-old 0bd72117fba2 7795ae03 .config console log report syz C ci-upstream-net-kasan-gce
2018/12/12 06:23 net-next-old 0bd72117fba2 7795ae03 .config console log report syz C ci-upstream-net-kasan-gce
2018/12/12 05:58 net-next-old 0bd72117fba2 7795ae03 .config console log report syz C ci-upstream-net-kasan-gce
2018/12/12 05:32 net-next-old 0bd72117fba2 7795ae03 .config console log report syz C ci-upstream-net-kasan-gce
2018/12/12 02:41 net-next-old 0bd72117fba2 7795ae03 .config console log report syz C ci-upstream-net-kasan-gce
2018/12/13 19:45 linux-next ca40dc225d19 f3d9d594 .config console log report syz C ci-upstream-linux-next-kasan-gce-root
2018/12/13 15:11 linux-next ca40dc225d19 f3d9d594 .config console log report syz C ci-upstream-linux-next-kasan-gce-root
2018/12/13 13:51 linux-next ca40dc225d19 f3d9d594 .config console log report syz C ci-upstream-linux-next-kasan-gce-root
2018/12/13 13:24 linux-next ca40dc225d19 f3d9d594 .config console log report syz C ci-upstream-linux-next-kasan-gce-root
2018/12/13 12:46 linux-next ca40dc225d19 f3d9d594 .config console log report syz C ci-upstream-linux-next-kasan-gce-root
2018/12/19 05:59 upstream ddfbab46539f 4edaba93 .config console log report ci-upstream-kasan-gce-smack-root
2018/12/19 01:08 upstream ddfbab46539f 4edaba93 .config console log report ci-upstream-kasan-gce
2018/12/18 17:14 upstream 1a9430db2835 4edaba93 .config console log report ci-upstream-kasan-gce-smack-root
2018/12/18 04:28 upstream 1a9430db2835 def91db3 .config console log report ci-upstream-kasan-gce-selinux-root
2018/12/18 00:26 upstream 7566ec393f41 def91db3 .config console log report ci-upstream-kasan-gce-root
2018/12/17 16:28 upstream 7566ec393f41 def91db3 .config console log report ci-upstream-kasan-gce
2018/12/17 14:12 upstream 7566ec393f41 def91db3 .config console log report ci-upstream-kasan-gce
2018/12/17 09:07 upstream 7566ec393f41 def91db3 .config console log report ci-upstream-kasan-gce
2018/12/16 22:55 upstream 6531e115b7ab def91db3 .config console log report ci-upstream-kasan-gce-selinux-root
2018/12/16 15:54 upstream 6531e115b7ab def91db3 .config console log report ci-upstream-kasan-gce
2018/12/16 14:21 upstream 6531e115b7ab def91db3 .config console log report ci-upstream-kasan-gce-selinux-root
2018/12/16 08:00 upstream 6531e115b7ab def91db3 .config console log report ci-upstream-kasan-gce
2018/12/15 22:49 upstream 6531e115b7ab def91db3 .config console log report ci-upstream-kasan-gce
2018/12/14 17:18 upstream 65e08c5e8631 7624ddd6 .config console log report ci-upstream-kasan-gce
2018/12/20 07:52 upstream ab63e725b49c 02e69052 .config console log report ci-upstream-kasan-gce-386
2018/12/15 01:06 net-old c3db8d531045 7624ddd6 .config console log report ci-upstream-net-this-kasan-gce
2018/12/14 21:28 net-old c3db8d531045 7624ddd6 .config console log report ci-upstream-net-this-kasan-gce
2018/12/14 15:32 net-old c3db8d531045 7624ddd6 .config console log report ci-upstream-net-this-kasan-gce
2018/12/10 00:19 net-old 35cc3cefc4de 96cc4c50 .config console log report ci-upstream-net-this-kasan-gce
2018/12/20 21:58 net-next-old a9cd3439e3c6 aaf59e84 .config console log report ci-upstream-net-kasan-gce
2018/12/20 15:28 net-next-old a9cd3439e3c6 aaf59e84 .config console log report ci-upstream-net-kasan-gce
2018/12/20 12:07 net-next-old 24894bc6eabc 02e69052 .config console log report ci-upstream-net-kasan-gce
2018/12/20 06:08 net-next-old 24894bc6eabc 02e69052 .config console log report ci-upstream-net-kasan-gce
2018/12/20 05:01 net-next-old 24894bc6eabc 02e69052 .config console log report ci-upstream-net-kasan-gce
2018/12/19 22:01 net-next-old 33f18c96afdf fe2dc057 .config console log report ci-upstream-net-kasan-gce
2018/12/19 19:18 net-next-old 33f18c96afdf fe2dc057 .config console log report ci-upstream-net-kasan-gce
2018/12/19 17:22 net-next-old 33f18c96afdf fe2dc057 .config console log report ci-upstream-net-kasan-gce
2018/12/19 16:16 net-next-old 33f18c96afdf fe2dc057 .config console log report ci-upstream-net-kasan-gce
2018/12/19 14:39 net-next-old 33f18c96afdf fe2dc057 .config console log report ci-upstream-net-kasan-gce
2018/12/19 10:07 net-next-old a26d94bff4d5 4edaba93 .config console log report ci-upstream-net-kasan-gce
2018/12/19 03:06 net-next-old a26d94bff4d5 4edaba93 .config console log report ci-upstream-net-kasan-gce
2018/12/18 22:22 net-next-old b12c97d45cd0 4edaba93 .config console log report ci-upstream-net-kasan-gce
2018/12/18 21:01 net-next-old b12c97d45cd0 4edaba93 .config console log report ci-upstream-net-kasan-gce
2018/12/18 09:35 net-next-old a28777f25031 def91db3 .config console log report ci-upstream-net-kasan-gce
2018/12/17 21:54 net-next-old ae6750e0a5ef def91db3 .config console log report ci-upstream-net-kasan-gce
2018/12/17 20:05 net-next-old ae6750e0a5ef def91db3 .config console log report ci-upstream-net-kasan-gce
2018/12/17 10:42 net-next-old 9c46ae0ea1ee def91db3 .config console log report ci-upstream-net-kasan-gce
2018/12/17 05:15 net-next-old 9c46ae0ea1ee def91db3 .config console log report ci-upstream-net-kasan-gce
2018/12/16 20:02 net-next-old c151acc6e9ff def91db3 .config console log report ci-upstream-net-kasan-gce
2018/12/16 19:12 net-next-old c151acc6e9ff def91db3 .config console log report ci-upstream-net-kasan-gce
2018/12/16 17:24 net-next-old c151acc6e9ff def91db3 .config console log report ci-upstream-net-kasan-gce
2018/12/16 12:42 net-next-old c151acc6e9ff def91db3 .config console log report ci-upstream-net-kasan-gce
2018/12/16 11:00 net-next-old c151acc6e9ff def91db3 .config console log report ci-upstream-net-kasan-gce
2018/12/16 05:58 net-next-old e782410ed237 def91db3 .config console log report ci-upstream-net-kasan-gce
2018/12/16 02:58 net-next-old e782410ed237 def91db3 .config console log report ci-upstream-net-kasan-gce
2018/12/16 01:03 net-next-old e782410ed237 def91db3 .config console log report ci-upstream-net-kasan-gce
2018/12/16 00:12 net-next-old e782410ed237 def91db3 .config console log report ci-upstream-net-kasan-gce
2018/12/15 15:36 net-next-old b9948e111391 c9128939 .config console log report ci-upstream-net-kasan-gce
2018/12/15 05:47 net-next-old 2aa55dccf83d 7624ddd6 .config console log report ci-upstream-net-kasan-gce
2018/12/15 04:40 net-next-old 2aa55dccf83d 7624ddd6 .config console log report ci-upstream-net-kasan-gce
2018/12/15 03:00 net-next-old 2aa55dccf83d 7624ddd6 .config console log report ci-upstream-net-kasan-gce
2018/12/14 20:08 net-next-old 522185d5cb40 7624ddd6 .config console log report ci-upstream-net-kasan-gce
2018/12/14 18:42 net-next-old 522185d5cb40 7624ddd6 .config console log report ci-upstream-net-kasan-gce
* Struck through repros no longer work on HEAD.