================================================================== BUG: KASAN: use-after-free in get_disk_and_module block/genhd.c:1787 [inline] BUG: KASAN: use-after-free in exact_lock+0x38/0xc0 block/genhd.c:677 Read of size 8 at addr ffff888109671460 by task syz.1.18354/32071 CPU: 0 PID: 32071 Comm: syz.1.18354 Tainted: G W 5.10.238-syzkaller-00008-g59e9a7228857 #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 05/07/2025 Call Trace: __dump_stack+0x21/0x24 lib/dump_stack.c:77 dump_stack_lvl+0x169/0x1d8 lib/dump_stack.c:118 print_address_description+0x7f/0x2c0 mm/kasan/report.c:248 __kasan_report mm/kasan/report.c:435 [inline] kasan_report+0xe2/0x130 mm/kasan/report.c:452 __asan_report_load8_noabort+0x14/0x20 mm/kasan/report_generic.c:309 get_disk_and_module block/genhd.c:1787 [inline] exact_lock+0x38/0xc0 block/genhd.c:677 kobj_lookup+0x298/0x430 drivers/base/map.c:119 get_gendisk+0xe9/0x340 block/genhd.c:1001 bdev_get_gendisk fs/block_dev.c:1110 [inline] __blkdev_get+0x1b0/0x12f0 fs/block_dev.c:1474 blkdev_get fs/block_dev.c:1653 [inline] blkdev_get_by_path+0x253/0x470 fs/block_dev.c:1690 mount_bdev+0x50/0x3a0 fs/super.c:1400 vfat_mount+0x34/0x40 fs/fat/namei_vfat.c:1057 legacy_get_tree+0xed/0x190 fs/fs_context.c:593 vfs_get_tree+0x89/0x260 fs/super.c:1572 do_new_mount+0x25a/0xa20 fs/namespace.c:2915 path_mount+0x572/0xc80 fs/namespace.c:3245 do_mount fs/namespace.c:3258 [inline] __do_sys_mount fs/namespace.c:3466 [inline] __se_sys_mount+0x318/0x380 fs/namespace.c:3443 __x64_sys_mount+0xbf/0xd0 fs/namespace.c:3443 do_syscall_64+0x31/0x40 arch/x86/entry/common.c:46 entry_SYSCALL_64_after_hwframe+0x61/0xcb RIP: 0033:0x7f8470e78929 Code: ff ff c3 66 2e 0f 1f 84 00 00 00 00 00 0f 1f 40 00 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 a8 ff ff ff f7 d8 64 89 01 48 RSP: 002b:00007f846f4e1038 EFLAGS: 00000246 ORIG_RAX: 00000000000000a5 RAX: ffffffffffffffda RBX: 00007f847109ffa0 RCX: 00007f8470e78929 RDX: 0000200000001200 RSI: 00002000000000c0 RDI: 00002000000001c0 RBP: 00007f8470efab39 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000 R13: 0000000000000000 R14: 00007f847109ffa0 R15: 00007ffc160ed9c8 Allocated by task 26523: kasan_save_stack mm/kasan/common.c:38 [inline] kasan_set_track mm/kasan/common.c:45 [inline] set_alloc_info mm/kasan/common.c:430 [inline] ____kasan_kmalloc mm/kasan/common.c:509 [inline] __kasan_kmalloc+0xda/0x110 mm/kasan/common.c:518 kasan_kmalloc include/linux/kasan.h:254 [inline] __kmalloc+0x1a7/0x330 mm/slub.c:4033 __kmalloc_node include/linux/slab.h:418 [inline] kmalloc_node include/linux/slab.h:575 [inline] kvmalloc_node+0x88/0x130 mm/util.c:612 kvmalloc include/linux/mm.h:822 [inline] kvmalloc_array include/linux/mm.h:840 [inline] alloc_fdtable+0xd1/0x270 fs/file.c:132 dup_fd+0x793/0xb20 fs/file.c:350 copy_files+0xc9/0x160 kernel/fork.c:1541 copy_process+0x10d7/0x32c0 kernel/fork.c:2256 kernel_clone+0x23f/0x940 kernel/fork.c:2650 __do_sys_clone kernel/fork.c:2776 [inline] __se_sys_clone kernel/fork.c:2760 [inline] __x64_sys_clone+0x176/0x1d0 kernel/fork.c:2760 do_syscall_64+0x31/0x40 arch/x86/entry/common.c:46 entry_SYSCALL_64_after_hwframe+0x61/0xcb Freed by task 32027: kasan_save_stack mm/kasan/common.c:38 [inline] kasan_set_track+0x4a/0x70 mm/kasan/common.c:45 kasan_set_free_info+0x23/0x40 mm/kasan/generic.c:370 ____kasan_slab_free+0x125/0x160 mm/kasan/common.c:362 __kasan_slab_free+0x11/0x20 mm/kasan/common.c:370 kasan_slab_free include/linux/kasan.h:220 [inline] slab_free_hook mm/slub.c:1595 [inline] slab_free_freelist_hook+0xc5/0x190 mm/slub.c:1621 slab_free mm/slub.c:3203 [inline] kfree+0xc0/0x270 mm/slub.c:4191 skb_free_head net/core/skbuff.c:606 [inline] skb_release_data+0x532/0x670 net/core/skbuff.c:626 skb_release_all net/core/skbuff.c:680 [inline] __kfree_skb net/core/skbuff.c:694 [inline] kfree_skb+0xb9/0x2f0 net/core/skbuff.c:713 __skb_queue_purge include/linux/skbuff.h:2881 [inline] tipc_mcast_xmit+0x11f6/0x1710 net/tipc/bcast.c:428 tipc_sendmcast net/tipc/socket.c:866 [inline] __tipc_sendmsg+0x1d69/0x2be0 net/tipc/socket.c:1458 tipc_sendmsg+0x55/0x70 net/tipc/socket.c:1391 sock_sendmsg_nosec net/socket.c:652 [inline] __sock_sendmsg net/socket.c:664 [inline] sock_sendmsg net/socket.c:687 [inline] kernel_sendmsg+0x1f8/0x2e0 net/socket.c:711 sock_no_sendpage+0xe6/0x130 net/core/sock.c:2893 kernel_sendpage+0x23e/0x2c0 net/socket.c:3546 sock_sendpage+0x86/0xb0 net/socket.c:964 pipe_to_sendpage+0x21c/0x310 fs/splice.c:364 splice_from_pipe_feed fs/splice.c:418 [inline] __splice_from_pipe+0x31c/0x8e0 fs/splice.c:562 splice_from_pipe fs/splice.c:597 [inline] generic_splice_sendpage+0xf3/0x150 fs/splice.c:746 do_splice_from fs/splice.c:767 [inline] direct_splice_actor+0xe9/0x120 fs/splice.c:936 splice_direct_to_actor+0x4c0/0xb10 fs/splice.c:891 do_splice_direct+0x1b3/0x2c0 fs/splice.c:979 do_sendfile+0x8ca/0xf90 fs/read_write.c:1257 __do_sys_sendfile64 fs/read_write.c:1318 [inline] __se_sys_sendfile64 fs/read_write.c:1304 [inline] __x64_sys_sendfile64+0x18f/0x1f0 fs/read_write.c:1304 do_syscall_64+0x31/0x40 arch/x86/entry/common.c:46 entry_SYSCALL_64_after_hwframe+0x61/0xcb Last potentially related work creation: kasan_save_stack+0x3a/0x60 mm/kasan/common.c:38 __kasan_record_aux_stack+0xd2/0x100 mm/kasan/generic.c:348 kasan_record_aux_stack_noalloc+0xb/0x10 mm/kasan/generic.c:358 insert_work+0x52/0x310 kernel/workqueue.c:1352 __queue_work+0x923/0xca0 kernel/workqueue.c:1518 queue_work_on+0xd5/0x130 kernel/workqueue.c:1545 queue_work include/linux/workqueue.h:515 [inline] schedule_work include/linux/workqueue.h:576 [inline] destroy_super_rcu+0xd1/0xe0 fs/super.c:172 rcu_do_batch+0x4df/0xa80 kernel/rcu/tree.c:2494 rcu_core+0x55f/0xd60 kernel/rcu/tree.c:2735 rcu_core_si+0x9/0x10 kernel/rcu/tree.c:2748 __do_softirq+0x255/0x563 kernel/softirq.c:309 Second to last potentially related work creation: kasan_save_stack+0x3a/0x60 mm/kasan/common.c:38 __kasan_record_aux_stack+0xd2/0x100 mm/kasan/generic.c:348 kasan_record_aux_stack_noalloc+0xb/0x10 mm/kasan/generic.c:358 __call_rcu kernel/rcu/tree.c:2976 [inline] call_rcu+0x105/0x1040 kernel/rcu/tree.c:3050 __put_super+0x254/0x2b0 fs/super.c:299 put_super fs/super.c:313 [inline] deactivate_locked_super+0xd4/0x100 fs/super.c:346 deactivate_super+0xaf/0xe0 fs/super.c:366 cleanup_mnt+0x446/0x500 fs/namespace.c:1114 __cleanup_mnt+0x19/0x20 fs/namespace.c:1121 task_work_run+0x127/0x190 kernel/task_work.c:189 tracehook_notify_resume include/linux/tracehook.h:188 [inline] exit_to_user_mode_loop+0xcb/0xe0 kernel/entry/common.c:172 exit_to_user_mode_prepare kernel/entry/common.c:199 [inline] syscall_exit_to_user_mode+0x68/0x90 kernel/entry/common.c:274 do_syscall_64+0x3d/0x40 arch/x86/entry/common.c:56 entry_SYSCALL_64_after_hwframe+0x61/0xcb The buggy address belongs to the object at ffff888109671000 which belongs to the cache kmalloc-2k of size 2048 The buggy address is located 1120 bytes inside of 2048-byte region [ffff888109671000, ffff888109671800) The buggy address belongs to the page: page:ffffea0004259c00 refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x109670 head:ffffea0004259c00 order:3 compound_mapcount:0 compound_pincount:0 flags: 0x4000000000010200(slab|head) raw: 4000000000010200 dead000000000100 dead000000000122 ffff888100042d80 raw: 0000000000000000 0000000000080008 00000001ffffffff 0000000000000000 page dumped because: kasan: bad access detected page_owner tracks the page as allocated page last allocated via order 3, migratetype Unmovable, gfp_mask 0xd20c0(__GFP_IO|__GFP_FS|__GFP_NOWARN|__GFP_NORETRY|__GFP_COMP|__GFP_NOMEMALLOC), pid 1, ts 1771935991, free_ts 0 set_page_owner include/linux/page_owner.h:35 [inline] post_alloc_hook mm/page_alloc.c:2456 [inline] prep_new_page+0x179/0x180 mm/page_alloc.c:2462 get_page_from_freelist+0x2235/0x23d0 mm/page_alloc.c:4254 __alloc_pages_nodemask+0x268/0x5f0 mm/page_alloc.c:5357 alloc_slab_page mm/slub.c:-1 [inline] allocate_slab mm/slub.c:1808 [inline] new_slab+0x84/0x3f0 mm/slub.c:1869 new_slab_objects mm/slub.c:2627 [inline] ___slab_alloc+0x2a6/0x450 mm/slub.c:2791 __slab_alloc+0x63/0xa0 mm/slub.c:2831 slab_alloc_node mm/slub.c:2913 [inline] slab_alloc mm/slub.c:2955 [inline] kmem_cache_alloc_trace+0x1b3/0x2e0 mm/slub.c:2972 kmem_cache_alloc_node_trace include/linux/slab.h:440 [inline] kmalloc_node include/linux/slab.h:570 [inline] kzalloc_node include/linux/slab.h:675 [inline] __alloc_disk_node+0x79/0x580 block/genhd.c:1727 loop_add+0x33f/0x7b0 drivers/block/loop.c:2158 loop_init+0x1bf/0x1ff drivers/block/loop.c:2403 do_one_initcall+0x187/0x510 init/main.c:1197 do_initcall_level+0x16f/0x2cf init/main.c:1270 do_initcalls+0x50/0x92 init/main.c:1286 do_basic_setup+0x88/0x8f init/main.c:1306 kernel_init_freeable+0x287/0x3be init/main.c:1510 kernel_init+0x11/0x1a0 init/main.c:1397 page_owner free stack trace missing Memory state around the buggy address: ffff888109671300: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff888109671380: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb >ffff888109671400: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff888109671480: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff888109671500: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ==================================================================