audit: type=1804 audit(1674794492.491:977): pid=18301 uid=0 auid=4294967295 ses=4294967295 subj==unconfined op=invalid_pcr cause=ToMToU comm="syz-executor.5" name="/root/syzkaller-testdir601411695/syzkaller.5hid9T/262/file0/bus" dev="loop5" ino=18 res=1 ================================================================== audit: type=1804 audit(1674794492.511:978): pid=18301 uid=0 auid=4294967295 ses=4294967295 subj==unconfined op=invalid_pcr cause=ToMToU comm="syz-executor.5" name="/root/syzkaller-testdir601411695/syzkaller.5hid9T/262/file0/bus" dev="loop5" ino=18 res=1 BUG: KASAN: use-after-free in __lock_acquire+0x2cb4/0x3ff0 kernel/locking/lockdep.c:3295 Read of size 8 at addr ffff8880b16826f8 by task syz-executor.2/18230 CPU: 1 PID: 18230 Comm: syz-executor.2 Not tainted 4.19.211-syzkaller #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/12/2023 Call Trace: __dump_stack lib/dump_stack.c:77 [inline] dump_stack+0x1fc/0x2ef lib/dump_stack.c:118 print_address_description.cold+0x54/0x219 mm/kasan/report.c:256 kasan_report_error.cold+0x8a/0x1b9 mm/kasan/report.c:354 kasan_report mm/kasan/report.c:412 [inline] __asan_report_load8_noabort+0x88/0x90 mm/kasan/report.c:433 __lock_acquire+0x2cb4/0x3ff0 kernel/locking/lockdep.c:3295 lock_acquire+0x170/0x3c0 kernel/locking/lockdep.c:3908 __raw_write_lock_bh include/linux/rwlock_api_smp.h:203 [inline] _raw_write_lock_bh+0x2f/0x40 kernel/locking/spinlock.c:312 sock_orphan include/net/sock.h:1801 [inline] nr_release+0x5d/0x360 net/netrom/af_netrom.c:524 __sock_release+0xcd/0x2a0 net/socket.c:599 sock_close+0x15/0x20 net/socket.c:1214 __fput+0x2ce/0x890 fs/file_table.c:278 task_work_run+0x148/0x1c0 kernel/task_work.c:113 exit_task_work include/linux/task_work.h:22 [inline] do_exit+0xbf3/0x2be0 kernel/exit.c:870 do_group_exit+0x125/0x310 kernel/exit.c:967 get_signal+0x3f2/0x1f70 kernel/signal.c:2589 do_signal+0x8f/0x1670 arch/x86/kernel/signal.c:799 exit_to_usermode_loop+0x204/0x2a0 arch/x86/entry/common.c:163 prepare_exit_to_usermode+0x277/0x2d0 arch/x86/entry/common.c:198 retint_user+0x8/0x18 RIP: 0033:0x7f4d56b9d191 Code: Bad RIP value. RSP: 002b:00007f4d5512f600 EFLAGS: 00000293 ORIG_RAX: ffffffffffffff13 RAX: 0000000000a490b8 RBX: 00007f4d5512f660 RCX: 0000000000000001 RDX: 000000000000001d RSI: 00007f4d4ccef000 RDI: 00007f4d5512f700 RBP: 0000000000000102 R08: 0000000000000015 R09: 0000000000000000 R10: 0000000000000000 R11: 00007f4d5512f670 R12: 00007f4d5512f670 R13: 00007f4d5512f700 R14: 0000000000000001 R15: 0000000000000000 Allocated by task 18218: __do_kmalloc mm/slab.c:3727 [inline] __kmalloc+0x15a/0x3c0 mm/slab.c:3736 kmalloc include/linux/slab.h:520 [inline] sk_prot_alloc+0x1e2/0x2d0 net/core/sock.c:1483 sk_alloc+0x36/0xec0 net/core/sock.c:1537 nr_create+0xb2/0x5d0 net/netrom/af_netrom.c:436 __sock_create+0x3d8/0x740 net/socket.c:1365 sock_create net/socket.c:1416 [inline] __sys_socket+0xef/0x200 net/socket.c:1458 __do_sys_socket net/socket.c:1467 [inline] __se_sys_socket net/socket.c:1465 [inline] __x64_sys_socket+0x6f/0xb0 net/socket.c:1465 do_syscall_64+0xf9/0x620 arch/x86/entry/common.c:293 entry_SYSCALL_64_after_hwframe+0x49/0xbe Freed by task 18230: __cache_free mm/slab.c:3503 [inline] kfree+0xcc/0x210 mm/slab.c:3822 sk_prot_free net/core/sock.c:1520 [inline] __sk_destruct+0x684/0x8a0 net/core/sock.c:1602 sk_destruct net/core/sock.c:1617 [inline] __sk_free+0x165/0x3b0 net/core/sock.c:1628 sk_free+0x3b/0x50 net/core/sock.c:1639 sock_put include/net/sock.h:1713 [inline] nr_release+0x2dc/0x360 net/netrom/af_netrom.c:557 __sock_release+0xcd/0x2a0 net/socket.c:599 sock_close+0x15/0x20 net/socket.c:1214 __fput+0x2ce/0x890 fs/file_table.c:278 task_work_run+0x148/0x1c0 kernel/task_work.c:113 exit_task_work include/linux/task_work.h:22 [inline] do_exit+0xbf3/0x2be0 kernel/exit.c:870 do_group_exit+0x125/0x310 kernel/exit.c:967 get_signal+0x3f2/0x1f70 kernel/signal.c:2589 do_signal+0x8f/0x1670 arch/x86/kernel/signal.c:799 exit_to_usermode_loop+0x204/0x2a0 arch/x86/entry/common.c:163 prepare_exit_to_usermode+0x277/0x2d0 arch/x86/entry/common.c:198 retint_user+0x8/0x18 The buggy address belongs to the object at ffff8880b1682380 which belongs to the cache kmalloc-2048 of size 2048 The buggy address is located 888 bytes inside of 2048-byte region [ffff8880b1682380, ffff8880b1682b80) The buggy address belongs to the page: page:ffffea0002c5a080 count:1 mapcount:0 mapping:ffff88813bff0c40 index:0xffff8880b1682c00 compound_mapcount: 0 flags: 0xfff00000008100(slab|head) raw: 00fff00000008100 ffffea0002818d88 ffffea0002cc4388 ffff88813bff0c40 raw: ffff8880b1682c00 ffff8880b1682380 0000000100000002 0000000000000000 page dumped because: kasan: bad access detected Memory state around the buggy address: ffff8880b1682580: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff8880b1682600: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb >ffff8880b1682680: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff8880b1682700: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff8880b1682780: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ==================================================================