================================================================== BUG: KFENCE: use-after-free read in lockdep_register_key+0x22c/0x3f0 Use-after-free read at 0xffff88823bc50298 (in kfence-#39): lockdep_register_key+0x22c/0x3f0 htab_map_alloc+0x9b/0xe60 kernel/bpf/hashtab.c:506 map_create+0x90c/0x1200 kernel/bpf/syscall.c:1333 __sys_bpf+0x6d1/0x810 kernel/bpf/syscall.c:5659 __do_sys_bpf kernel/bpf/syscall.c:5784 [inline] __se_sys_bpf kernel/bpf/syscall.c:5782 [inline] __x64_sys_bpf+0x7c/0x90 kernel/bpf/syscall.c:5782 do_syscall_x64 arch/x86/entry/common.c:52 [inline] do_syscall_64+0xf5/0x240 arch/x86/entry/common.c:83 entry_SYSCALL_64_after_hwframe+0x77/0x7f kfence-#39: 0xffff88823bc50000-0xffff88823bc50437, size=1080, cache=kmalloc-2k allocated by task 5358 on cpu 1 at 67.589002s: kmalloc_node include/linux/slab.h:648 [inline] kzalloc_node include/linux/slab.h:760 [inline] qdisc_alloc+0x9c/0xa90 net/sched/sch_generic.c:941 qdisc_create+0x182/0x1190 net/sched/sch_api.c:1299 tc_modify_qdisc+0xa26/0x1e40 net/sched/sch_api.c:1776 rtnetlink_rcv_msg+0x89b/0x10d0 net/core/rtnetlink.c:6594 netlink_rcv_skb+0x1e3/0x430 net/netlink/af_netlink.c:2564 netlink_unicast_kernel net/netlink/af_netlink.c:1335 [inline] netlink_unicast+0x7ea/0x980 net/netlink/af_netlink.c:1361 netlink_sendmsg+0x8e1/0xcb0 net/netlink/af_netlink.c:1905 sock_sendmsg_nosec net/socket.c:730 [inline] __sock_sendmsg+0x221/0x270 net/socket.c:745 ____sys_sendmsg+0x525/0x7d0 net/socket.c:2584 ___sys_sendmsg net/socket.c:2638 [inline] __sys_sendmsg+0x2b0/0x3a0 net/socket.c:2667 do_syscall_x64 arch/x86/entry/common.c:52 [inline] do_syscall_64+0xf5/0x240 arch/x86/entry/common.c:83 entry_SYSCALL_64_after_hwframe+0x77/0x7f freed by task 5358 on cpu 1 at 67.589059s: qdisc_create+0xf9e/0x1190 net/sched/sch_api.c:1393 tc_modify_qdisc+0xa26/0x1e40 net/sched/sch_api.c:1776 rtnetlink_rcv_msg+0x89b/0x10d0 net/core/rtnetlink.c:6594 netlink_rcv_skb+0x1e3/0x430 net/netlink/af_netlink.c:2564 netlink_unicast_kernel net/netlink/af_netlink.c:1335 [inline] netlink_unicast+0x7ea/0x980 net/netlink/af_netlink.c:1361 netlink_sendmsg+0x8e1/0xcb0 net/netlink/af_netlink.c:1905 sock_sendmsg_nosec net/socket.c:730 [inline] __sock_sendmsg+0x221/0x270 net/socket.c:745 ____sys_sendmsg+0x525/0x7d0 net/socket.c:2584 ___sys_sendmsg net/socket.c:2638 [inline] __sys_sendmsg+0x2b0/0x3a0 net/socket.c:2667 do_syscall_x64 arch/x86/entry/common.c:52 [inline] do_syscall_64+0xf5/0x240 arch/x86/entry/common.c:83 entry_SYSCALL_64_after_hwframe+0x77/0x7f CPU: 0 PID: 5974 Comm: syz-executor.3 Not tainted 6.9.0-rc5-syzkaller-01461-g496bc5861c73 #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 03/27/2024 RIP: 0010:lockdep_register_key+0x22c/0x3f0 kernel/locking/lockdep.c:1225 Code: 48 89 44 24 08 42 80 3c 30 00 74 08 48 89 df e8 0a 8d 88 00 4c 8b 23 4d 85 e4 48 89 5c 24 10 0f 84 a9 00 00 00 4c 89 e3 eb 08 <48> 8b 1b 48 85 db 74 21 4c 39 eb 0f 84 41 01 00 00 48 89 d8 48 c1 RSP: 0018:ffffc90014197b60 EFLAGS: 00010046 RAX: 1ffff1104778a053 RBX: ffff88823bc50298 RCX: 0000000000000001 RDX: 0000000000000001 RSI: 0000000000000004 RDI: ffffc90014197ac0 RBP: ffffc90014197c30 R08: 0000000000000003 R09: fffff52002832f58 R10: dffffc0000000000 R11: fffff52002832f58 R12: ffff88823bc50298 R13: ffff88807d071440 R14: dffffc0000000000 R15: 1ffff92002832f70 FS: 00007f7c598116c0(0000) GS:ffff8880b9400000(0000) knlGS:0000000000000000 CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 CR2: ffff88823bc50298 CR3: 000000007ccd6000 CR4: 00000000003506f0 DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000 DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400 Call Trace: htab_map_alloc+0x9b/0xe60 kernel/bpf/hashtab.c:506 map_create+0x90c/0x1200 kernel/bpf/syscall.c:1333 __sys_bpf+0x6d1/0x810 kernel/bpf/syscall.c:5659 __do_sys_bpf kernel/bpf/syscall.c:5784 [inline] __se_sys_bpf kernel/bpf/syscall.c:5782 [inline] __x64_sys_bpf+0x7c/0x90 kernel/bpf/syscall.c:5782 do_syscall_x64 arch/x86/entry/common.c:52 [inline] do_syscall_64+0xf5/0x240 arch/x86/entry/common.c:83 entry_SYSCALL_64_after_hwframe+0x77/0x7f RIP: 0033:0x7f7c58a7dea9 Code: 28 00 00 00 75 05 48 83 c4 28 c3 e8 e1 20 00 00 90 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 b0 ff ff ff f7 d8 64 89 01 48 RSP: 002b:00007f7c598110c8 EFLAGS: 00000246 ORIG_RAX: 0000000000000141 RAX: ffffffffffffffda RBX: 00007f7c58bac050 RCX: 00007f7c58a7dea9 RDX: 0000000000000048 RSI: 0000000020000140 RDI: 0100000000000000 RBP: 00007f7c58aca4a4 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000 R13: 000000000000006e R14: 00007f7c58bac050 R15: 00007ffe560e9a88 ================================================================== ---------------- Code disassembly (best guess): 0: 48 89 44 24 08 mov %rax,0x8(%rsp) 5: 42 80 3c 30 00 cmpb $0x0,(%rax,%r14,1) a: 74 08 je 0x14 c: 48 89 df mov %rbx,%rdi f: e8 0a 8d 88 00 call 0x888d1e 14: 4c 8b 23 mov (%rbx),%r12 17: 4d 85 e4 test %r12,%r12 1a: 48 89 5c 24 10 mov %rbx,0x10(%rsp) 1f: 0f 84 a9 00 00 00 je 0xce 25: 4c 89 e3 mov %r12,%rbx 28: eb 08 jmp 0x32 * 2a: 48 8b 1b mov (%rbx),%rbx <-- trapping instruction 2d: 48 85 db test %rbx,%rbx 30: 74 21 je 0x53 32: 4c 39 eb cmp %r13,%rbx 35: 0f 84 41 01 00 00 je 0x17c 3b: 48 89 d8 mov %rbx,%rax 3e: 48 rex.W 3f: c1 .byte 0xc1