syzbot


KASAN: use-after-free Read in rhashtable_last_table

Status: auto-closed as invalid on 2021/08/13 13:57
Reported-by: syzbot+fb4b0db8d4638559f2cb@syzkaller.appspotmail.com
First crash: 448d, last: 448d
similar bugs (5):
Kernel Title Repro Cause bisect Fix bisect Count Last Reported Patched Status
upstream KASAN: use-after-free Read in rhashtable_last_table 4 1264d 1375d 0/22 closed as invalid on 2019/04/19 22:15
android-49 KASAN: use-after-free Read in rhashtable_last_table 2 958d 1041d 0/3 auto-closed as invalid on 2020/03/20 18:26
upstream KASAN: use-after-free Read in rhashtable_last_table (2) 1 1141d 1141d 13/22 fixed on 2019/08/05 13:45
linux-4.19 KASAN: use-after-free Read in rhashtable_last_table 2 414d 488d 0/1 auto-closed as invalid on 2021/09/15 21:37
linux-4.19 KASAN: use-after-free Read in rhashtable_last_table (2) 1 209d 209d 0/1 auto-closed as invalid on 2022/04/09 15:34

Sample crash report:
==================================================================
BUG: KASAN: use-after-free in __read_once_size include/linux/compiler.h:183 [inline]
BUG: KASAN: use-after-free in rhashtable_last_table+0xfc/0x120 lib/rhashtable.c:252
Read of size 8 at addr ffff88804b1284c0 by task kworker/0:4/9176

CPU: 0 PID: 9176 Comm: kworker/0:4 Not tainted 4.14.230-syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011
Workqueue: events rht_deferred_worker
Call Trace:
 __dump_stack lib/dump_stack.c:17 [inline]
 dump_stack+0x1b2/0x281 lib/dump_stack.c:58
 print_address_description.cold+0x54/0x1d3 mm/kasan/report.c:252
 kasan_report_error.cold+0x8a/0x191 mm/kasan/report.c:351
 kasan_report mm/kasan/report.c:409 [inline]
 __asan_report_load8_noabort+0x68/0x70 mm/kasan/report.c:430
 __read_once_size include/linux/compiler.h:183 [inline]
 rhashtable_last_table+0xfc/0x120 lib/rhashtable.c:252
 rht_deferred_worker+0x8f/0x1890 lib/rhashtable.c:453
 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 9176:
 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
 __do_kmalloc_node mm/slab.c:3682 [inline]
 __kmalloc_node+0x4c/0x70 mm/slab.c:3689
 kmalloc_node include/linux/slab.h:530 [inline]
 kvmalloc_node+0x88/0xd0 mm/util.c:397
 kvmalloc include/linux/mm.h:531 [inline]
 kvzalloc include/linux/mm.h:539 [inline]
 bucket_table_alloc+0x3a5/0x5d0 lib/rhashtable.c:217
 rhashtable_rehash_alloc+0x63/0x1f0 lib/rhashtable.c:396
 rhashtable_shrink lib/rhashtable.c:440 [inline]
 rht_deferred_worker+0x3fb/0x1890 lib/rhashtable.c:458
 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 9274:
 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
 kvfree+0x45/0x50 mm/util.c:416
 rhashtable_free_and_destroy+0x20a/0x710 lib/rhashtable.c:1093
 ops_exit_list+0xa5/0x150 net/core/net_namespace.c:142
 cleanup_net+0x3b3/0x840 net/core/net_namespace.c:484
 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 ffff88804b128480
 which belongs to the cache kmalloc-8192 of size 8192
The buggy address is located 64 bytes inside of
 8192-byte region [ffff88804b128480, ffff88804b12a480)
The buggy address belongs to the page:
page:ffffea00012c4a00 count:1 mapcount:0 mapping:ffff88804b128480 index:0x0 compound_mapcount: 0
flags: 0xfff00000008100(slab|head)
raw: 00fff00000008100 ffff88804b128480 0000000000000000 0000000100000001
raw: ffffea00010b8120 ffffea000113cd20 ffff88813fe09080 0000000000000000
page dumped because: kasan: bad access detected

Memory state around the buggy address:
 ffff88804b128380: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
 ffff88804b128400: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
>ffff88804b128480: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
                                           ^
 ffff88804b128500: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
 ffff88804b128580: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
==================================================================

Crashes (1):
Manager Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Title
ci2-linux-4-14 2021/04/15 13:56 linux-4.14.y 958e517f4e16 fcdb12ba .config log report info KASAN: use-after-free Read in rhashtable_last_table