syzbot


KASAN: use-after-free Read in chrdev_open

Status: upstream: reported C repro on 2021/02/11 04:55
Reported-by: syzbot+7c5ec771fa8a51b6c096@syzkaller.appspotmail.com
First crash: 1379d, last: 813d
Fix bisection: failed (error log, bisect log)
  
Similar bugs (5)
Kernel Title Repro Cause bisect Fix bisect Count Last Reported Patched Status
linux-4.14 KASAN: use-after-free Read in chrdev_open C error 4 814d 1387d 0/1 upstream: reported C repro on 2021/02/03 08:18
android-54 KASAN: use-after-free Read in chrdev_open 1 1494d 1494d 0/2 auto-closed as invalid on 2021/02/16 08:03
upstream KASAN: slab-use-after-free Read in chrdev_open ntfs3 C done 10 28d 208d 0/28 upstream: reported C repro on 2024/04/26 12:00
android-54 general protection fault in chrdev_open C 1 897d 897d 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 897d 896d 2/2 fixed on 2023/08/02 14:36
Fix bisection attempts (8)
Created Duration User Patch Repo Result
2021/11/12 10:57 11m bisect fix linux-4.19.y error job log
2021/10/13 10:28 28m bisect fix linux-4.19.y OK (0) job log log
2021/09/13 10:02 26m bisect fix linux-4.19.y OK (0) job log log
2021/07/19 19:29 26m bisect fix linux-4.19.y OK (0) job log log
2021/06/11 06:09 23m bisect fix linux-4.19.y OK (0) job log log
2021/05/12 05:45 23m bisect fix linux-4.19.y OK (0) job log log
2021/04/12 05:16 28m bisect fix linux-4.19.y OK (0) job log log
2021/03/13 04:54 22m bisect fix linux-4.19.y OK (0) job log 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 ffff88808dfca3c0 by task syz-executor411/8086

CPU: 1 PID: 8086 Comm: syz-executor411 Not tainted 4.19.211-syzkaller #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+0x1fc/0x2ef lib/dump_stack.c:118
 print_address_description.cold+0x54/0x219 mm/kasan/report.c:256
 kasan_report_error.cold+0x8a/0x1b9 mm/kasan/report.c:354
 kasan_report mm/kasan/report.c:412 [inline]
 __asan_report_load8_noabort+0x88/0x90 mm/kasan/report.c:433
 __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+0x4b9/0x770 fs/char_dev.c:405
 do_dentry_open+0x4aa/0x1160 fs/open.c:796
 do_last fs/namei.c:3421 [inline]
 path_openat+0x793/0x2df0 fs/namei.c:3537
 do_filp_open+0x18c/0x3f0 fs/namei.c:3567
 do_sys_open+0x3b3/0x520 fs/open.c:1085
 do_syscall_64+0xf9/0x620 arch/x86/entry/common.c:293
 entry_SYSCALL_64_after_hwframe+0x49/0xbe
RIP: 0033:0x7fab1f484b29
Code: 28 00 00 00 75 05 48 83 c4 28 c3 e8 41 15 00 00 90 48 89 f8 48 89 f7 48 89 d6 48 89 ca 4d 89 c2 4d 89 c8 4c 8b 4c 24 08 0f 05 <48> 3d 01 f0 ff ff 73 01 c3 48 c7 c1 b8 ff ff ff f7 d8 64 89 01 48
RSP: 002b:00007fab1f4142f8 EFLAGS: 00000246 ORIG_RAX: 0000000000000002
RAX: ffffffffffffffda RBX: 00007fab1f5124d0 RCX: 00007fab1f484b29
RDX: 0000000000000000 RSI: 0000000000000000 RDI: 0000000020000080
RBP: 00007fab1f4df154 R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000246 R12: 00007fab1f4db148
R13: 00007fab1f4dd150 R14: 2f30656c69662f2e R15: 00007fab1f5124d8

Allocated by task 8079:
 kmem_cache_alloc+0x122/0x370 mm/slab.c:3559
 fuse_alloc_inode+0x1d/0x3f0 fs/fuse/inode.c:87
 alloc_inode+0x5d/0x180 fs/inode.c:211
 iget5_locked fs/inode.c:1131 [inline]
 iget5_locked+0x57/0xd0 fs/inode.c:1124
 fuse_iget+0x1a6/0x800 fs/fuse/inode.c:307
 fuse_lookup_name+0x413/0x5c0 fs/fuse/dir.c:341
 fuse_lookup+0xdf/0x410 fs/fuse/dir.c:368
 fuse_atomic_open+0x20a/0x330 fs/fuse/dir.c:508
 atomic_open fs/namei.c:3073 [inline]
 lookup_open+0x1023/0x1a20 fs/namei.c:3205
 do_last fs/namei.c:3327 [inline]
 path_openat+0x1804/0x2df0 fs/namei.c:3537
 do_filp_open+0x18c/0x3f0 fs/namei.c:3567
 do_sys_open+0x3b3/0x520 fs/open.c:1085
 do_syscall_64+0xf9/0x620 arch/x86/entry/common.c:293
 entry_SYSCALL_64_after_hwframe+0x49/0xbe

