================================================================== BUG: KASAN: slab-use-after-free in consumer_filter kernel/events/uprobes.c:869 [inline] BUG: KASAN: slab-use-after-free in filter_chain kernel/events/uprobes.c:880 [inline] BUG: KASAN: slab-use-after-free in uprobe_mmap+0xb9a/0x11a0 kernel/events/uprobes.c:1387 Read of size 8 at addr ffff88802d741230 by task syz.1.4313/20700 CPU: 0 UID: 0 PID: 20700 Comm: syz.1.4313 Not tainted 6.11.0-rc1-syzkaller-00062-ge4fc196f5ba3 #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 06/27/2024 Call Trace: __dump_stack lib/dump_stack.c:93 [inline] dump_stack_lvl+0x241/0x360 lib/dump_stack.c:119 print_address_description mm/kasan/report.c:377 [inline] print_report+0x169/0x550 mm/kasan/report.c:488 kasan_report+0x143/0x180 mm/kasan/report.c:601 consumer_filter kernel/events/uprobes.c:869 [inline] filter_chain kernel/events/uprobes.c:880 [inline] uprobe_mmap+0xb9a/0x11a0 kernel/events/uprobes.c:1387 mmap_region+0x1891/0x2090 mm/mmap.c:3058 do_mmap+0x8f9/0x1010 mm/mmap.c:1468 vm_mmap_pgoff+0x1dd/0x3d0 mm/util.c:588 ksys_mmap_pgoff+0x4f1/0x720 mm/mmap.c:1514 do_syscall_x64 arch/x86/entry/common.c:52 [inline] do_syscall_64+0xf3/0x230 arch/x86/entry/common.c:83 entry_SYSCALL_64_after_hwframe+0x77/0x7f RIP: 0033:0x7f6304f773b9 Code: ff ff c3 66 2e 0f 1f 84 00 00 00 00 00 0f 1f 40 00 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 a8 ff ff ff f7 d8 64 89 01 48 RSP: 002b:00007f6305c8d048 EFLAGS: 00000246 ORIG_RAX: 0000000000000009 RAX: ffffffffffffffda RBX: 00007f6305105f80 RCX: 00007f6304f773b9 RDX: 0000000002000005 RSI: 0000000000400000 RDI: 0000000020000000 RBP: 00007f6304fe48e6 R08: 0000000000000004 R09: 0000000000000000 R10: 0000000000010012 R11: 0000000000000246 R12: 0000000000000000 R13: 000000000000000b R14: 00007f6305105f80 R15: 00007ffe73fc32f8 Allocated by task 19391: kasan_save_stack mm/kasan/common.c:47 [inline] kasan_save_track+0x3f/0x80 mm/kasan/common.c:68 poison_kmalloc_redzone mm/kasan/common.c:370 [inline] __kasan_kmalloc+0x98/0xb0 mm/kasan/common.c:387 kasan_kmalloc include/linux/kasan.h:211 [inline] __kmalloc_cache_node_noprof+0x1d3/0x300 mm/slub.c:4201 kmalloc_node_noprof include/linux/slab.h:704 [inline] __get_vm_area_node+0x113/0x270 mm/vmalloc.c:3109 __vmalloc_node_range_noprof+0x3bc/0x1460 mm/vmalloc.c:3801 __vmalloc_node_noprof mm/vmalloc.c:3906 [inline] vzalloc_noprof+0x79/0x90 mm/vmalloc.c:3979 alloc_counters+0xd7/0x740 net/ipv4/netfilter/ip_tables.c:799 copy_entries_to_user net/ipv6/netfilter/ip6_tables.c:837 [inline] get_entries net/ipv6/netfilter/ip6_tables.c:1039 [inline] do_ip6t_get_ctl+0xecc/0x1820 net/ipv6/netfilter/ip6_tables.c:1677 nf_getsockopt+0x29b/0x2c0 net/netfilter/nf_sockopt.c:116 ipv6_getsockopt+0x263/0x380 net/ipv6/ipv6_sockglue.c:1493 tcp_getsockopt+0x165/0x1c0 net/ipv4/tcp.c:4409 do_sock_getsockopt+0x375/0x850 net/socket.c:2386 __sys_getsockopt+0x271/0x330 net/socket.c:2415 __do_sys_getsockopt net/socket.c:2425 [inline] __se_sys_getsockopt net/socket.c:2422 [inline] __x64_sys_getsockopt+0xb5/0xd0 net/socket.c:2422 do_syscall_x64 arch/x86/entry/common.c:52 [inline] do_syscall_64+0xf3/0x230 arch/x86/entry/common.c:83 entry_SYSCALL_64_after_hwframe+0x77/0x7f Freed by task 19391: kasan_save_stack mm/kasan/common.c:47 [inline] kasan_save_track+0x3f/0x80 mm/kasan/common.c:68 kasan_save_free_info+0x40/0x50 mm/kasan/generic.c:579 poison_slab_object+0xe0/0x150 mm/kasan/common.c:240 __kasan_slab_free+0x37/0x60 mm/kasan/common.c:256 kasan_slab_free include/linux/kasan.h:184 [inline] slab_free_hook mm/slub.c:2252 [inline] slab_free mm/slub.c:4473 [inline] kfree+0x149/0x360 mm/slub.c:4594 copy_entries_to_user net/ipv6/netfilter/ip6_tables.c:882 [inline] get_entries net/ipv6/netfilter/ip6_tables.c:1039 [inline] do_ip6t_get_ctl+0x11eb/0x1820 net/ipv6/netfilter/ip6_tables.c:1677 nf_getsockopt+0x29b/0x2c0 net/netfilter/nf_sockopt.c:116 ipv6_getsockopt+0x263/0x380 net/ipv6/ipv6_sockglue.c:1493 tcp_getsockopt+0x165/0x1c0 net/ipv4/tcp.c:4409 do_sock_getsockopt+0x375/0x850 net/socket.c:2386 __sys_getsockopt+0x271/0x330 net/socket.c:2415 __do_sys_getsockopt net/socket.c:2425 [inline] __se_sys_getsockopt net/socket.c:2422 [inline] __x64_sys_getsockopt+0xb5/0xd0 net/socket.c:2422 do_syscall_x64 arch/x86/entry/common.c:52 [inline] do_syscall_64+0xf3/0x230 arch/x86/entry/common.c:83 entry_SYSCALL_64_after_hwframe+0x77/0x7f The buggy address belongs to the object at ffff88802d741200 which belongs to the cache kmalloc-64 of size 64 The buggy address is located 48 bytes inside of freed 64-byte region [ffff88802d741200, ffff88802d741240) The buggy address belongs to the physical page: page: refcount:1 mapcount:0 mapping:0000000000000000 index:0xffff88802d741a00 pfn:0x2d741 flags: 0xfff00000000200(workingset|node=0|zone=1|lastcpupid=0x7ff) page_type: 0xfdffffff(slab) raw: 00fff00000000200 ffff8880158418c0 ffffea0001eca1d0 ffffea0000a67750 raw: ffff88802d741a00 0000000000200018 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 0x152cc0(GFP_USER|__GFP_NOWARN|__GFP_NORETRY|__GFP_COMP), pid 5348, tgid 5348 (syz.5.6), ts 88502271495, free_ts 88500980425 set_page_owner include/linux/page_owner.h:32 [inline] post_alloc_hook+0x1f3/0x230 mm/page_alloc.c:1493 prep_new_page mm/page_alloc.c:1501 [inline] get_page_from_freelist+0x2e4c/0x2f10 mm/page_alloc.c:3442 __alloc_pages_noprof+0x256/0x6c0 mm/page_alloc.c:4700 __alloc_pages_node_noprof include/linux/gfp.h:269 [inline] alloc_pages_node_noprof include/linux/gfp.h:296 [inline] alloc_slab_page+0x5f/0x120 mm/slub.c:2321 allocate_slab+0x5a/0x2f0 mm/slub.c:2484 new_slab mm/slub.c:2537 [inline] ___slab_alloc+0xcd1/0x14b0 mm/slub.c:3723 __slab_alloc+0x58/0xa0 mm/slub.c:3813 __slab_alloc_node mm/slub.c:3866 [inline] slab_alloc_node mm/slub.c:4025 [inline] __do_kmalloc_node mm/slub.c:4157 [inline] __kmalloc_noprof+0x25a/0x400 mm/slub.c:4170 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+0x43/0x130 security/security.c:3038 copy_process+0x169e/0x3dc0 kernel/fork.c:2356 kernel_clone+0x226/0x8f0 kernel/fork.c:2781 __do_sys_clone3 kernel/fork.c:3085 [inline] __se_sys_clone3+0x2cb/0x350 kernel/fork.c:3064 do_syscall_x64 arch/x86/entry/common.c:52 [inline] do_syscall_64+0xf3/0x230 arch/x86/entry/common.c:83 entry_SYSCALL_64_after_hwframe+0x77/0x7f page last free pid 5223 tgid 5223 stack trace: reset_page_owner include/linux/page_owner.h:25 [inline] free_pages_prepare mm/page_alloc.c:1094 [inline] free_unref_page+0xd22/0xea0 mm/page_alloc.c:2612 vfree+0x186/0x2e0 mm/vmalloc.c:3364 __do_replace+0x874/0xa50 net/ipv6/netfilter/ip6_tables.c:1107 do_replace net/ipv6/netfilter/ip6_tables.c:1158 [inline] do_ip6t_set_ctl+0xf11/0x1270 net/ipv6/netfilter/ip6_tables.c:1644 nf_setsockopt+0x297/0x2c0 net/netfilter/nf_sockopt.c:101 do_sock_setsockopt+0x3b1/0x720 net/socket.c:2324 __sys_setsockopt+0x1ae/0x250 net/socket.c:2347 __do_sys_setsockopt net/socket.c:2356 [inline] __se_sys_setsockopt net/socket.c:2353 [inline] __x64_sys_setsockopt+0xb5/0xd0 net/socket.c:2353 do_syscall_x64 arch/x86/entry/common.c:52 [inline] do_syscall_64+0xf3/0x230 arch/x86/entry/common.c:83 entry_SYSCALL_64_after_hwframe+0x77/0x7f Memory state around the buggy address: ffff88802d741100: 00 00 00 00 00 00 00 fc fc fc fc fc fc fc fc fc ffff88802d741180: 00 00 00 00 00 fc fc fc fc fc fc fc fc fc fc fc >ffff88802d741200: fa fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc ^ ffff88802d741280: fa fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc ffff88802d741300: fa fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc ==================================================================