audit: type=1804 audit(1676962527.330:228): pid=13119 uid=0 auid=4294967295 ses=4294967295 op="invalid_pcr" cause="ToMToU" comm="syz-executor.4" name="/root/syzkaller-testdir2666600503/syzkaller.N2lVGg/128/bus" dev="sda1" ino=14130 res=1 ================================================================== BUG: KASAN: use-after-free in dev_put include/linux/netdevice.h:3382 [inline] BUG: KASAN: use-after-free in netdevice_event_work_handler+0x1c1/0x1d0 drivers/infiniband/core/roce_gid_mgmt.c:539 Read of size 8 at addr ffff888093a74b00 by task kworker/u4:3/409 CPU: 1 PID: 409 Comm: kworker/u4:3 Not tainted 4.14.305-syzkaller #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/21/2023 Workqueue: gid-cache-wq netdevice_event_work_handler Call Trace: __dump_stack lib/dump_stack.c:17 [inline] dump_stack+0x1b2/0x281 lib/dump_stack.c:58 print_address_description.cold+0x54/0x1d3 mm/kasan/report.c:251 kasan_report_error.cold+0x8a/0x191 mm/kasan/report.c:350 kasan_report mm/kasan/report.c:408 [inline] __asan_report_load8_noabort+0x68/0x70 mm/kasan/report.c:429 dev_put include/linux/netdevice.h:3382 [inline] netdevice_event_work_handler+0x1c1/0x1d0 drivers/infiniband/core/roce_gid_mgmt.c:539 audit: type=1804 audit(1676962527.450:229): pid=13122 uid=0 auid=4294967295 ses=4294967295 op="invalid_pcr" cause="ToMToU" comm="syz-executor.0" name="/root/syzkaller-testdir972817619/syzkaller.Rn7gwp/129/bus" dev="sda1" ino=14389 res=1 process_one_work+0x793/0x14a0 kernel/workqueue.c:2117 worker_thread+0x5cc/0xff0 kernel/workqueue.c:2251 kthread+0x30d/0x420 kernel/kthread.c:232 ret_from_fork+0x24/0x30 arch/x86/entry/entry_64.S:406 Allocated by task 13140: save_stack mm/kasan/kasan.c:447 [inline] set_track mm/kasan/kasan.c:459 [inline] kasan_kmalloc+0xeb/0x160 mm/kasan/kasan.c:551 __do_kmalloc_node mm/slab.c:3682 [inline] __kmalloc_node+0x4c/0x70 mm/slab.c:3689 kmalloc_node include/linux/slab.h:530 [inline] kvmalloc_node+0x42/0xc0 mm/util.c:432 kvmalloc include/linux/mm.h:531 [inline] kvzalloc include/linux/mm.h:539 [inline] alloc_netdev_mqs+0x76/0xb70 net/core/dev.c:8112 rtnl_create_link+0x1ab/0x890 net/core/rtnetlink.c:2460 rtnl_newlink+0xe7a/0x1830 net/core/rtnetlink.c:2720 rtnetlink_rcv_msg+0x3be/0xb10 net/core/rtnetlink.c:4322 netlink_rcv_skb+0x125/0x390 net/netlink/af_netlink.c:2461 netlink_unicast_kernel net/netlink/af_netlink.c:1302 [inline] netlink_unicast+0x437/0x610 net/netlink/af_netlink.c:1328 netlink_sendmsg+0x651/0xbc0 net/netlink/af_netlink.c:1900 sock_sendmsg_nosec net/socket.c:646 [inline] sock_sendmsg+0xb5/0x100 net/socket.c:656 ___sys_sendmsg+0x6c8/0x800 net/socket.c:2062 __sys_sendmsg+0xa3/0x120 net/socket.c:2096 SYSC_sendmsg net/socket.c:2107 [inline] SyS_sendmsg+0x27/0x40 net/socket.c:2103 do_syscall_64+0x1d5/0x640 arch/x86/entry/common.c:292 entry_SYSCALL_64_after_hwframe+0x5e/0xd3 Freed by task 13140: save_stack mm/kasan/kasan.c:447 [inline] set_track mm/kasan/kasan.c:459 [inline] kasan_slab_free+0xc3/0x1a0 mm/kasan/kasan.c:524 __cache_free mm/slab.c:3496 [inline] kfree+0xc9/0x250 mm/slab.c:3815 kvfree+0x45/0x50 mm/util.c:451 device_release+0x15f/0x1a0 drivers/base/core.c:848 kobject_cleanup lib/kobject.c:646 [inline] kobject_release lib/kobject.c:675 [inline] kref_put include/linux/kref.h:70 [inline] kobject_put+0x251/0x550 lib/kobject.c:692 put_device+0x1c/0x30 drivers/base/core.c:2030 free_netdev+0x26f/0x360 net/core/dev.c:8234 rtnl_newlink+0x14cd/0x1830 net/core/rtnetlink.c:2746 rtnetlink_rcv_msg+0x3be/0xb10 net/core/rtnetlink.c:4322 netlink_rcv_skb+0x125/0x390 net/netlink/af_netlink.c:2461 netlink_unicast_kernel net/netlink/af_netlink.c:1302 [inline] netlink_unicast+0x437/0x610 net/netlink/af_netlink.c:1328 netlink_sendmsg+0x651/0xbc0 net/netlink/af_netlink.c:1900 sock_sendmsg_nosec net/socket.c:646 [inline] sock_sendmsg+0xb5/0x100 net/socket.c:656 ___sys_sendmsg+0x6c8/0x800 net/socket.c:2062 __sys_sendmsg+0xa3/0x120 net/socket.c:2096 SYSC_sendmsg net/socket.c:2107 [inline] SyS_sendmsg+0x27/0x40 net/socket.c:2103 do_syscall_64+0x1d5/0x640 arch/x86/entry/common.c:292 entry_SYSCALL_64_after_hwframe+0x5e/0xd3 The buggy address belongs to the object at ffff888093a745c0 which belongs to the cache kmalloc-4096 of size 4096 The buggy address is located 1344 bytes inside of 4096-byte region [ffff888093a745c0, ffff888093a755c0) The buggy address belongs to the page: page:ffffea00024e9d00 count:1 mapcount:0 mapping:ffff888093a745c0 index:0x0 compound_mapcount: 0 flags: 0xfff00000008100(slab|head) raw: 00fff00000008100 ffff888093a745c0 0000000000000000 0000000100000001 raw: ffffea00026387a0 ffffea00026f5120 ffff88813fe74dc0 0000000000000000 page dumped because: kasan: bad access detected Memory state around the buggy address: ffff888093a74a00: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff888093a74a80: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb >ffff888093a74b00: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff888093a74b80: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff888093a74c00: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ================================================================== audit: type=1804 audit(1676962527.520:230): pid=13116 uid=0 auid=4294967295 ses=4294967295 op="invalid_pcr" cause="open_writers" comm="syz-executor.2" name="/root/syzkaller-testdir1548683403/syzkaller.7XsxfN/119/bus" dev="sda1" ino=14374 res=1