syzbot


KASAN: use-after-free Write in tipc_subscrb_rcv_cb

Status: auto-closed as invalid on 2021/03/26 18:40
Reported-by: syzbot+d6703275a1a5163b6aef@syzkaller.appspotmail.com
First crash: 1652d, last: 1409d
Similar bugs (1)
Kernel Title Repro Cause bisect Fix bisect Count Last Reported Patched Status
linux-4.14 KASAN: use-after-free Read in tipc_subscrb_rcv_cb ext4 C 4436 581d 2004d 0/1 upstream: reported C repro on 2019/04/11 12:32

Sample crash report:
==================================================================
BUG: KASAN: use-after-free in __write_once_size include/linux/compiler.h:207 [inline]
BUG: KASAN: use-after-free in set_pending kernel/locking/qspinlock_paravirt.h:89 [inline]
BUG: KASAN: use-after-free in pv_wait_head_or_lock kernel/locking/qspinlock_paravirt.h:410 [inline]
BUG: KASAN: use-after-free in __pv_queued_spin_lock_slowpath+0x678/0x910 kernel/locking/qspinlock.c:465
Write of size 1 at addr ffff888098fde909 by task kworker/u4:6/7155

CPU: 1 PID: 7155 Comm: kworker/u4:6 Not tainted 4.14.209-syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011
Workqueue: tipc_rcv tipc_recv_work
Call Trace:
 __dump_stack lib/dump_stack.c:17 [inline]
 dump_stack+0x1b2/0x283 lib/dump_stack.c:58
 print_address_description.cold+0x54/0x1d3 mm/kasan/report.c:252
 kasan_report_error.cold+0x8a/0x194 mm/kasan/report.c:351
 kasan_report mm/kasan/report.c:409 [inline]
 __asan_report_store1_noabort+0x68/0x70 mm/kasan/report.c:432
 __write_once_size include/linux/compiler.h:207 [inline]
 set_pending kernel/locking/qspinlock_paravirt.h:89 [inline]
 pv_wait_head_or_lock kernel/locking/qspinlock_paravirt.h:410 [inline]
 __pv_queued_spin_lock_slowpath+0x678/0x910 kernel/locking/qspinlock.c:465
 pv_queued_spin_lock_slowpath arch/x86/include/asm/paravirt.h:669 [inline]
 queued_spin_lock_slowpath arch/x86/include/asm/qspinlock.h:52 [inline]
 queued_spin_lock include/asm-generic/qspinlock.h:90 [inline]
 do_raw_spin_lock+0x178/0x200 kernel/locking/spinlock_debug.c:113
 spin_lock_bh include/linux/spinlock.h:322 [inline]
 tipc_subscrp_subscribe net/tipc/subscr.c:299 [inline]
 tipc_subscrb_rcv_cb+0x4d4/0xa40 net/tipc/subscr.c:338
 tipc_receive_from_sock+0x25c/0x450 net/tipc/server.c:273
 tipc_recv_work+0x75/0xd0 net/tipc/server.c:547
 process_one_work+0x793/0x14a0 kernel/workqueue.c:2116
 worker_thread+0x5cc/0xff0 kernel/workqueue.c:2250
 kthread+0x30d/0x420 kernel/kthread.c:232
 ret_from_fork+0x24/0x30 arch/x86/entry/entry_64.S:404

Allocated by task 1018:
 save_stack mm/kasan/kasan.c:447 [inline]
 set_track mm/kasan/kasan.c:459 [inline]
 kasan_kmalloc+0xeb/0x160 mm/kasan/kasan.c:551
 kmem_cache_alloc_trace+0x131/0x3d0 mm/slab.c:3618
 kmalloc include/linux/slab.h:488 [inline]
 kzalloc include/linux/slab.h:661 [inline]
 tipc_subscrb_create net/tipc/subscr.c:223 [inline]
 tipc_subscrb_connect_cb+0x40/0x150 net/tipc/subscr.c:344
 tipc_accept_from_sock+0x25b/0x400 net/tipc/server.c:313
 tipc_recv_work+0x75/0xd0 net/tipc/server.c:547
 process_one_work+0x793/0x14a0 kernel/workqueue.c:2116
 worker_thread+0x5cc/0xff0 kernel/workqueue.c:2250
 kthread+0x30d/0x420 kernel/kthread.c:232
 ret_from_fork+0x24/0x30 arch/x86/entry/entry_64.S:404

