================================================================== 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 ffff88802233a0b0 by task syz.4.1471/10737 CPU: 0 UID: 0 PID: 10737 Comm: syz.4.1471 Not tainted 6.10.0-syzkaller-12881-g6342649c33d2 #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+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_sys_mmap arch/x86/kernel/sys_x86_64.c:86 [inline] __se_sys_mmap arch/x86/kernel/sys_x86_64.c:79 [inline] __x64_sys_mmap+0x125/0x190 arch/x86/kernel/sys_x86_64.c:79 do_syscall_x64 arch/x86/entry/common.c:52 [inline] do_syscall_64+0xcd/0x250 arch/x86/entry/common.c:83 entry_SYSCALL_64_after_hwframe+0x77/0x7f RIP: 0033:0x7f19b5177299 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:00007f19b5f13048 EFLAGS: 00000246 ORIG_RAX: 0000000000000009 RAX: ffffffffffffffda RBX: 00007f19b5305f80 RCX: 00007f19b5177299 RDX: 0000000000000001 RSI: 0000000000003000 RDI: 0000000020000000 RBP: 00007f19b51e48e6 R08: 0000000000000003 R09: 0000000000000000 R10: 0000000000000012 R11: 0000000000000246 R12: 0000000000000000 R13: 000000000000000b R14: 00007f19b5305f80 R15: 00007ffcc70f5118 Allocated by task 5230: 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:3109 __vmalloc_node_range_noprof+0x276/0x1520 mm/vmalloc.c:3801 __vmalloc_node_noprof mm/vmalloc.c:3906 [inline] vzalloc_noprof+0x6b/0x90 mm/vmalloc.c:3979 alloc_counters net/ipv4/netfilter/arp_tables.c:660 [inline] copy_entries_to_user net/ipv4/netfilter/arp_tables.c:681 [inline] get_entries net/ipv4/netfilter/arp_tables.c:867 [inline] do_arpt_get_ctl+0x67a/0x9a0 net/ipv4/netfilter/arp_tables.c:1461 nf_getsockopt+0x79/0xe0 net/netfilter/nf_sockopt.c:116 ip_getsockopt+0x18e/0x1e0 net/ipv4/ip_sockglue.c:1777 tcp_getsockopt+0x9e/0x100 net/ipv4/tcp.c:4409 do_sock_getsockopt+0x2e5/0x760 net/socket.c:2386 __sys_getsockopt+0x1a1/0x270 net/socket.c:2415 __do_sys_getsockopt net/socket.c:2425 [inline] __se_sys_getsockopt net/socket.c:2422 [inline] __x64_sys_getsockopt+0xbd/0x160 net/socket.c:2422 do_syscall_x64 arch/x86/entry/common.c:52 [inline] do_syscall_64+0xcd/0x250 arch/x86/entry/common.c:83 entry_SYSCALL_64_after_hwframe+0x77/0x7f Freed by task 5230: 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:2252 [inline] slab_free mm/slub.c:4473 [inline] kfree+0x12a/0x3b0 mm/slub.c:4594 vfree+0x25a/0x7a0 mm/vmalloc.c:3369 copy_entries_to_user net/ipv4/netfilter/arp_tables.c:713 [inline] get_entries net/ipv4/netfilter/arp_tables.c:867 [inline] do_arpt_get_ctl+0x846/0x9a0 net/ipv4/netfilter/arp_tables.c:1461 nf_getsockopt+0x79/0xe0 net/netfilter/nf_sockopt.c:116 ip_getsockopt+0x18e/0x1e0 net/ipv4/ip_sockglue.c:1777 tcp_getsockopt+0x9e/0x100 net/ipv4/tcp.c:4409 do_sock_getsockopt+0x2e5/0x760 net/socket.c:2386 __sys_getsockopt+0x1a1/0x270 net/socket.c:2415 __do_sys_getsockopt net/socket.c:2425 [inline] __se_sys_getsockopt net/socket.c:2422 [inline] __x64_sys_getsockopt+0xbd/0x160 net/socket.c:2422 do_syscall_x64 arch/x86/entry/common.c:52 [inline] do_syscall_64+0xcd/0x250 arch/x86/entry/common.c:83 entry_SYSCALL_64_after_hwframe+0x77/0x7f The buggy address belongs to the object at ffff88802233a080 which belongs to the cache kmalloc-64 of size 64 The buggy address is located 48 bytes inside of freed 64-byte region [ffff88802233a080, ffff88802233a0c0) The buggy address belongs to the physical page: page: refcount:1 mapcount:0 mapping:0000000000000000 index:0xffff88802233a680 pfn:0x2233a flags: 0xfff00000000200(workingset|node=0|zone=1|lastcpupid=0x7ff) page_type: 0xfdffffff(slab) raw: 00fff00000000200 ffff8880158418c0 ffffea00008d1e10 ffffea0000a4da90 raw: ffff88802233a680 0000000000200017 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 12, tgid 12 (kworker/u8:1), ts 10816394870, free_ts 10727983364 set_page_owner include/linux/page_owner.h:32 [inline] post_alloc_hook+0x2d1/0x350 mm/page_alloc.c:1493 prep_new_page mm/page_alloc.c:1501 [inline] get_page_from_freelist+0x1351/0x2e50 mm/page_alloc.c:3442 __alloc_pages_noprof+0x22b/0x2460 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+0x4e/0xf0 mm/slub.c:2321 allocate_slab mm/slub.c:2484 [inline] new_slab+0x84/0x260 mm/slub.c:2537 ___slab_alloc+0xdac/0x1870 mm/slub.c:3723 __slab_alloc.constprop.0+0x56/0xb0 mm/slub.c:3813 __slab_alloc_node mm/slub.c:3866 [inline] slab_alloc_node mm/slub.c:4025 [inline] __kmalloc_cache_noprof+0x2b4/0x300 mm/slub.c:4184 kmalloc_noprof include/linux/slab.h:681 [inline] kzalloc_noprof include/linux/slab.h:807 [inline] percpu_ref_init+0xd9/0x400 lib/percpu-refcount.c:76 blk_alloc_queue+0x578/0x6b0 block/blk-core.c:439 blk_mq_alloc_queue+0x1af/0x2f0 block/blk-mq.c:4151 scsi_alloc_sdev+0x897/0xd90 drivers/scsi/scsi_scan.c:337 scsi_probe_and_add_lun+0x789/0xda0 drivers/scsi/scsi_scan.c:1210 __scsi_scan_target+0x1ea/0x580 drivers/scsi/scsi_scan.c:1757 scsi_scan_channel drivers/scsi/scsi_scan.c:1845 [inline] scsi_scan_channel+0x149/0x1e0 drivers/scsi/scsi_scan.c:1821 scsi_scan_host_selected+0x302/0x400 drivers/scsi/scsi_scan.c:1874 page last free pid 944 tgid 944 stack trace: reset_page_owner include/linux/page_owner.h:25 [inline] free_pages_prepare mm/page_alloc.c:1094 [inline] free_unref_page+0x64a/0xe40 mm/page_alloc.c:2612 vfree+0x181/0x7a0 mm/vmalloc.c:3364 delayed_vfree_work+0x56/0x70 mm/vmalloc.c:3285 process_one_work+0x9c5/0x1b40 kernel/workqueue.c:3231 process_scheduled_works kernel/workqueue.c:3312 [inline] worker_thread+0x6c8/0xf20 kernel/workqueue.c:3390 kthread+0x2c1/0x3a0 kernel/kthread.c:389 ret_from_fork+0x45/0x80 arch/x86/kernel/process.c:147 ret_from_fork_asm+0x1a/0x30 arch/x86/entry/entry_64.S:244 Memory state around the buggy address: ffff888022339f80: fa fb fb fb fb fb fb fb fb fb fb fb fc fc fc fc ffff88802233a000: fa fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc >ffff88802233a080: fa fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc ^ ffff88802233a100: fa fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc ffff88802233a180: fa fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc ==================================================================