Freed by task 0:
 __cache_free mm/slab.c:3503 [inline]
 kmem_cache_free+0x7f/0x260 mm/slab.c:3765
 __rcu_reclaim kernel/rcu/rcu.h:236 [inline]
 rcu_do_batch kernel/rcu/tree.c:2584 [inline]
 invoke_rcu_callbacks kernel/rcu/tree.c:2897 [inline]
 __rcu_process_callbacks kernel/rcu/tree.c:2864 [inline]
 rcu_process_callbacks+0x8ff/0x18b0 kernel/rcu/tree.c:2881
 __do_softirq+0x265/0x980 kernel/softirq.c:292

The buggy address belongs to the object at ffff88808dfca040
 which belongs to the cache fuse_inode of size 1264
The buggy address is located 896 bytes inside of
 1264-byte region [ffff88808dfca040, ffff88808dfca530)
The buggy address belongs to the page:
page:ffffea000237f280 count:1 mapcount:0 mapping:ffff8880b0f81780 index:0xffff88808dfcaffe
flags: 0xfff00000000100(slab)
raw: 00fff00000000100 ffff8880b0f88a48 ffffea000237e508 ffff8880b0f81780
raw: ffff88808dfcaffe ffff88808dfca040 0000000100000002 0000000000000000
page dumped because: kasan: bad access detected

Memory state around the buggy address:
 ffff88808dfca280: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
 ffff88808dfca300: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
>ffff88808dfca380: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
                                           ^
 ffff88808dfca400: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
 ffff88808dfca480: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
==================================================================

Crashes (14):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2022/03/19 02:22 linux-4.19.y 3f8a27f9e27b e2d91b1d .config console log report syz C ci2-linux-4-19 KASAN: use-after-free Read in chrdev_open
2021/07/30 08:40 linux-4.19.y a89b48fe9308 c585c7b0 .config console log report syz C ci2-linux-4-19 KASAN: use-after-free Read in chrdev_open
2021/06/19 19:26 linux-4.19.y eb575cd5d7f6 aba2b2fb .config console log report syz C ci2-linux-4-19 KASAN: use-after-free Read in chrdev_open
2021/06/12 17:06 linux-4.19.y 9a2dc0e6c531 1ba81399 .config console log report syz C ci2-linux-4-19 KASAN: use-after-free Read in chrdev_open
2021/02/11 04:54 linux-4.19.y 811218eceeaa a52ee10a .config console log report syz C ci2-linux-4-19 KASAN: use-after-free Read in chrdev_open
2022/06/14 00:33 linux-4.19.y 3f8a27f9e27b 0f087040 .config console log report syz C ci2-linux-4-19 general protection fault in chrdev_open
2022/08/30 20:27 linux-4.19.y 3f8a27f9e27b 4a380809 .config console log report info [disk image] [vmlinux] ci2-linux-4-19 KASAN: use-after-free Read in chrdev_open
2022/05/28 02:22 linux-4.19.y 3f8a27f9e27b a46af346 .config console log report info ci2-linux-4-19 KASAN: use-after-free Read in chrdev_open
2022/05/25 23:30 linux-4.19.y 3f8a27f9e27b 3037caa9 .config console log report info ci2-linux-4-19 KASAN: use-after-free Read in chrdev_open
2022/05/19 09:30 linux-4.19.y 3f8a27f9e27b 50c53f39 .config console log report info ci2-linux-4-19 KASAN: use-after-free Read in chrdev_open
2022/03/17 15:01 linux-4.19.y 3f8a27f9e27b dfa9a8ed .config console log report info ci2-linux-4-19 KASAN: use-after-free Read in chrdev_open
2021/11/12 12:41 linux-4.19.y 3f8a27f9e27b 75b04091 .config console log report info ci2-linux-4-19 KASAN: use-after-free Read in chrdev_open
2021/08/14 10:02 linux-4.19.y addba38e7c3b 2489ab88 .config console log report info ci2-linux-4-19 KASAN: use-after-free Read in chrdev_open
2021/08/04 06:42 linux-4.19.y 53bd76690e27 6c236867 .config console log report info ci2-linux-4-19 KASAN: use-after-free Read in chrdev_open
* Struck through repros no longer work on HEAD.