syzbot


KASAN: use-after-free Read in refcount_inc_not_zero

Status: upstream: reported C repro on 2019/04/11 23:45
Reported-by: syzbot+9e1040586a4c03788599@syzkaller.appspotmail.com
First crash: 1841d, last: 1429d
Fix bisection: failed (error log, bisect log)
  
Similar bugs (1)
Kernel Title Repro Cause bisect Fix bisect Count Last Reported Patched Status
upstream KASAN: use-after-free Read in refcount_inc_not_zero kernel C 34 2306d 2367d 0/26 closed as invalid on 2018/01/31 06:12
Last patch testing requests (2)
Created Duration User Patch Repo Result
2022/12/30 02:31 13m retest repro linux-4.14.y report log
2022/08/31 22:27 9m retest repro linux-4.14.y report log
Fix bisection attempts (8)
Created Duration User Patch Repo Result
2020/06/27 15:33 0m (2) bisect fix linux-4.14.y error job log (0)
2020/05/28 12:50 23m bisect fix linux-4.14.y job log (0) log
2020/04/28 12:09 23m bisect fix linux-4.14.y job log (0) log
2020/03/29 10:12 22m bisect fix linux-4.14.y job log (0) log
2020/02/28 09:38 23m bisect fix linux-4.14.y job log (0) log
2020/01/29 03:24 25m bisect fix linux-4.14.y job log (0) log
2019/12/30 02:54 22m bisect fix linux-4.14.y job log (0) log
2019/11/30 02:31 23m bisect fix linux-4.14.y job log (0) log

Sample crash report:
==================================================================
BUG: KASAN: use-after-free in __read_once_size include/linux/compiler.h:186 [inline]
BUG: KASAN: use-after-free in atomic_read arch/x86/include/asm/atomic.h:27 [inline]
BUG: KASAN: use-after-free in refcount_inc_not_zero+0xd3/0xe0 lib/refcount.c:120
Read of size 4 at addr ffff8880979c1a80 by task kworker/u4:1/22

CPU: 1 PID: 22 Comm: kworker/u4:1 Not tainted 4.14.113 #3
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+0x138/0x19c lib/dump_stack.c:53
 print_address_description.cold+0x7c/0x1dc mm/kasan/report.c:252
 kasan_report_error mm/kasan/report.c:351 [inline]
 kasan_report mm/kasan/report.c:409 [inline]
 kasan_report.cold+0xaf/0x2b5 mm/kasan/report.c:393
 __asan_report_load4_noabort+0x14/0x20 mm/kasan/report.c:429
 __read_once_size include/linux/compiler.h:186 [inline]
 atomic_read arch/x86/include/asm/atomic.h:27 [inline]
 refcount_inc_not_zero+0xd3/0xe0 lib/refcount.c:120
 refcount_inc+0x16/0x40 lib/refcount.c:153
 kref_get include/linux/kref.h:47 [inline]
 tipc_subscrb_get net/tipc/subscr.c:165 [inline]
 tipc_subscrp_subscribe net/tipc/subscr.c:303 [inline]
 tipc_subscrb_rcv_cb+0x61d/0xa80 net/tipc/subscr.c:338
 tipc_receive_from_sock+0x28a/0x4e0 net/tipc/server.c:273
 tipc_recv_work+0x8b/0xf0 net/tipc/server.c:547
 process_one_work+0x868/0x1610 kernel/workqueue.c:2114
 worker_thread+0x5d9/0x1050 kernel/workqueue.c:2248
 kthread+0x31c/0x430 kernel/kthread.c:232
 ret_from_fork+0x3a/0x50 arch/x86/entry/entry_64.S:402

Allocated by task 5:
 save_stack_trace+0x16/0x20 arch/x86/kernel/stacktrace.c:59
 save_stack+0x45/0xd0 mm/kasan/kasan.c:447
 set_track mm/kasan/kasan.c:459 [inline]
 kasan_kmalloc mm/kasan/kasan.c:551 [inline]
 kasan_kmalloc+0xce/0xf0 mm/kasan/kasan.c:529
 kmem_cache_alloc_trace+0x152/0x790 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+0x46/0x160 net/tipc/subscr.c:344
 tipc_accept_from_sock+0x280/0x470 net/tipc/server.c:313
 tipc_recv_work+0x8b/0xf0 net/tipc/server.c:547
 process_one_work+0x868/0x1610 kernel/workqueue.c:2114
 worker_thread+0x5d9/0x1050 kernel/workqueue.c:2248
 kthread+0x31c/0x430 kernel/kthread.c:232
 ret_from_fork+0x3a/0x50 arch/x86/entry/entry_64.S:402

