================================================================== BUG: KASAN: use-after-free in __lock_acquire+0x3c2f/0x5470 kernel/locking/lockdep.c:4897 Read of size 8 at addr ffff88801c753b40 by task syz-executor.5/11534 CPU: 0 PID: 11534 Comm: syz-executor.5 Not tainted 5.16.0-syzkaller #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 Call Trace: __dump_stack lib/dump_stack.c:88 [inline] dump_stack_lvl+0xcd/0x134 lib/dump_stack.c:106 print_address_description.constprop.0.cold+0x8d/0x303 mm/kasan/report.c:255 __kasan_report mm/kasan/report.c:442 [inline] kasan_report.cold+0x83/0xdf mm/kasan/report.c:459 __lock_acquire+0x3c2f/0x5470 kernel/locking/lockdep.c:4897 lock_acquire kernel/locking/lockdep.c:5639 [inline] lock_acquire+0x1ab/0x510 kernel/locking/lockdep.c:5604 __raw_spin_lock_irqsave include/linux/spinlock_api_smp.h:110 [inline] _raw_spin_lock_irqsave+0x39/0x50 kernel/locking/spinlock.c:162 remove_wait_queue+0x1d/0x180 kernel/sched/wait.c:55 free_poll_entry fs/select.c:135 [inline] poll_freewait+0xd1/0x250 fs/select.c:144 do_sys_poll+0x9f3/0xeb0 fs/select.c:1016 __do_sys_ppoll fs/select.c:1121 [inline] __se_sys_ppoll fs/select.c:1101 [inline] __x64_sys_ppoll+0x210/0x280 fs/select.c:1101 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x35/0xb0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x44/0xae RIP: 0033:0x7f823b17efe9 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 bc ff ff ff f7 d8 64 89 01 48 RSP: 002b:00007f8239af4168 EFLAGS: 00000246 ORIG_RAX: 000000000000010f RAX: ffffffffffffffda RBX: 00007f823b291f60 RCX: 00007f823b17efe9 RDX: 0000000020000100 RSI: 0000000000000001 RDI: 00000000200000c0 RBP: 00007f823b1d908d R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000 R13: 00007ffe39adf82f R14: 00007f8239af4300 R15: 0000000000022000 Allocated by task 11534: kasan_save_stack+0x1e/0x50 mm/kasan/common.c:38 kasan_set_track mm/kasan/common.c:46 [inline] set_alloc_info mm/kasan/common.c:437 [inline] ____kasan_kmalloc mm/kasan/common.c:516 [inline] ____kasan_kmalloc mm/kasan/common.c:475 [inline] __kasan_kmalloc+0xa6/0xd0 mm/kasan/common.c:525 kasan_kmalloc include/linux/kasan.h:270 [inline] kmem_cache_alloc_trace+0x1ea/0x4a0 mm/slab.c:3567 kmalloc include/linux/slab.h:581 [inline] psi_trigger_create.part.0+0x15e/0x7f0 kernel/sched/psi.c:1152 cgroup_pressure_write+0x17e/0x6e0 kernel/cgroup/cgroup.c:3647 cgroup_file_write+0x1de/0x760 kernel/cgroup/cgroup.c:3877 kernfs_fop_write_iter+0x342/0x500 fs/kernfs/file.c:296 call_write_iter include/linux/fs.h:2086 [inline] new_sync_write+0x431/0x660 fs/read_write.c:503 vfs_write+0x7cd/0xae0 fs/read_write.c:590 ksys_write+0x12d/0x250 fs/read_write.c:643 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x35/0xb0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x44/0xae Freed by task 11543: kasan_save_stack+0x1e/0x50 mm/kasan/common.c:38 kasan_set_track+0x21/0x30 mm/kasan/common.c:46 kasan_set_free_info+0x20/0x30 mm/kasan/generic.c:370 ____kasan_slab_free mm/kasan/common.c:367 [inline] ____kasan_slab_free mm/kasan/common.c:329 [inline] __kasan_slab_free+0xee/0x130 mm/kasan/common.c:375 kasan_slab_free include/linux/kasan.h:236 [inline] __cache_free mm/slab.c:3437 [inline] kfree+0xf6/0x290 mm/slab.c:3794 cgroup_pressure_write+0x1b3/0x6e0 kernel/cgroup/cgroup.c:3653 cgroup_file_write+0x1de/0x760 kernel/cgroup/cgroup.c:3877 kernfs_fop_write_iter+0x342/0x500 fs/kernfs/file.c:296 call_write_iter include/linux/fs.h:2086 [inline] new_sync_write+0x431/0x660 fs/read_write.c:503 vfs_write+0x7cd/0xae0 fs/read_write.c:590 ksys_write+0x12d/0x250 fs/read_write.c:643 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x35/0xb0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x44/0xae Last potentially related work creation: kasan_save_stack+0x1e/0x50 mm/kasan/common.c:38 __kasan_record_aux_stack+0x7e/0x90 mm/kasan/generic.c:348 insert_work+0x48/0x370 kernel/workqueue.c:1368 __queue_work+0x5ca/0xee0 kernel/workqueue.c:1534 queue_work_on+0xee/0x110 kernel/workqueue.c:1562 queue_work include/linux/workqueue.h:502 [inline] netdevice_queue_work drivers/infiniband/core/roce_gid_mgmt.c:659 [inline] netdevice_event+0x42f/0x8a0 drivers/infiniband/core/roce_gid_mgmt.c:802 notifier_call_chain+0xb5/0x200 kernel/notifier.c:84 call_netdevice_notifiers_info+0xb5/0x130 net/core/dev.c:1919 call_netdevice_notifiers_extack net/core/dev.c:1931 [inline] call_netdevice_notifiers net/core/dev.c:1945 [inline] register_netdevice+0x1073/0x1500 net/core/dev.c:9692 ip6gre_newlink_common.constprop.0+0x16a/0x350 net/ipv6/ip6_gre.c:1987 ip6gre_newlink+0x21f/0x7d0 net/ipv6/ip6_gre.c:2018 __rtnl_newlink+0x106e/0x1750 net/core/rtnetlink.c:3479 rtnl_newlink+0x64/0xa0 net/core/rtnetlink.c:3527 rtnetlink_rcv_msg+0x413/0xb80 net/core/rtnetlink.c:5592 netlink_rcv_skb+0x153/0x420 net/netlink/af_netlink.c:2494 netlink_unicast_kernel net/netlink/af_netlink.c:1317 [inline] netlink_unicast+0x539/0x7e0 net/netlink/af_netlink.c:1343 netlink_sendmsg+0x904/0xe00 net/netlink/af_netlink.c:1919 sock_sendmsg_nosec net/socket.c:705 [inline] sock_sendmsg+0xcf/0x120 net/socket.c:725 __sys_sendto+0x21c/0x320 net/socket.c:2040 __do_sys_sendto net/socket.c:2052 [inline] __se_sys_sendto net/socket.c:2048 [inline] __x64_sys_sendto+0xdd/0x1b0 net/socket.c:2048 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x35/0xb0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x44/0xae The buggy address belongs to the object at ffff88801c753b00 which belongs to the cache kmalloc-192 of size 192 The buggy address is located 64 bytes inside of 192-byte region [ffff88801c753b00, ffff88801c753bc0) The buggy address belongs to the page: page:ffffea000071d4c0 refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x1c753 flags: 0xfff00000000200(slab|node=0|zone=1|lastcpupid=0x7ff) raw: 00fff00000000200 ffffea0001fe8108 ffffea00006e6648 ffff888010c40000 raw: 0000000000000000 ffff88801c753000 0000000100000010 0000000000000000 page dumped because: kasan: bad access detected page_owner tracks the page as allocated page last allocated via order 0, migratetype Unmovable, gfp_mask 0x252000(__GFP_NOWARN|__GFP_NORETRY|__GFP_COMP|__GFP_THISNODE), pid 90, ts 8005993710, free_ts 0 prep_new_page mm/page_alloc.c:2433 [inline] get_page_from_freelist+0xa72/0x2f50 mm/page_alloc.c:4164 __alloc_pages+0x1b2/0x500 mm/page_alloc.c:5386 __alloc_pages_node include/linux/gfp.h:572 [inline] kmem_getpages mm/slab.c:1378 [inline] cache_grow_begin+0x75/0x350 mm/slab.c:2584 cache_alloc_refill+0x27f/0x380 mm/slab.c:2957 ____cache_alloc mm/slab.c:3040 [inline] ____cache_alloc mm/slab.c:3023 [inline] slab_alloc_node mm/slab.c:3241 [inline] kmem_cache_alloc_node_trace+0x49c/0x5b0 mm/slab.c:3609 __do_kmalloc_node mm/slab.c:3631 [inline] __kmalloc_node+0x38/0x60 mm/slab.c:3639 kmalloc_array_node include/linux/slab.h:677 [inline] kcalloc_node include/linux/slab.h:682 [inline] sbitmap_init_node+0x1c3/0x6f0 lib/sbitmap.c:114 blk_mq_alloc_hctx block/blk-mq.c:3517 [inline] blk_mq_alloc_and_init_hctx block/blk-mq.c:3921 [inline] blk_mq_realloc_hw_ctxs+0xbe2/0x1460 block/blk-mq.c:3973 blk_mq_init_allocated_queue+0x3ca/0x1370 block/blk-mq.c:4035 blk_mq_init_queue_data block/blk-mq.c:3869 [inline] blk_mq_init_queue+0xbd/0x140 block/blk-mq.c:3879 scsi_alloc_sdev+0x814/0xd60 drivers/scsi/scsi_scan.c:288 scsi_probe_and_add_lun+0x200b/0x3590 drivers/scsi/scsi_scan.c:1122 __scsi_scan_target+0x21f/0xdb0 drivers/scsi/scsi_scan.c:1604 scsi_scan_channel drivers/scsi/scsi_scan.c:1692 [inline] scsi_scan_channel+0x148/0x1e0 drivers/scsi/scsi_scan.c:1668 scsi_scan_host_selected+0x2df/0x3b0 drivers/scsi/scsi_scan.c:1721 do_scsi_scan_host+0x1e8/0x260 drivers/scsi/scsi_scan.c:1860 page_owner free stack trace missing Memory state around the buggy address: ffff88801c753a00: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ffff88801c753a80: 00 00 00 fc fc fc fc fc fc fc fc fc fc fc fc fc >ffff88801c753b00: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff88801c753b80: fb fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc ffff88801c753c00: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ==================================================================