Freed by task 1018:
 save_stack mm/kasan/kasan.c:447 [inline]
 set_track mm/kasan/kasan.c:459 [inline]
 kasan_slab_free+0xc3/0x1a0 mm/kasan/kasan.c:524
 __cache_free mm/slab.c:3496 [inline]
 kfree+0xc9/0x250 mm/slab.c:3815
 tipc_subscrb_kref_release net/tipc/subscr.c:155 [inline]
 kref_put include/linux/kref.h:70 [inline]
 tipc_subscrb_put+0x22/0x30 net/tipc/subscr.c:160
 tipc_close_conn+0x16a/0x200 net/tipc/server.c:203
 tipc_send_to_sock net/tipc/server.c:538 [inline]
 tipc_send_work+0x41e/0x520 net/tipc/server.c:564
 process_one_work+0x793/0x14a0 kernel/workqueue.c:2116
 worker_thread+0x5cc/0xff0 kernel/workqueue.c:2250
 kthread+0x30d/0x420 kernel/kthread.c:232
 ret_from_fork+0x24/0x30 arch/x86/entry/entry_64.S:404

The buggy address belongs to the object at ffff888098fde900
 which belongs to the cache kmalloc-96 of size 96
The buggy address is located 9 bytes inside of
 96-byte region [ffff888098fde900, ffff888098fde960)
The buggy address belongs to the page:
page:ffffea000263f780 count:1 mapcount:0 mapping:ffff888098fde000 index:0xffff888098fdeb80
flags: 0xfff00000000100(slab)
raw: 00fff00000000100 ffff888098fde000 ffff888098fdeb80 000000010000001e
raw: ffffea00029d4120 ffffea0002d175a0 ffff88813fe824c0 0000000000000000
page dumped because: kasan: bad access detected

Memory state around the buggy address:
 ffff888098fde800: 00 00 00 00 00 00 00 00 00 00 00 00 fc fc fc fc
 ffff888098fde880: fb fb fb fb fb fb fb fb fb fb fb fb fc fc fc fc
>ffff888098fde900: fb fb fb fb fb fb fb fb fb fb fb fb fc fc fc fc
                      ^
 ffff888098fde980: 00 00 00 00 00 00 00 00 00 00 fc fc fc fc fc fc
 ffff888098fdea00: 00 00 00 00 00 00 00 00 00 00 00 00 fc fc fc fc
==================================================================

Crashes (10):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2020/11/26 18:39 linux-4.14.y 87335852c5d9 2f1cec62 .config console log report info ci2-linux-4-14
2020/11/13 23:22 linux-4.14.y 27ce4f2a6817 1bf9a662 .config console log report info ci2-linux-4-14
2020/09/08 14:05 linux-4.14.y 2f166cdcf8a9 abf9ba4f .config console log report ci2-linux-4-14
2020/08/28 20:30 linux-4.14.y d7e78d08fa77 d5a3ae1f .config console log report ci2-linux-4-14
2020/08/28 01:16 linux-4.14.y d7e78d08fa77 816e0689 .config console log report ci2-linux-4-14
2020/08/23 03:49 linux-4.14.y 6a24ca2506d6 1da71ab0 .config console log report ci2-linux-4-14
2020/08/05 22:23 linux-4.14.y ca4f2c56d416 0487ea6f .config console log report ci2-linux-4-14
2020/07/01 19:32 linux-4.14.y b850307b279c 39acb39d .config console log report ci2-linux-4-14
2020/05/08 11:36 linux-4.14.y d71f695ce745 fe4122c3 .config console log report ci2-linux-4-14
2020/03/28 12:23 linux-4.14.y 01364dad1d45 f1ebdfba .config console log report ci2-linux-4-14
* Struck through repros no longer work on HEAD.