syzbot


KASAN: use-after-free Read in chrdev_open

Status: upstream: reported C repro on 2021/02/03 08:18
Reported-by: syzbot+c05684cca229196d876c@syzkaller.appspotmail.com
First crash: 1176d, last: 604d
Fix bisection: failed (error log, bisect log)
  
Similar bugs (4)
Kernel Title Repro Cause bisect Fix bisect Count Last Reported Patched Status
linux-4.19 KASAN: use-after-free Read in chrdev_open C error 14 603d 1169d 0/1 upstream: reported C repro on 2021/02/11 04:55
android-54 KASAN: use-after-free Read in chrdev_open 1 1283d 1283d 0/2 auto-closed as invalid on 2021/02/16 08:03
android-54 general protection fault in chrdev_open C 1 687d 687d 0/2 auto-obsoleted due to no activity on 2023/04/22 08:07
android-5-10 general protection fault in chrdev_open C error 1 687d 686d 2/2 fixed on 2023/08/02 14:36
Last patch testing requests (3)
Created Duration User Patch Repo Result
2023/03/05 11:32 0m retest repro linux-4.14.y error OK
2023/03/05 10:32 0m retest repro linux-4.14.y error OK
2023/03/05 09:32 0m retest repro linux-4.14.y error OK
Fix bisection attempts (18)
Created Duration User Patch Repo Result
2022/10/13 02:11 0m bisect fix linux-4.14.y error job log (0)
2022/08/30 00:23 27m bisect fix linux-4.14.y job log (0) log
2022/07/28 07:40 29m bisect fix linux-4.14.y job log (0) log
2022/06/28 07:18 19m bisect fix linux-4.14.y job log (0) log
2022/05/28 18:46 21m bisect fix linux-4.14.y job log (0) log
2022/04/28 18:17 28m bisect fix linux-4.14.y job log (0) log
2022/03/29 17:48 28m bisect fix linux-4.14.y job log (0) log
2022/02/25 22:58 26m bisect fix linux-4.14.y job log (0) log
2022/01/26 22:19 22m bisect fix linux-4.14.y job log (0) log
2021/12/27 21:56 22m bisect fix linux-4.14.y job log (0) log
2021/11/27 21:32 24m bisect fix linux-4.14.y job log (0) log
2021/10/28 21:06 24m bisect fix linux-4.14.y job log (0) log
2021/09/25 14:10 27m bisect fix linux-4.14.y job log (0) log
2021/08/26 13:44 26m bisect fix linux-4.14.y job log (0) log
2021/06/23 01:43 20m bisect fix linux-4.14.y job log (0) log
2021/05/24 01:15 28m bisect fix linux-4.14.y job log (0) log
2021/04/04 09:25 24m bisect fix linux-4.14.y job log (0) log
2021/03/05 08:54 21m bisect fix linux-4.14.y job log (0) log

Sample crash report:
==================================================================
BUG: KASAN: use-after-free in __list_add_valid+0x81/0xa0 lib/list_debug.c:23
Read of size 8 at addr ffff8880b3cef448 by task syz-executor292/7981

CPU: 1 PID: 7981 Comm: syz-executor292 Not tainted 4.14.240-syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011
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
 __list_add_valid+0x81/0xa0 lib/list_debug.c:23
 __list_add include/linux/list.h:60 [inline]
 list_add include/linux/list.h:79 [inline]
 chrdev_open+0x45c/0x6d0 fs/char_dev.c:405
 do_dentry_open+0x44b/0xec0 fs/open.c:777
 vfs_open+0x105/0x220 fs/open.c:888
 do_last fs/namei.c:3428 [inline]
 path_openat+0x628/0x2970 fs/namei.c:3569
 do_filp_open+0x179/0x3c0 fs/namei.c:3603
 do_sys_open+0x296/0x410 fs/open.c:1081
 do_syscall_64+0x1d5/0x640 arch/x86/entry/common.c:292
 entry_SYSCALL_64_after_hwframe+0x46/0xbb
