================================================================== BUG: KASAN: use-after-free in constant_test_bit arch/x86/include/asm/bitops.h:325 [inline] BUG: KASAN: use-after-free in fuse_dev_do_read.isra.27+0x1659/0x1920 fs/fuse/dev.c:1318 Read of size 8 at addr ffff8801d9060a30 by task syz-executor4/24685 CPU: 1 PID: 24685 Comm: syz-executor4 Not tainted 4.19.0+ #312 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+0x244/0x39d lib/dump_stack.c:113 print_address_description.cold.7+0x9/0x1ff mm/kasan/report.c:256 kasan_report_error mm/kasan/report.c:354 [inline] kasan_report.cold.8+0x242/0x309 mm/kasan/report.c:412 __asan_report_load8_noabort+0x14/0x20 mm/kasan/report.c:433 constant_test_bit arch/x86/include/asm/bitops.h:325 [inline] fuse_dev_do_read.isra.27+0x1659/0x1920 fs/fuse/dev.c:1318 fuse_dev_read+0x1a9/0x250 fs/fuse/dev.c:1360 call_read_iter include/linux/fs.h:1833 [inline] new_sync_read fs/read_write.c:406 [inline] __vfs_read+0x6ac/0x9b0 fs/read_write.c:418 vfs_read+0x17f/0x3c0 fs/read_write.c:452 ksys_read+0x101/0x260 fs/read_write.c:578 __do_sys_read fs/read_write.c:588 [inline] __se_sys_read fs/read_write.c:586 [inline] __x64_sys_read+0x73/0xb0 fs/read_write.c:586 do_syscall_64+0x1b9/0x820 arch/x86/entry/common.c:290 entry_SYSCALL_64_after_hwframe+0x49/0xbe RIP: 0033:0x457569 Code: fd b3 fb ff c3 66 2e 0f 1f 84 00 00 00 00 00 66 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 0f 83 cb b3 fb ff c3 66 2e 0f 1f 84 00 00 00 00 RSP: 002b:00007f95e9681c78 EFLAGS: 00000246 ORIG_RAX: 0000000000000000 RAX: ffffffffffffffda RBX: 0000000000000003 RCX: 0000000000457569 RDX: 0000000000001000 RSI: 00000000200020c0 RDI: 0000000000000003 RBP: 000000000072bfa0 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 00007f95e96826d4 R13: 00000000004c3414 R14: 00000000004d51a0 R15: 00000000ffffffff Allocated by task 24680: save_stack+0x43/0xd0 mm/kasan/kasan.c:448 set_track mm/kasan/kasan.c:460 [inline] kasan_kmalloc+0xc7/0xe0 mm/kasan/kasan.c:553 kasan_slab_alloc+0x12/0x20 mm/kasan/kasan.c:490 kmem_cache_alloc+0x12e/0x730 mm/slab.c:3554 __fuse_request_alloc+0x27/0xf0 fs/fuse/dev.c:58 fuse_request_alloc fs/fuse/dev.c:89 [inline] __fuse_get_req+0x1f7/0x9e0 fs/fuse/dev.c:164 fuse_get_req fs/fuse/dev.c:194 [inline] fuse_simple_request+0x28/0x730 fs/fuse/dev.c:549 fuse_lookup_name+0x3ee/0x830 fs/fuse/dir.c:323 fuse_lookup+0xff/0x4c0 fs/fuse/dir.c:361 __lookup_slow+0x2b5/0x540 fs/namei.c:1671 lookup_slow+0x57/0x80 fs/namei.c:1688 walk_component+0x92b/0x2590 fs/namei.c:1810 lookup_last fs/namei.c:2273 [inline] path_lookupat.isra.43+0x212/0xc00 fs/namei.c:2318 filename_lookup+0x26a/0x520 fs/namei.c:2348 user_path_at_empty+0x40/0x50 fs/namei.c:2608 user_path_at include/linux/namei.h:57 [inline] vfs_statx+0x129/0x210 fs/stat.c:185 vfs_stat include/linux/fs.h:3144 [inline] __do_sys_newstat+0x8f/0x110 fs/stat.c:339 __se_sys_newstat fs/stat.c:335 [inline] __x64_sys_newstat+0x54/0x80 fs/stat.c:335 do_syscall_64+0x1b9/0x820 arch/x86/entry/common.c:290 entry_SYSCALL_64_after_hwframe+0x49/0xbe Freed by task 24680: save_stack+0x43/0xd0 mm/kasan/kasan.c:448 set_track mm/kasan/kasan.c:460 [inline] __kasan_slab_free+0x102/0x150 mm/kasan/kasan.c:521 kasan_slab_free+0xe/0x10 mm/kasan/kasan.c:528 __cache_free mm/slab.c:3498 [inline] kmem_cache_free+0x83/0x290 mm/slab.c:3760 fuse_request_free+0x8b/0xa0 fs/fuse/dev.c:104 fuse_put_request+0x2a6/0x350 fs/fuse/dev.c:304 fuse_simple_request+0x453/0x730 fs/fuse/dev.c:571 fuse_lookup_name+0x3ee/0x830 fs/fuse/dir.c:323 fuse_lookup+0xff/0x4c0 fs/fuse/dir.c:361 __lookup_slow+0x2b5/0x540 fs/namei.c:1671 lookup_slow+0x57/0x80 fs/namei.c:1688 walk_component+0x92b/0x2590 fs/namei.c:1810 lookup_last fs/namei.c:2273 [inline] path_lookupat.isra.43+0x212/0xc00 fs/namei.c:2318 filename_lookup+0x26a/0x520 fs/namei.c:2348 user_path_at_empty+0x40/0x50 fs/namei.c:2608 user_path_at include/linux/namei.h:57 [inline] vfs_statx+0x129/0x210 fs/stat.c:185 vfs_stat include/linux/fs.h:3144 [inline] __do_sys_newstat+0x8f/0x110 fs/stat.c:339 __se_sys_newstat fs/stat.c:335 [inline] __x64_sys_newstat+0x54/0x80 fs/stat.c:335 do_syscall_64+0x1b9/0x820 arch/x86/entry/common.c:290 entry_SYSCALL_64_after_hwframe+0x49/0xbe The buggy address belongs to the object at ffff8801d9060a00 which belongs to the cache fuse_request of size 448 The buggy address is located 48 bytes inside of 448-byte region [ffff8801d9060a00, ffff8801d9060bc0) The buggy address belongs to the page: page:ffffea0007641800 count:1 mapcount:0 mapping:ffff8801d442aac0 index:0x0 flags: 0x2fffc0000000200(slab) raw: 02fffc0000000200 ffffea0007274cc8 ffffea00074c0f48 ffff8801d442aac0 raw: 0000000000000000 ffff8801d9060000 0000000100000008 0000000000000000 page dumped because: kasan: bad access detected Memory state around the buggy address: ffff8801d9060900: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff8801d9060980: fb fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc >ffff8801d9060a00: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff8801d9060a80: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff8801d9060b00: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ================================================================== ------------[ cut here ]------------ downgrading a read lock WARNING: CPU: 1 PID: 24686 at kernel/locking/lockdep.c:3556 __lock_downgrade kernel/locking/lockdep.c:3556 [inline] WARNING: CPU: 1 PID: 24686 at kernel/locking/lockdep.c:3556 lock_downgrade+0x4d7/0x900 kernel/locking/lockdep.c:3819