================================================================== BUG: KASAN: use-after-free in lockdep_register_key+0x396/0x410 kernel/locking/lockdep.c:1231 Read of size 8 at addr ffff88807ea16360 by task syz-executor.0/14047 CPU: 1 PID: 14047 Comm: syz-executor.0 Not tainted 6.3.0-rc4-next-20230330-syzkaller #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 03/02/2023 Call Trace: __dump_stack lib/dump_stack.c:88 [inline] dump_stack_lvl+0xd9/0x150 lib/dump_stack.c:106 print_address_description.constprop.0+0x2c/0x3c0 mm/kasan/report.c:351 print_report mm/kasan/report.c:462 [inline] kasan_report+0x11c/0x130 mm/kasan/report.c:572 lockdep_register_key+0x396/0x410 kernel/locking/lockdep.c:1231 wq_init_lockdep kernel/workqueue.c:3604 [inline] alloc_workqueue+0x3f8/0x1110 kernel/workqueue.c:4476 __ext4_fill_super fs/ext4/super.c:5363 [inline] ext4_fill_super+0x6d06/0xad90 fs/ext4/super.c:5637 get_tree_bdev+0x444/0x760 fs/super.c:1303 vfs_get_tree+0x8d/0x350 fs/super.c:1510 do_new_mount fs/namespace.c:3039 [inline] path_mount+0x134b/0x1e40 fs/namespace.c:3369 do_mount fs/namespace.c:3382 [inline] __do_sys_mount fs/namespace.c:3591 [inline] __se_sys_mount fs/namespace.c:3568 [inline] __x64_sys_mount+0x283/0x300 fs/namespace.c:3568 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x39/0xb0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x63/0xcd RIP: 0033:0x7f11fb28d62a Code: 48 c7 c2 b8 ff ff ff f7 d8 64 89 02 b8 ff ff ff ff eb d2 e8 b8 04 00 00 0f 1f 84 00 00 00 00 00 49 89 ca b8 a5 00 00 00 0f 05 <48> 3d 01 f0 ff ff 73 01 c3 48 c7 c1 b8 ff ff ff f7 d8 64 89 01 48 RSP: 002b:00007f11fc04ef88 EFLAGS: 00000202 ORIG_RAX: 00000000000000a5 RAX: ffffffffffffffda RBX: 0000000000000528 RCX: 00007f11fb28d62a RDX: 0000000020000040 RSI: 0000000020000000 RDI: 00007f11fc04efe0 RBP: 00007f11fc04f020 R08: 00007f11fc04f020 R09: 0000000000000484 R10: 0000000000000484 R11: 0000000000000202 R12: 0000000020000040 R13: 0000000020000000 R14: 00007f11fc04efe0 R15: 00000000200000c0 The buggy address belongs to the physical page: page:ffffea0001fa8580 refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x7ea16 flags: 0xfff00000000000(node=0|zone=1|lastcpupid=0x7ff) page_type: 0xffffffff() raw: 00fff00000000000 dead000000000100 dead000000000122 0000000000000000 raw: 0000000000000000 0000000000000000 00000000ffffffff 0000000000000000 page dumped because: kasan: bad access detected page_owner tracks the page as freed page last allocated via order 0, migratetype Unmovable, gfp_mask 0x100cc0(GFP_USER), pid 5121, tgid 5121 (syz-executor.3), ts 814754136540, free_ts 845856023005 prep_new_page mm/page_alloc.c:1729 [inline] get_page_from_freelist+0xf75/0x2aa0 mm/page_alloc.c:3493 __alloc_pages+0x1cb/0x4a0 mm/page_alloc.c:4759 alloc_pages+0x1aa/0x270 mm/mempolicy.c:2283 __get_free_pages+0xc/0x40 mm/page_alloc.c:4809 kasan_populate_vmalloc_pte mm/kasan/shadow.c:323 [inline] kasan_populate_vmalloc_pte+0x29/0x160 mm/kasan/shadow.c:314 apply_to_pte_range mm/memory.c:2585 [inline] apply_to_pmd_range mm/memory.c:2629 [inline] apply_to_pud_range mm/memory.c:2665 [inline] apply_to_p4d_range mm/memory.c:2701 [inline] __apply_to_page_range+0x68c/0x1030 mm/memory.c:2735 alloc_vmap_area+0x500/0x1e00 mm/vmalloc.c:1638 __get_vm_area_node+0x145/0x3f0 mm/vmalloc.c:2535 __vmalloc_node_range+0x24c/0x1380 mm/vmalloc.c:3199 __vmalloc_node mm/vmalloc.c:3304 [inline] vzalloc+0x6b/0x80 mm/vmalloc.c:3377 do_ip6t_get_ctl+0x613/0xa10 net/ipv6/netfilter/ip6_tables.c:815 nf_getsockopt+0x76/0xd0 net/netfilter/nf_sockopt.c:116 ipv6_getsockopt+0x1ef/0x2a0 net/ipv6/ipv6_sockglue.c:1499 tcp_getsockopt+0x99/0x100 net/ipv4/tcp.c:4410 __sys_getsockopt+0x21a/0x6a0 net/socket.c:2315 __do_sys_getsockopt net/socket.c:2330 [inline] __se_sys_getsockopt net/socket.c:2327 [inline] __x64_sys_getsockopt+0xbe/0x160 net/socket.c:2327 page last free stack trace: reset_page_owner include/linux/page_owner.h:24 [inline] free_pages_prepare mm/page_alloc.c:1302 [inline] free_unref_page_prepare+0x4d8/0xb80 mm/page_alloc.c:2555 free_unref_page+0x33/0x370 mm/page_alloc.c:2650 kasan_depopulate_vmalloc_pte+0x60/0x80 mm/kasan/shadow.c:427 apply_to_pte_range mm/memory.c:2585 [inline] apply_to_pmd_range mm/memory.c:2629 [inline] apply_to_pud_range mm/memory.c:2665 [inline] apply_to_p4d_range mm/memory.c:2701 [inline] __apply_to_page_range+0x68c/0x1030 mm/memory.c:2735 kasan_release_vmalloc+0xab/0xc0 mm/kasan/shadow.c:544 __purge_vmap_area_lazy+0x886/0x1e60 mm/vmalloc.c:1767 drain_vmap_area_work+0x54/0xd0 mm/vmalloc.c:1800 process_one_work+0x99a/0x15e0 kernel/workqueue.c:2405 worker_thread+0x67d/0x10c0 kernel/workqueue.c:2552 kthread+0x33e/0x440 kernel/kthread.c:379 ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:308 Memory state around the buggy address: ffff88807ea16200: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ffff88807ea16280: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff >ffff88807ea16300: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ^ ffff88807ea16380: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ffff88807ea16400: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ==================================================================