RIP: 0033:0x446809
RSP: 002b:00007fa685b1c2f8 EFLAGS: 00000246 ORIG_RAX: 0000000000000101
RAX: ffffffffffffffda RBX: 00000000004d0510 RCX: 0000000000446809
RDX: 0000000000000000 RSI: 0000000020002100 RDI: 00000000ffffff9c
RBP: 00000000004a013c R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000246 R12: 000000000049e138
R13: 2f30656c69662f2e R14: 0000000100000001 R15: 00000000004d0518

Allocated by task 7974:
 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+0x124/0x3c0 mm/slab.c:3552
 fuse_alloc_inode+0x1d/0x3f0 fs/fuse/inode.c:87
 alloc_inode+0x5d/0x170 fs/inode.c:210
 iget5_locked+0x169/0x450 fs/inode.c:1050
 fuse_iget+0x164/0x730 fs/fuse/inode.c:307
 fuse_lookup_name+0x3bb/0x550 fs/fuse/dir.c:341
 fuse_lookup+0xcd/0x390 fs/fuse/dir.c:368
 fuse_atomic_open+0x1bb/0x2d0 fs/fuse/dir.c:508
 atomic_open fs/namei.c:3075 [inline]
 lookup_open+0xe0e/0x1750 fs/namei.c:3211
 do_last fs/namei.c:3334 [inline]
 path_openat+0x14bb/0x2970 fs/namei.c:3569
 do_filp_open+0x179/0x3c0 fs/namei.c:3603
 do_sys_open+0x296/0x410 fs/open.c:1081
 do_syscall_64+0x1d5/0x640 arch/x86/entry/common.c:292
 entry_SYSCALL_64_after_hwframe+0x46/0xbb

Freed by task 0:
 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]
 kmem_cache_free+0x7c/0x2b0 mm/slab.c:3758
 __rcu_reclaim kernel/rcu/rcu.h:195 [inline]
 rcu_do_batch kernel/rcu/tree.c:2699 [inline]
 invoke_rcu_callbacks kernel/rcu/tree.c:2962 [inline]
 __rcu_process_callbacks kernel/rcu/tree.c:2929 [inline]
 rcu_process_callbacks+0x780/0x1180 kernel/rcu/tree.c:2946
 __do_softirq+0x24d/0x9ff kernel/softirq.c:288

The buggy address belongs to the object at ffff8880b3cef0c0
 which belongs to the cache fuse_inode of size 1272
The buggy address is located 904 bytes inside of
 1272-byte region [ffff8880b3cef0c0, ffff8880b3cef5b8)
The buggy address belongs to the page:
page:ffffea0002cf3b80 count:1 mapcount:0 mapping:ffff8880b3cee040 index:0xffff8880b3cefffb compound_mapcount: 0
flags: 0xfff00000008100(slab|head)
raw: 00fff00000008100 ffff8880b3cee040 ffff8880b3cefffb 0000000100000005
raw: ffff8880b1346b48 ffffea00026cb020 ffff888238c1e980 0000000000000000
page dumped because: kasan: bad access detected

Memory state around the buggy address:
 ffff8880b3cef300: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
 ffff8880b3cef380: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
>ffff8880b3cef400: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
                                              ^
 ffff8880b3cef480: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
 ffff8880b3cef500: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
==================================================================

Crashes (4):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2021/07/27 13:40 linux-4.14.y 964f3712e6a7 fd511809 .config console log report syz C ci2-linux-4-14 KASAN: use-after-free Read in chrdev_open
2021/06/27 15:05 linux-4.14.y cfb41ef9deb1 9d2ab5df .config console log report syz C ci2-linux-4-14 KASAN: use-after-free Read in chrdev_open
2021/02/03 08:17 linux-4.14.y 2c8a3fceddf0 624dad51 .config console log report syz C ci2-linux-4-14 KASAN: use-after-free Read in chrdev_open
2021/04/23 15:47 linux-4.14.y cf256fbcbe34 17f0b706 .config console log report info ci2-linux-4-14 KASAN: use-after-free Read in chrdev_open
* Struck through repros no longer work on HEAD.