================================================================== BUG: KASAN: use-after-free in atomic64_read include/asm-generic/atomic-instrumented.h:27 [inline] BUG: KASAN: use-after-free in atomic_long_read include/asm-generic/atomic-long.h:47 [inline] BUG: KASAN: use-after-free in __mutex_unlock_slowpath+0x9b/0x6b0 kernel/locking/mutex.c:1206 Read of size 8 at addr ffff88809499f758 by task syz-executor.2/10109 CPU: 0 PID: 10109 Comm: syz-executor.2 Not tainted 4.19.91-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+0x197/0x210 lib/dump_stack.c:118 print_address_description.cold+0x7c/0x20d mm/kasan/report.c:256 kasan_report_error mm/kasan/report.c:354 [inline] kasan_report mm/kasan/report.c:412 [inline] kasan_report.cold+0x8c/0x2ba mm/kasan/report.c:396 check_memory_region_inline mm/kasan/kasan.c:260 [inline] check_memory_region+0x123/0x190 mm/kasan/kasan.c:267 kasan_check_read+0x11/0x20 mm/kasan/kasan.c:272 atomic64_read include/asm-generic/atomic-instrumented.h:27 [inline] atomic_long_read include/asm-generic/atomic-long.h:47 [inline] __mutex_unlock_slowpath+0x9b/0x6b0 kernel/locking/mutex.c:1206 mutex_unlock+0xd/0x10 kernel/locking/mutex.c:713 blkdev_get+0x5a4/0x990 fs/block_dev.c:1668 blkdev_get_by_dev+0x42/0x80 fs/block_dev.c:1747 lock_rdev+0xa0/0x160 drivers/md/md.c:2307 md_import_device+0x221/0x520 drivers/md/md.c:3488 add_new_disk+0x593/0x18c0 drivers/md/md.c:6347 md_ioctl+0x45d4/0x5980 drivers/md/md.c:7365 __blkdev_driver_ioctl block/ioctl.c:303 [inline] blkdev_ioctl+0xc38/0x1ab6 block/ioctl.c:601 block_ioctl+0xee/0x130 fs/block_dev.c:1891 vfs_ioctl fs/ioctl.c:46 [inline] file_ioctl fs/ioctl.c:501 [inline] do_vfs_ioctl+0xd5f/0x1380 fs/ioctl.c:688 ksys_ioctl+0xab/0xd0 fs/ioctl.c:705 __do_sys_ioctl fs/ioctl.c:712 [inline] __se_sys_ioctl fs/ioctl.c:710 [inline] __x64_sys_ioctl+0x73/0xb0 fs/ioctl.c:710 do_syscall_64+0xfd/0x620 arch/x86/entry/common.c:293 entry_SYSCALL_64_after_hwframe+0x49/0xbe RIP: 0033:0x45a919 Code: ad b6 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 7b b6 fb ff c3 66 2e 0f 1f 84 00 00 00 00 RSP: 002b:00007ffb8965ac78 EFLAGS: 00000246 ORIG_RAX: 0000000000000010 RAX: ffffffffffffffda RBX: 0000000000000003 RCX: 000000000045a919 RDX: 0000000020001200 RSI: 0000000040140921 RDI: 0000000000000008 RBP: 000000000075bf20 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 00007ffb8965b6d4 R13: 00000000004c2230 R14: 00000000004d73b8 R15: 00000000ffffffff Allocated by task 10109: save_stack+0x45/0xd0 mm/kasan/kasan.c:448 set_track mm/kasan/kasan.c:460 [inline] kasan_kmalloc mm/kasan/kasan.c:553 [inline] kasan_kmalloc+0xce/0xf0 mm/kasan/kasan.c:531 kasan_slab_alloc+0xf/0x20 mm/kasan/kasan.c:490 kmem_cache_alloc+0x12e/0x700 mm/slab.c:3559 bdev_alloc_inode+0x1c/0x50 fs/block_dev.c:744 alloc_inode+0x64/0x190 fs/inode.c:210 iget5_locked fs/inode.c:1123 [inline] iget5_locked+0x63/0xe0 fs/inode.c:1116 bdget+0x97/0x550 fs/block_dev.c:885 blkdev_get_by_dev+0x27/0x80 fs/block_dev.c:1743 lock_rdev+0xa0/0x160 drivers/md/md.c:2307 md_import_device+0x221/0x520 drivers/md/md.c:3488 add_new_disk+0x593/0x18c0 drivers/md/md.c:6347 md_ioctl+0x45d4/0x5980 drivers/md/md.c:7365 __blkdev_driver_ioctl block/ioctl.c:303 [inline] blkdev_ioctl+0xc38/0x1ab6 block/ioctl.c:601 block_ioctl+0xee/0x130 fs/block_dev.c:1891 vfs_ioctl fs/ioctl.c:46 [inline] file_ioctl fs/ioctl.c:501 [inline] do_vfs_ioctl+0xd5f/0x1380 fs/ioctl.c:688 ksys_ioctl+0xab/0xd0 fs/ioctl.c:705 __do_sys_ioctl fs/ioctl.c:712 [inline] __se_sys_ioctl fs/ioctl.c:710 [inline] __x64_sys_ioctl+0x73/0xb0 fs/ioctl.c:710 do_syscall_64+0xfd/0x620 arch/x86/entry/common.c:293 entry_SYSCALL_64_after_hwframe+0x49/0xbe Freed by task 11443: save_stack+0x45/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:3503 [inline] kmem_cache_free+0x86/0x260 mm/slab.c:3765 bdev_i_callback+0x20/0x30 fs/block_dev.c:755 __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+0xba0/0x1a30 kernel/rcu/tree.c:2881 __do_softirq+0x25c/0x921 kernel/softirq.c:292 The buggy address belongs to the object at ffff88809499f740 which belongs to the cache bdev_cache(65:syz2) of size 1344 The buggy address is located 24 bytes inside of 1344-byte region [ffff88809499f740, ffff88809499fc80) The buggy address belongs to the page: page:ffffea00025267c0 count:1 mapcount:0 mapping:ffff888076080500 index:0xffff88809499fffe flags: 0xfffe0000000100(slab) raw: 00fffe0000000100 ffffea0000e224c8 ffffea0002523688 ffff888076080500 raw: ffff88809499fffe ffff88809499f180 0000000100000002 ffff888052cb6140 page dumped because: kasan: bad access detected page->mem_cgroup:ffff888052cb6140 Memory state around the buggy address: ffff88809499f600: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff88809499f680: fb fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc >ffff88809499f700: fc fc fc fc fc fc fc fc fb fb fb fb fb fb fb fb ^ ffff88809499f780: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff88809499f800: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ==================================================================