Freed by task 5:
 save_stack_trace+0x16/0x20 arch/x86/kernel/stacktrace.c:59
 save_stack+0x45/0xd0 mm/kasan/kasan.c:447
 set_track mm/kasan/kasan.c:459 [inline]
 kasan_slab_free+0x75/0xc0 mm/kasan/kasan.c:524
 __cache_free mm/slab.c:3496 [inline]
 kfree+0xcc/0x270 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+0x27/0x30 net/tipc/subscr.c:160
 tipc_subscrb_delete net/tipc/subscr.c:239 [inline]
 tipc_subscrb_release_cb+0x20/0x30 net/tipc/subscr.c:316
 tipc_close_conn+0x179/0x210 net/tipc/server.c:203
 tipc_send_to_sock net/tipc/server.c:538 [inline]
 tipc_send_work+0x470/0x5a0 net/tipc/server.c:564
 process_one_work+0x868/0x1610 kernel/workqueue.c:2114
 worker_thread+0x5d9/0x1050 kernel/workqueue.c:2248
 kthread+0x31c/0x430 kernel/kthread.c:232
 ret_from_fork+0x3a/0x50 arch/x86/entry/entry_64.S:402

The buggy address belongs to the object at ffff8880979c1a80
 which belongs to the cache kmalloc-96 of size 96
The buggy address is located 0 bytes inside of
 96-byte region [ffff8880979c1a80, ffff8880979c1ae0)
The buggy address belongs to the page:
page:ffffea00025e7040 count:1 mapcount:0 mapping:ffff8880979c1000 index:0xffff8880979c1000
flags: 0x1fffc0000000100(slab)
raw: 01fffc0000000100 ffff8880979c1000 ffff8880979c1000 0000000100000008
raw: ffffea00023e9be0 ffffea0002482ca0 ffff8880aa8004c0 0000000000000000
page dumped because: kasan: bad access detected

Memory state around the buggy address:
 ffff8880979c1980: fb fb fb fb fb fb fb fb fb fb fb fb fc fc fc fc
 ffff8880979c1a00: fb fb fb fb fb fb fb fb fb fb fb fb fc fc fc fc
>ffff8880979c1a80: fb fb fb fb fb fb fb fb fb fb fb fb fc fc fc fc
                   ^
 ffff8880979c1b00: fb fb fb fb fb fb fb fb fb fb fb fb fc fc fc fc
 ffff8880979c1b80: fb fb fb fb fb fb fb fb fb fb fb fb fc fc fc fc
==================================================================

Crashes (17):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2019/04/24 06:25 linux-4.14.y 68d7a45eec10 2398edea .config console log report syz C ci2-linux-4-14
2019/05/11 21:30 linux-4.14.y d929572d7da9 0637a7f0 .config console log report ci2-linux-4-14
2019/05/08 09:54 linux-4.14.y b4677bbb658d a7383bfa .config console log report ci2-linux-4-14
2019/05/06 17:16 linux-4.14.y 6d1510d86ef6 148296f4 .config console log report ci2-linux-4-14
2019/05/02 00:43 linux-4.14.y fa5941f45d7e 7516d9fa .config console log report ci2-linux-4-14
2019/04/30 19:13 linux-4.14.y fa5941f45d7e 618456b4 .config console log report ci2-linux-4-14
2019/04/30 18:21 linux-4.14.y fa5941f45d7e 618456b4 .config console log report ci2-linux-4-14
2019/04/29 08:50 linux-4.14.y fa5941f45d7e b617407b .config console log report ci2-linux-4-14
2019/04/28 21:54 linux-4.14.y fa5941f45d7e b617407b .config console log report ci2-linux-4-14
2019/04/28 18:55 linux-4.14.y fa5941f45d7e b617407b .config console log report ci2-linux-4-14
2019/04/26 14:34 linux-4.14.y 68d7a45eec10 b617407b .config console log report ci2-linux-4-14
2019/04/22 20:58 linux-4.14.y 68d7a45eec10 53199d6e .config console log report ci2-linux-4-14
2019/04/21 19:55 linux-4.14.y 68d7a45eec10 b0e8efcb .config console log report ci2-linux-4-14
2019/04/17 19:50 linux-4.14.y 58b454ebf81e b0e8efcb .config console log report ci2-linux-4-14
2019/04/17 06:28 linux-4.14.y 1ec8f1f0bffe b0e8efcb .config console log report ci2-linux-4-14
2019/04/13 09:20 linux-4.14.y 1ec8f1f0bffe c402d8f1 .config console log report ci2-linux-4-14
2019/04/11 22:44 linux-4.14.y 1ec8f1f0bffe 13030ef8 .config console log report ci2-linux-4-14
* Struck through repros no longer work on HEAD.