syzbot


KASAN: use-after-free Write in kjournald2

Status: auto-obsoleted due to no activity on 2022/10/20 18:12
Reported-by: syzbot+1b9378587fd199ad88c7@syzkaller.appspotmail.com
First crash: 884d, last: 884d

Sample crash report:
==================================================================
BUG: KASAN: use-after-free in __write_once_size include/linux/compiler.h:295 [inline]
BUG: KASAN: use-after-free in __hlist_del include/linux/list.h:771 [inline]
BUG: KASAN: use-after-free in detach_timer kernel/time/timer.c:824 [inline]
BUG: KASAN: use-after-free in detach_if_pending kernel/time/timer.c:841 [inline]
BUG: KASAN: use-after-free in try_to_del_timer_sync+0x27c/0x460 kernel/time/timer.c:1238
Write of size 8 at addr ffff8881e56531c0 by task jbd2/sda1-8/119

CPU: 1 PID: 119 Comm: jbd2/sda1-8 Not tainted 5.4.190-syzkaller-00045-g4cc9c9d71eec #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+0x18e/0x1d5 lib/dump_stack.c:118
 print_address_description+0x8c/0x630 mm/kasan/report.c:384
 __kasan_report+0xf6/0x130 mm/kasan/report.c:516
 kasan_report+0x30/0x60 mm/kasan/common.c:653
 __write_once_size include/linux/compiler.h:295 [inline]
 __hlist_del include/linux/list.h:771 [inline]
 detach_timer kernel/time/timer.c:824 [inline]
 detach_if_pending kernel/time/timer.c:841 [inline]
 try_to_del_timer_sync+0x27c/0x460 kernel/time/timer.c:1238
 del_timer_sync+0x74/0xd0 kernel/time/timer.c:1379
 kjournald2+0x3fc/0x800 fs/jbd2/journal.c:208
 kthread+0x2d8/0x360 kernel/kthread.c:288
 ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:352

The buggy address belongs to the page:
page:ffffea00079594c0 refcount:0 mapcount:0 mapping:0000000000000000 index:0x0
flags: 0x8000000000000000()
raw: 8000000000000000 0000000000000000 dead000000000122 0000000000000000
raw: 0000000000000000 0000000000000000 00000000ffffffff 0000000000000000
page dumped because: kasan: bad access detected
page_owner tracks the page as freed
page last allocated via order 2, migratetype Unmovable, gfp_mask 0x140dc0(GFP_USER|__GFP_COMP|__GFP_ZERO)
 set_page_owner include/linux/page_owner.h:31 [inline]
 post_alloc_hook mm/page_alloc.c:2165 [inline]
 prep_new_page+0x194/0x380 mm/page_alloc.c:2171
 get_page_from_freelist+0x524/0x560 mm/page_alloc.c:3794
 __alloc_pages_nodemask+0x2ab/0x6f0 mm/page_alloc.c:4857
 __alloc_pages include/linux/gfp.h:503 [inline]
 __alloc_pages_node include/linux/gfp.h:516 [inline]
 alloc_pages_node include/linux/gfp.h:530 [inline]
 kmalloc_order mm/slab_common.c:1342 [inline]
 kmalloc_order_trace+0x2a/0xf0 mm/slab_common.c:1358
 kmalloc_large include/linux/slab.h:485 [inline]
 kmalloc include/linux/slab.h:549 [inline]
 kzalloc include/linux/slab.h:690 [inline]
 tipc_nametbl_init+0x93/0x260 net/tipc/name_table.c:738
 tipc_init_net+0x229/0x360 net/tipc/core.c:74
 ops_init+0x278/0x350 net/core/net_namespace.c:137
 setup_net+0x1bb/0x9e0 net/core/net_namespace.c:338
 copy_net_ns+0x2d4/0x470 net/core/net_namespace.c:479
 create_new_namespaces+0x440/0x5e0 kernel/nsproxy.c:103
 copy_namespaces+0x169/0x1b0 kernel/nsproxy.c:161
 copy_process+0x12a4/0x3200 kernel/fork.c:2044
 _do_fork+0x142/0x730 kernel/fork.c:2391
 __do_sys_clone kernel/fork.c:2549 [inline]
 __se_sys_clone kernel/fork.c:2530 [inline]
 __x64_sys_clone+0x213/0x260 kernel/fork.c:2530
 do_syscall_64+0xcb/0x1c0 arch/x86/entry/common.c:290
 entry_SYSCALL_64_after_hwframe+0x44/0xa9
page last free stack trace:
 reset_page_owner include/linux/page_owner.h:24 [inline]
 free_pages_prepare mm/page_alloc.c:1176 [inline]
 __free_pages_ok+0x7ee/0x920 mm/page_alloc.c:1438
 free_the_page mm/page_alloc.c:4919 [inline]
 __free_pages+0x45/0x1e0 mm/page_alloc.c:4925
 kfree+0x1ef/0x260 mm/slub.c:4068
 tipc_exit_net+0x92/0x100 net/tipc/core.c:108
 ops_exit_list net/core/net_namespace.c:172 [inline]
 cleanup_net+0x654/0xca0 net/core/net_namespace.c:602
 process_one_work+0x6ca/0xc40 kernel/workqueue.c:2287
 worker_thread+0xae0/0x1440 kernel/workqueue.c:2433
 kthread+0x2d8/0x360 kernel/kthread.c:288
 ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:352

Memory state around the buggy address:
 ffff8881e5653080: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
 ffff8881e5653100: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
>ffff8881e5653180: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
                                           ^
 ffff8881e5653200: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
 ffff8881e5653280: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
==================================================================

Crashes (1):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2022/06/22 18:12 android12-5.4 4cc9c9d71eec 912f5df7 .config console log report info ci2-android-5-4-perf-kasan KASAN: use-after-free Write in kjournald2
* Struck through repros no longer work on HEAD.