================================================================== BUG: KASAN: use-after-free in __lock_acquire+0x3c2f/0x5470 kernel/locking/lockdep.c:4897 Read of size 8 at addr ffff88801c10cd40 by task syz-executor.1/5110 CPU: 1 PID: 5110 Comm: syz-executor.1 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/0x336 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 ep_remove_wait_queue+0x88/0x1a0 fs/eventpoll.c:545 ep_unregister_pollwait fs/eventpoll.c:561 [inline] ep_free+0x18a/0x390 fs/eventpoll.c:756 ep_eventpoll_release+0x41/0x60 fs/eventpoll.c:788 __fput+0x286/0x9f0 fs/file_table.c:280 task_work_run+0xdd/0x1a0 kernel/task_work.c:164 exit_task_work include/linux/task_work.h:32 [inline] do_exit+0xb29/0x2a30 kernel/exit.c:806 do_group_exit+0xd2/0x2f0 kernel/exit.c:935 get_signal+0x4b0/0x28c0 kernel/signal.c:2862 arch_do_signal_or_restart+0x2a9/0x1c40 arch/x86/kernel/signal.c:868 handle_signal_work kernel/entry/common.c:148 [inline] exit_to_user_mode_loop kernel/entry/common.c:172 [inline] exit_to_user_mode_prepare+0x17d/0x290 kernel/entry/common.c:207 __syscall_exit_to_user_mode_work kernel/entry/common.c:289 [inline] syscall_exit_to_user_mode+0x19/0x60 kernel/entry/common.c:300 do_syscall_64+0x42/0xb0 arch/x86/entry/common.c:86 entry_SYSCALL_64_after_hwframe+0x44/0xae RIP: 0033:0x7f03b4c48059 Code: Unable to access opcode bytes at RIP 0x7f03b4c4802f. RSP: 002b:00007f03b35bd168 EFLAGS: 00000246 ORIG_RAX: 0000000000000001 RAX: 000000000000002f RBX: 00007f03b4d5af60 RCX: 00007f03b4c48059 RDX: 000000000000002f RSI: 0000000020001340 RDI: 0000000000000006 RBP: 00007f03b4ca208d R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000 R13: 00007ffcaf1014bf R14: 00007f03b35bd300 R15: 0000000000022000 Allocated by task 5110: 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+0xa9/0xd0 mm/kasan/common.c:525 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 5110: 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+0x130/0x160 mm/kasan/common.c:329 kasan_slab_free include/linux/kasan.h:236 [inline] slab_free_hook mm/slub.c:1728 [inline] slab_free_freelist_hook+0x8b/0x1c0 mm/slub.c:1754 slab_free mm/slub.c:3509 [inline] kfree+0xcb/0x280 mm/slub.c:4562 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+0xbe/0xd0 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] dev_set_mac_address+0x2d5/0x3e0 net/core/dev.c:8400 bond_enslave+0x9f7/0x53c0 drivers/net/bonding/bond_main.c:1925 do_set_master+0x1c8/0x220 net/core/rtnetlink.c:2532 do_setlink+0x9f3/0x3a10 net/core/rtnetlink.c:2736 __rtnl_newlink+0xde7/0x1750 net/core/rtnetlink.c:3412 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 ffff88801c10cd00 which belongs to the cache kmalloc-192 of size 192 The buggy address is located 64 bytes inside of 192-byte region [ffff88801c10cd00, ffff88801c10cdc0) The buggy address belongs to the page: page:ffffea0000704300 refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x1c10c flags: 0xfff00000000200(slab|node=0|zone=1|lastcpupid=0x7ff) raw: 00fff00000000200 ffffea0001ef9cc0 dead000000000004 ffff888010c41a00 raw: 0000000000000000 0000000000100010 00000001ffffffff 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 0x12c00(GFP_NOIO|__GFP_NOWARN|__GFP_NORETRY), pid 8, ts 7900738913, free_ts 0 prep_new_page mm/page_alloc.c:2434 [inline] get_page_from_freelist+0xa72/0x2f50 mm/page_alloc.c:4165 __alloc_pages+0x1b2/0x500 mm/page_alloc.c:5389 __alloc_pages_node include/linux/gfp.h:572 [inline] alloc_slab_page mm/slub.c:1801 [inline] allocate_slab mm/slub.c:1944 [inline] new_slab+0xab/0x3b0 mm/slub.c:2004 ___slab_alloc+0x87c/0xe90 mm/slub.c:3018 __slab_alloc.constprop.0+0x4d/0xa0 mm/slub.c:3105 slab_alloc_node mm/slub.c:3196 [inline] kmem_cache_alloc_node_trace+0x116/0x310 mm/slub.c:3280 kmalloc_node include/linux/slab.h:599 [inline] kzalloc_node include/linux/slab.h:726 [inline] blk_alloc_flush_queue+0x91/0x320 block/blk-flush.c:476 blk_mq_alloc_hctx block/blk-mq.c:3526 [inline] blk_mq_alloc_and_init_hctx block/blk-mq.c:3921 [inline] blk_mq_realloc_hw_ctxs+0xd4e/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: ffff88801c10cc00: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ffff88801c10cc80: 00 00 00 00 00 00 00 00 fc fc fc fc fc fc fc fc >ffff88801c10cd00: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff88801c10cd80: fb fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc ffff88801c10ce00: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ==================================================================