================================================================== 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 ffff888079f4a430 by task syz.5.390/6683 CPU: 1 UID: 0 PID: 6683 Comm: syz.5.390 Not tainted 6.10.0-syzkaller-12381-gc33ffdb70cc6 #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:0x7f1608d75f19 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:00007f1609b88048 EFLAGS: 00000246 ORIG_RAX: 0000000000000009 RAX: ffffffffffffffda RBX: 00007f1608f06038 RCX: 00007f1608d75f19 RDX: 0000000000000001 RSI: 0000000000003000 RDI: 0000000020000000 RBP: 00007f1608de4e68 R08: 0000000000000003 R09: 0000000000000000 R10: 0000000000010012 R11: 0000000000000246 R12: 0000000000000000 R13: 000000000000006e R14: 00007f1608f06038 R15: 00007ffe26580a78 Allocated by task 6619: 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_noprof+0x19c/0x2c0 mm/slub.c:4189 kmalloc_noprof include/linux/slab.h:681 [inline] ip_setup_cork+0x53f/0x8b0 net/ipv4/ip_output.c:1305 ip_append_data+0xff/0x190 net/ipv4/ip_output.c:1358 icmp_push_reply+0x97/0x410 net/ipv4/icmp.c:373 __icmp_send+0xf89/0x14e0 net/ipv4/icmp.c:777 icmp_send include/net/icmp.h:43 [inline] ip_protocol_deliver_rcu+0x418/0x440 net/ipv4/ip_input.c:216 ip_local_deliver_finish+0x341/0x5f0 net/ipv4/ip_input.c:233 NF_HOOK+0x3a6/0x450 include/linux/netfilter.h:314 NF_HOOK+0x3a6/0x450 include/linux/netfilter.h:314 __netif_receive_skb_one_core net/core/dev.c:5660 [inline] __netif_receive_skb+0x2bf/0x650 net/core/dev.c:5774 process_backlog+0x662/0x15b0 net/core/dev.c:6107 __napi_poll+0xcd/0x490 net/core/dev.c:6771 napi_poll net/core/dev.c:6840 [inline] net_rx_action+0x89b/0x1240 net/core/dev.c:6962 handle_softirqs+0x2c6/0x970 kernel/softirq.c:554 do_softirq+0x11b/0x1e0 kernel/softirq.c:455 __local_bh_enable_ip+0x1bb/0x200 kernel/softirq.c:382 local_bh_enable include/linux/bottom_half.h:33 [inline] rcu_read_unlock_bh include/linux/rcupdate.h:908 [inline] __dev_queue_xmit+0x1763/0x3e90 net/core/dev.c:4450 dev_queue_xmit include/linux/netdevice.h:3105 [inline] neigh_hh_output include/net/neighbour.h:526 [inline] neigh_output include/net/neighbour.h:540 [inline] ip_finish_output2+0xd41/0x1390 net/ipv4/ip_output.c:235 ip_local_out net/ipv4/ip_output.c:129 [inline] ip_send_skb net/ipv4/ip_output.c:1495 [inline] ip_push_pending_frames+0xbf/0x150 net/ipv4/ip_output.c:1515 raw_sendmsg+0x1ac5/0x2490 net/ipv4/raw.c:657 sock_sendmsg_nosec net/socket.c:730 [inline] __sock_sendmsg+0x1a6/0x270 net/socket.c:745 ____sys_sendmsg+0x525/0x7d0 net/socket.c:2597 ___sys_sendmsg net/socket.c:2651 [inline] __sys_sendmmsg+0x3b2/0x740 net/socket.c:2737 __do_sys_sendmmsg net/socket.c:2766 [inline] __se_sys_sendmmsg net/socket.c:2763 [inline] __x64_sys_sendmmsg+0xa0/0xb0 net/socket.c:2763 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 6619: 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 ip_cork_release net/ipv4/ip_output.c:1373 [inline] __ip_make_skb+0x158a/0x1eb0 net/ipv4/ip_output.c:1486 ip_finish_skb include/net/ip.h:243 [inline] ip_push_pending_frames+0x30/0x150 net/ipv4/ip_output.c:1510 __icmp_send+0xf89/0x14e0 net/ipv4/icmp.c:777 icmp_send include/net/icmp.h:43 [inline] ip_protocol_deliver_rcu+0x418/0x440 net/ipv4/ip_input.c:216 ip_local_deliver_finish+0x341/0x5f0 net/ipv4/ip_input.c:233 NF_HOOK+0x3a6/0x450 include/linux/netfilter.h:314 NF_HOOK+0x3a6/0x450 include/linux/netfilter.h:314 __netif_receive_skb_one_core net/core/dev.c:5660 [inline] __netif_receive_skb+0x2bf/0x650 net/core/dev.c:5774 process_backlog+0x662/0x15b0 net/core/dev.c:6107 __napi_poll+0xcd/0x490 net/core/dev.c:6771 napi_poll net/core/dev.c:6840 [inline] net_rx_action+0x89b/0x1240 net/core/dev.c:6962 handle_softirqs+0x2c6/0x970 kernel/softirq.c:554 do_softirq+0x11b/0x1e0 kernel/softirq.c:455 __local_bh_enable_ip+0x1bb/0x200 kernel/softirq.c:382 local_bh_enable include/linux/bottom_half.h:33 [inline] rcu_read_unlock_bh include/linux/rcupdate.h:908 [inline] __dev_queue_xmit+0x1763/0x3e90 net/core/dev.c:4450 dev_queue_xmit include/linux/netdevice.h:3105 [inline] neigh_hh_output include/net/neighbour.h:526 [inline] neigh_output include/net/neighbour.h:540 [inline] ip_finish_output2+0xd41/0x1390 net/ipv4/ip_output.c:235 ip_local_out net/ipv4/ip_output.c:129 [inline] ip_send_skb net/ipv4/ip_output.c:1495 [inline] ip_push_pending_frames+0xbf/0x150 net/ipv4/ip_output.c:1515 raw_sendmsg+0x1ac5/0x2490 net/ipv4/raw.c:657 sock_sendmsg_nosec net/socket.c:730 [inline] __sock_sendmsg+0x1a6/0x270 net/socket.c:745 ____sys_sendmsg+0x525/0x7d0 net/socket.c:2597 ___sys_sendmsg net/socket.c:2651 [inline] __sys_sendmmsg+0x3b2/0x740 net/socket.c:2737 __do_sys_sendmmsg net/socket.c:2766 [inline] __se_sys_sendmmsg net/socket.c:2763 [inline] __x64_sys_sendmmsg+0xa0/0xb0 net/socket.c:2763 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 ffff888079f4a400 which belongs to the cache kmalloc-64 of size 64 The buggy address is located 48 bytes inside of freed 64-byte region [ffff888079f4a400, ffff888079f4a440) The buggy address belongs to the physical page: page: refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x79f4a anon flags: 0xfff00000000000(node=0|zone=1|lastcpupid=0x7ff) page_type: 0xfdffffff(slab) raw: 00fff00000000000 ffff8880154418c0 ffffea0000b3a480 dead000000000005 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 0x152c40(GFP_NOFS|__GFP_NOWARN|__GFP_NORETRY|__GFP_COMP|__GFP_HARDWALL), pid 5237, tgid 5237 (syz-executor), ts 92406839922, free_ts 92314506184 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:3438 __alloc_pages_noprof+0x256/0x6c0 mm/page_alloc.c:4696 __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] tomoyo_encode2 security/tomoyo/realpath.c:45 [inline] tomoyo_encode+0x26f/0x540 security/tomoyo/realpath.c:80 tomoyo_realpath_from_path+0x59e/0x5e0 security/tomoyo/realpath.c:283 tomoyo_get_realpath security/tomoyo/file.c:151 [inline] tomoyo_check_open_permission+0x255/0x500 security/tomoyo/file.c:771 security_file_open+0x6c/0x750 security/security.c:2988 do_dentry_open+0x38e/0x1440 fs/open.c:946 vfs_open+0x3e/0x330 fs/open.c:1089 do_open fs/namei.c:3727 [inline] path_openat+0x2b3e/0x3470 fs/namei.c:3886 do_filp_open+0x235/0x490 fs/namei.c:3913 page last free pid 5228 tgid 5228 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:2608 vfree+0x186/0x2e0 mm/vmalloc.c:3364 kcov_put kernel/kcov.c:429 [inline] kcov_close+0x2b/0x50 kernel/kcov.c:525 __fput+0x24c/0x8a0 fs/file_table.c:422 task_work_run+0x251/0x310 kernel/task_work.c:222 exit_task_work include/linux/task_work.h:40 [inline] do_exit+0xa2f/0x27f0 kernel/exit.c:882 do_group_exit+0x207/0x2c0 kernel/exit.c:1031 __do_sys_exit_group kernel/exit.c:1042 [inline] __se_sys_exit_group kernel/exit.c:1040 [inline] __x64_sys_exit_group+0x3f/0x40 kernel/exit.c:1040 x64_sys_call+0x26c3/0x26d0 arch/x86/include/generated/asm/syscalls_64.h:232 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: ffff888079f4a300: fa fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc ffff888079f4a380: fa fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc >ffff888079f4a400: fa fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc ^ ffff888079f4a480: fa fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc ffff888079f4a500: 00 00 00 00 00 00 00 fc fc fc fc fc fc fc fc fc ==================================================================