================================================================== BUG: KASAN: slab-use-after-free in consumer_filter kernel/events/uprobes.c:869 [inline] BUG: KASAN: slab-use-after-free in filter_chain+0xf6/0x110 kernel/events/uprobes.c:880 Read of size 8 at addr ffff888045974b30 by task syz.1.267/6046 CPU: 0 UID: 0 PID: 6046 Comm: syz.1.267 Not tainted 6.11.0-rc7-syzkaller-00020-g8d8d276ba2fb #0 Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.3-debian-1.16.3-2~bpo12+1 04/01/2014 Call Trace: __dump_stack lib/dump_stack.c:93 [inline] dump_stack_lvl+0x116/0x1f0 lib/dump_stack.c:119 print_address_description mm/kasan/report.c:377 [inline] print_report+0xc3/0x620 mm/kasan/report.c:488 kasan_report+0xd9/0x110 mm/kasan/report.c:601 consumer_filter kernel/events/uprobes.c:869 [inline] filter_chain+0xf6/0x110 kernel/events/uprobes.c:880 uprobe_mmap+0x46b/0x1240 kernel/events/uprobes.c:1387 mmap_region+0x1228/0x2760 mm/mmap.c:3058 do_mmap+0xbfb/0xfb0 mm/mmap.c:1468 vm_mmap_pgoff+0x1ba/0x360 mm/util.c:588 ksys_mmap_pgoff+0x332/0x5d0 mm/mmap.c:1514 do_syscall_32_irqs_on arch/x86/entry/common.c:165 [inline] __do_fast_syscall_32+0x73/0x120 arch/x86/entry/common.c:386 do_fast_syscall_32+0x32/0x80 arch/x86/entry/common.c:411 entry_SYSENTER_compat_after_hwframe+0x84/0x8e RIP: 0023:0xf7f86579 Code: b8 01 10 06 03 74 b4 01 10 07 03 74 b0 01 10 08 03 74 d8 01 00 00 00 00 00 00 00 00 00 00 00 00 00 51 52 55 89 e5 0f 34 cd 80 <5d> 5a 59 c3 90 90 90 90 8d b4 26 00 00 00 00 8d b4 26 00 00 00 00 RSP: 002b:00000000f570656c EFLAGS: 00000296 ORIG_RAX: 00000000000000c0 RAX: ffffffffffffffda RBX: 0000000020000000 RCX: 0000000000003000 RDX: 0000000000000001 RSI: 0000000000000012 RDI: 0000000000000004 RBP: 0000000000000000 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000 R13: 0000000000000000 R14: 0000000000000000 R15: 0000000000000000 Allocated by task 5359: kasan_save_stack+0x33/0x60 mm/kasan/common.c:47 kasan_save_track+0x14/0x30 mm/kasan/common.c:68 poison_kmalloc_redzone mm/kasan/common.c:370 [inline] __kasan_kmalloc+0xaa/0xb0 mm/kasan/common.c:387 kmalloc_node_noprof include/linux/slab.h:704 [inline] __get_vm_area_node+0xe1/0x2d0 mm/vmalloc.c:3112 __vmalloc_node_range_noprof+0x270/0x14e0 mm/vmalloc.c:3797 __vmalloc_node_noprof mm/vmalloc.c:3902 [inline] vzalloc_noprof+0x6b/0x90 mm/vmalloc.c:3975 alloc_counters net/ipv6/netfilter/ip6_tables.c:815 [inline] compat_copy_entries_to_user net/ipv6/netfilter/ip6_tables.c:1570 [inline] compat_get_entries+0x3b2/0x850 net/ipv6/netfilter/ip6_tables.c:1613 do_ip6t_get_ctl+0x596/0xaf0 net/ipv6/netfilter/ip6_tables.c:1674 nf_getsockopt+0x79/0xe0 net/netfilter/nf_sockopt.c:116 ipv6_getsockopt+0x1fd/0x2c0 net/ipv6/ipv6_sockglue.c:1493 tcp_getsockopt+0x9e/0x100 net/ipv4/tcp.c:4409 do_sock_getsockopt+0x3fe/0x870 net/socket.c:2386 __sys_getsockopt+0x1a1/0x270 net/socket.c:2415 __do_compat_sys_socketcall+0x42b/0x700 net/compat.c:494 do_syscall_32_irqs_on arch/x86/entry/common.c:165 [inline] __do_fast_syscall_32+0x73/0x120 arch/x86/entry/common.c:386 do_fast_syscall_32+0x32/0x80 arch/x86/entry/common.c:411 entry_SYSENTER_compat_after_hwframe+0x84/0x8e Freed by task 5359: kasan_save_stack+0x33/0x60 mm/kasan/common.c:47 kasan_save_track+0x14/0x30 mm/kasan/common.c:68 kasan_save_free_info+0x3b/0x60 mm/kasan/generic.c:579 poison_slab_object+0xf7/0x160 mm/kasan/common.c:240 __kasan_slab_free+0x32/0x50 mm/kasan/common.c:256 kasan_slab_free include/linux/kasan.h:184 [inline] slab_free_hook mm/slub.c:2256 [inline] slab_free mm/slub.c:4477 [inline] kfree+0x12a/0x3b0 mm/slub.c:4598 vfree+0x25a/0x7a0 mm/vmalloc.c:3372 compat_copy_entries_to_user net/ipv6/netfilter/ip6_tables.c:1583 [inline] compat_get_entries+0x5d5/0x850 net/ipv6/netfilter/ip6_tables.c:1613 do_ip6t_get_ctl+0x596/0xaf0 net/ipv6/netfilter/ip6_tables.c:1674 nf_getsockopt+0x79/0xe0 net/netfilter/nf_sockopt.c:116 ipv6_getsockopt+0x1fd/0x2c0 net/ipv6/ipv6_sockglue.c:1493 tcp_getsockopt+0x9e/0x100 net/ipv4/tcp.c:4409 do_sock_getsockopt+0x3fe/0x870 net/socket.c:2386 __sys_getsockopt+0x1a1/0x270 net/socket.c:2415 __do_compat_sys_socketcall+0x42b/0x700 net/compat.c:494 do_syscall_32_irqs_on arch/x86/entry/common.c:165 [inline] __do_fast_syscall_32+0x73/0x120 arch/x86/entry/common.c:386 do_fast_syscall_32+0x32/0x80 arch/x86/entry/common.c:411 entry_SYSENTER_compat_after_hwframe+0x84/0x8e The buggy address belongs to the object at ffff888045974b00 which belongs to the cache kmalloc-64 of size 64 The buggy address is located 48 bytes inside of freed 64-byte region [ffff888045974b00, ffff888045974b40) The buggy address belongs to the physical page: page: refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x45974 anon flags: 0x4fff00000000000(node=1|zone=1|lastcpupid=0x7ff) page_type: 0xfdffffff(slab) raw: 04fff00000000000 ffff88801ac428c0 0000000000000000 dead000000000001 raw: 0000000000000000 0000000000200020 00000001fdffffff 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 0x52cc0(GFP_KERNEL|__GFP_NOWARN|__GFP_NORETRY|__GFP_COMP), pid 11, tgid 11 (kworker/u32:0), ts 23697608206, free_ts 0 set_page_owner include/linux/page_owner.h:32 [inline] post_alloc_hook+0x2d1/0x350 mm/page_alloc.c:1500 prep_new_page mm/page_alloc.c:1508 [inline] get_page_from_freelist+0x1351/0x2e50 mm/page_alloc.c:3446 __alloc_pages_noprof+0x22b/0x2460 mm/page_alloc.c:4702 __alloc_pages_node_noprof include/linux/gfp.h:269 [inline] alloc_pages_node_noprof include/linux/gfp.h:296 [inline] alloc_slab_page+0x4e/0xf0 mm/slub.c:2325 allocate_slab mm/slub.c:2488 [inline] new_slab+0x84/0x260 mm/slub.c:2541 ___slab_alloc+0xdac/0x1870 mm/slub.c:3727 __slab_alloc.constprop.0+0x56/0xb0 mm/slub.c:3817 __slab_alloc_node mm/slub.c:3870 [inline] slab_alloc_node mm/slub.c:4029 [inline] __do_kmalloc_node mm/slub.c:4161 [inline] __kmalloc_noprof+0x379/0x410 mm/slub.c:4174 kmalloc_noprof include/linux/slab.h:685 [inline] kzalloc_noprof include/linux/slab.h:807 [inline] lsm_task_alloc security/security.c:691 [inline] security_task_alloc+0x1e4/0x280 security/security.c:3038 copy_process+0x2163/0x6f50 kernel/fork.c:2356 kernel_clone+0xfd/0x960 kernel/fork.c:2781 user_mode_thread+0xb4/0xf0 kernel/fork.c:2859 call_usermodehelper_exec_work kernel/umh.c:172 [inline] call_usermodehelper_exec_work+0xcb/0x170 kernel/umh.c:158 process_one_work+0x958/0x1ad0 kernel/workqueue.c:3231 process_scheduled_works kernel/workqueue.c:3312 [inline] worker_thread+0x6c8/0xed0 kernel/workqueue.c:3389 kthread+0x2c1/0x3a0 kernel/kthread.c:389 page_owner free stack trace missing Memory state around the buggy address: ffff888045974a00: 00 00 00 00 00 00 00 00 fc fc fc fc fc fc fc fc ffff888045974a80: 00 00 00 00 00 00 00 00 fc fc fc fc fc fc fc fc >ffff888045974b00: fa fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc ^ ffff888045974b80: fa fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc ffff888045974c00: 00 00 00 00 00 00 00 00 fc fc fc fc fc fc fc fc ================================================================== ---------------- Code disassembly (best guess), 2 bytes skipped: 0: 10 06 adc %al,(%rsi) 2: 03 74 b4 01 add 0x1(%rsp,%rsi,4),%esi 6: 10 07 adc %al,(%rdi) 8: 03 74 b0 01 add 0x1(%rax,%rsi,4),%esi c: 10 08 adc %cl,(%rax) e: 03 74 d8 01 add 0x1(%rax,%rbx,8),%esi 1e: 00 51 52 add %dl,0x52(%rcx) 21: 55 push %rbp 22: 89 e5 mov %esp,%ebp 24: 0f 34 sysenter 26: cd 80 int $0x80 * 28: 5d pop %rbp <-- trapping instruction 29: 5a pop %rdx 2a: 59 pop %rcx 2b: c3 ret 2c: 90 nop 2d: 90 nop 2e: 90 nop 2f: 90 nop 30: 8d b4 26 00 00 00 00 lea 0x0(%rsi,%riz,1),%esi 37: 8d b4 26 00 00 00 00 lea 0x0(%rsi,%riz,1),%esi