================================================================== BUG: KASAN: use-after-free in get_disk_and_module block/genhd.c:1524 [inline] BUG: KASAN: use-after-free in exact_lock+0x34/0xc0 block/genhd.c:594 Read of size 8 at addr ffff8881f04c14d0 by task syz.0.950/4469 CPU: 0 PID: 4469 Comm: syz.0.950 Tainted: G W 5.4.290-syzkaller-00017-g6b07fcd94a6a #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 02/12/2025 Call Trace: __dump_stack lib/dump_stack.c:77 [inline] dump_stack+0x1d8/0x241 lib/dump_stack.c:118 print_address_description+0x8c/0x600 mm/kasan/report.c:384 __kasan_report+0xf3/0x120 mm/kasan/report.c:516 kasan_report+0x30/0x60 mm/kasan/common.c:653 get_disk_and_module block/genhd.c:1524 [inline] exact_lock+0x34/0xc0 block/genhd.c:594 kobj_lookup+0x2a3/0x450 drivers/base/map.c:119 get_gendisk+0xd7/0x370 block/genhd.c:879 bdev_get_gendisk fs/block_dev.c:1105 [inline] __blkdev_get+0x166/0x1160 fs/block_dev.c:1560 blkdev_get+0x2de/0x3a0 fs/block_dev.c:1714 do_dentry_open+0x964/0x1130 fs/open.c:806 do_last fs/namei.c:3565 [inline] path_openat+0x29bf/0x34b0 fs/namei.c:3683 do_filp_open+0x20b/0x450 fs/namei.c:3713 do_sys_open+0x39c/0x810 fs/open.c:1123 do_syscall_64+0xca/0x1c0 arch/x86/entry/common.c:290 entry_SYSCALL_64_after_hwframe+0x5c/0xc1 RIP: 0033:0x7ff1ae03c169 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:00007ff1ac6a6038 EFLAGS: 00000246 ORIG_RAX: 0000000000000101 RAX: ffffffffffffffda RBX: 00007ff1ae254fa0 RCX: 00007ff1ae03c169 RDX: 0000000000000000 RSI: 0000400000000040 RDI: ffffffffffffff9c RBP: 00007ff1ae0bd2a0 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000060 R11: 0000000000000246 R12: 0000000000000000 R13: 0000000000000000 R14: 00007ff1ae254fa0 R15: 00007ffcdafadcf8 Allocated by task 0: save_stack mm/kasan/common.c:70 [inline] set_track mm/kasan/common.c:78 [inline] __kasan_kmalloc+0x171/0x210 mm/kasan/common.c:529 slab_post_alloc_hook mm/slab.h:584 [inline] slab_alloc_node mm/slub.c:2829 [inline] slab_alloc mm/slub.c:2837 [inline] __kmalloc_track_caller+0x100/0x2b0 mm/slub.c:4449 __kmalloc_reserve net/core/skbuff.c:142 [inline] __alloc_skb+0xb4/0x4d0 net/core/skbuff.c:210 alloc_skb include/linux/skbuff.h:1080 [inline] alloc_skb_with_frags+0x92/0x550 net/core/skbuff.c:5881 sock_alloc_send_pskb+0x831/0x950 net/core/sock.c:2276 mld_newpack+0x1b2/0x990 net/ipv6/mcast.c:1607 add_grhead net/ipv6/mcast.c:1710 [inline] add_grec+0xec5/0x12f0 net/ipv6/mcast.c:1841 mld_send_cr net/ipv6/mcast.c:1967 [inline] mld_ifc_timer_expire+0x73d/0xc10 net/ipv6/mcast.c:2474 call_timer_fn+0x36/0x390 kernel/time/timer.c:1448 expire_timers kernel/time/timer.c:1493 [inline] __run_timers+0x879/0xbe0 kernel/time/timer.c:1817 run_timer_softirq+0x63/0xf0 kernel/time/timer.c:1830 __do_softirq+0x23b/0x6b7 kernel/softirq.c:292 Freed by task 17: save_stack mm/kasan/common.c:70 [inline] set_track mm/kasan/common.c:78 [inline] kasan_set_free_info mm/kasan/common.c:345 [inline] __kasan_slab_free+0x1b5/0x270 mm/kasan/common.c:487 slab_free_hook mm/slub.c:1455 [inline] slab_free_freelist_hook mm/slub.c:1494 [inline] slab_free mm/slub.c:3080 [inline] kfree+0x123/0x370 mm/slub.c:4071 skb_release_all net/core/skbuff.c:675 [inline] __kfree_skb net/core/skbuff.c:689 [inline] kfree_skb+0xb8/0x3c0 net/core/skbuff.c:708 ip6_mc_input+0x236/0x2a0 net/ipv6/ip6_input.c:550 NF_HOOK include/linux/netfilter.h:303 [inline] ipv6_rcv+0xee/0x280 net/ipv6/ip6_input.c:278 __netif_receive_skb_one_core net/core/dev.c:4991 [inline] __netif_receive_skb+0x1c6/0x530 net/core/dev.c:5105 process_backlog+0x34f/0x680 net/core/dev.c:5940 napi_poll net/core/dev.c:6386 [inline] net_rx_action+0x53f/0x1160 net/core/dev.c:6454 __do_softirq+0x23b/0x6b7 kernel/softirq.c:292 The buggy address belongs to the object at ffff8881f04c1000 which belongs to the cache kmalloc-2k of size 2048 The buggy address is located 1232 bytes inside of 2048-byte region [ffff8881f04c1000, ffff8881f04c1800) The buggy address belongs to the page: page:ffffea0007c13000 refcount:1 mapcount:0 mapping:ffff8881f5c0c000 index:0x0 compound_mapcount: 0 flags: 0x8000000000010200(slab|head) raw: 8000000000010200 dead000000000100 dead000000000122 ffff8881f5c0c000 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) set_page_owner include/linux/page_owner.h:31 [inline] post_alloc_hook mm/page_alloc.c:2165 [inline] prep_new_page+0x18f/0x370 mm/page_alloc.c:2171 get_page_from_freelist+0x2d13/0x2d90 mm/page_alloc.c:3794 __alloc_pages_nodemask+0x393/0x840 mm/page_alloc.c:4893 alloc_slab_page+0x39/0x3c0 mm/slub.c:343 allocate_slab mm/slub.c:1683 [inline] new_slab+0x97/0x440 mm/slub.c:1749 new_slab_objects mm/slub.c:2505 [inline] ___slab_alloc+0x2fe/0x490 mm/slub.c:2667 __slab_alloc+0x62/0xa0 mm/slub.c:2707 slab_alloc_node mm/slub.c:2792 [inline] slab_alloc mm/slub.c:2837 [inline] kmem_cache_alloc_trace+0x12d/0x260 mm/slub.c:2854 kmem_cache_alloc_node_trace include/linux/slab.h:444 [inline] kmalloc_node include/linux/slab.h:594 [inline] kzalloc_node include/linux/slab.h:701 [inline] __alloc_disk_node+0x76/0x5a0 block/genhd.c:1477 brd_alloc+0x17b/0x430 drivers/block/brd.c:394 brd_init+0x120/0x427 drivers/block/brd.c:518 do_one_initcall+0x186/0x6d0 init/main.c:1192 do_initcall_level+0x213/0x41e init/main.c:1259 do_initcalls+0x49/0x86 init/main.c:1275 kernel_init_freeable+0x2b9/0x466 init/main.c:1458 kernel_init+0xd/0x380 init/main.c:1375 page_owner free stack trace missing Memory state around the buggy address: ffff8881f04c1380: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff8881f04c1400: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb >ffff8881f04c1480: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff8881f04c1500: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff8881f04c1580: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ==================================================================