================================================================== BUG: KASAN: slab-use-after-free in __list_del_entry_valid_or_report+0x84/0x130 lib/list_debug.c:62 Read of size 8 at addr ffff888027cd9048 by task syz-executor292/5112 CPU: 0 PID: 5112 Comm: syz-executor292 Not tainted 6.6.0-syzkaller-12715-g6bdfe2d88b9f #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 10/09/2023 Call Trace: __dump_stack lib/dump_stack.c:88 [inline] dump_stack_lvl+0x1e7/0x2d0 lib/dump_stack.c:106 print_address_description mm/kasan/report.c:364 [inline] print_report+0x163/0x540 mm/kasan/report.c:475 kasan_report+0x142/0x170 mm/kasan/report.c:588 __list_del_entry_valid_or_report+0x84/0x130 lib/list_debug.c:62 __list_del_entry_valid include/linux/list.h:124 [inline] __list_del_entry include/linux/list.h:215 [inline] list_del include/linux/list.h:229 [inline] ptp_release+0xa8/0x1e0 drivers/ptp/ptp_chardev.c:147 posix_clock_release+0x8c/0x100 kernel/time/posix-clock.c:157 __fput+0x3cc/0xa10 fs/file_table.c:394 task_work_run+0x24a/0x300 kernel/task_work.c:180 exit_task_work include/linux/task_work.h:38 [inline] do_exit+0xa34/0x2750 kernel/exit.c:871 do_group_exit+0x206/0x2c0 kernel/exit.c:1021 __do_sys_exit_group kernel/exit.c:1032 [inline] __se_sys_exit_group kernel/exit.c:1030 [inline] __x64_sys_exit_group+0x3f/0x40 kernel/exit.c:1030 do_syscall_x64 arch/x86/entry/common.c:51 [inline] do_syscall_64+0x44/0x110 arch/x86/entry/common.c:82 entry_SYSCALL_64_after_hwframe+0x63/0x6b RIP: 0033:0x7ffa52198bf9 Code: Unable to access opcode bytes at 0x7ffa52198bcf. RSP: 002b:00007ffe59f3e0e8 EFLAGS: 00000246 ORIG_RAX: 00000000000000e7 RAX: ffffffffffffffda RBX: 0000000000000000 RCX: 00007ffa52198bf9 RDX: 000000000000003c RSI: 00000000000000e7 RDI: 0000000000000000 RBP: 00007ffa52213290 R08: ffffffffffffffb8 R09: 00000000000000a0 R10: 0000000000000000 R11: 0000000000000246 R12: 00007ffa52213290 R13: 0000000000000000 R14: 00007ffa52213d00 R15: 00007ffa52169db0 Allocated by task 5113: kasan_save_stack mm/kasan/common.c:45 [inline] kasan_set_track+0x4f/0x70 mm/kasan/common.c:52 ____kasan_kmalloc mm/kasan/common.c:374 [inline] __kasan_kmalloc+0x98/0xb0 mm/kasan/common.c:383 kmalloc include/linux/slab.h:600 [inline] kzalloc include/linux/slab.h:721 [inline] ptp_open+0xd9/0x430 drivers/ptp/ptp_chardev.c:112 posix_clock_open+0x155/0x1f0 kernel/time/posix-clock.c:134 chrdev_open+0x5ab/0x630 fs/char_dev.c:414 do_dentry_open+0x8fd/0x1590 fs/open.c:948 do_open fs/namei.c:3622 [inline] path_openat+0x2845/0x3280 fs/namei.c:3779 do_filp_open+0x234/0x490 fs/namei.c:3809 do_sys_openat2+0x13e/0x1d0 fs/open.c:1440 do_sys_open fs/open.c:1455 [inline] __do_sys_openat fs/open.c:1471 [inline] __se_sys_openat fs/open.c:1466 [inline] __x64_sys_openat+0x247/0x290 fs/open.c:1466 do_syscall_x64 arch/x86/entry/common.c:51 [inline] do_syscall_64+0x44/0x110 arch/x86/entry/common.c:82 entry_SYSCALL_64_after_hwframe+0x63/0x6b Freed by task 5113: kasan_save_stack mm/kasan/common.c:45 [inline] kasan_set_track+0x4f/0x70 mm/kasan/common.c:52 kasan_save_free_info+0x28/0x40 mm/kasan/generic.c:522 ____kasan_slab_free+0xd6/0x120 mm/kasan/common.c:236 kasan_slab_free include/linux/kasan.h:164 [inline] slab_free_hook mm/slub.c:1800 [inline] slab_free_freelist_hook mm/slub.c:1826 [inline] slab_free mm/slub.c:3809 [inline] __kmem_cache_free+0x263/0x3a0 mm/slub.c:3822 ptp_release+0x1ce/0x1e0 drivers/ptp/ptp_chardev.c:150 posix_clock_release+0x8c/0x100 kernel/time/posix-clock.c:157 __fput+0x3cc/0xa10 fs/file_table.c:394 task_work_run+0x24a/0x300 kernel/task_work.c:180 exit_task_work include/linux/task_work.h:38 [inline] do_exit+0xa34/0x2750 kernel/exit.c:871 do_group_exit+0x206/0x2c0 kernel/exit.c:1021 __do_sys_exit_group kernel/exit.c:1032 [inline] __se_sys_exit_group kernel/exit.c:1030 [inline] __x64_sys_exit_group+0x3f/0x40 kernel/exit.c:1030 do_syscall_x64 arch/x86/entry/common.c:51 [inline] do_syscall_64+0x44/0x110 arch/x86/entry/common.c:82 entry_SYSCALL_64_after_hwframe+0x63/0x6b The buggy address belongs to the object at ffff888027cd8000 which belongs to the cache kmalloc-8k of size 8192 The buggy address is located 4168 bytes inside of freed 8192-byte region [ffff888027cd8000, ffff888027cda000) The buggy address belongs to the physical page: page:ffffea00009f3600 refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x27cd8 head:ffffea00009f3600 order:3 entire_mapcount:0 nr_pages_mapped:0 pincount:0 flags: 0xfff00000000840(slab|head|node=0|zone=1|lastcpupid=0x7ff) page_type: 0xffffffff() raw: 00fff00000000840 ffff888012c42280 dead000000000122 0000000000000000 raw: 0000000000000000 0000000000020002 00000001ffffffff 0000000000000000 page dumped because: kasan: bad access detected page_owner tracks the page as allocated page last allocated via order 3, migratetype Unmovable, gfp_mask 0xd20c0(__GFP_IO|__GFP_FS|__GFP_NOWARN|__GFP_NORETRY|__GFP_COMP|__GFP_NOMEMALLOC), pid 5113, tgid 5113 (syz-executor292), ts 55826445705, free_ts 55824594863 set_page_owner include/linux/page_owner.h:31 [inline] post_alloc_hook+0x1e6/0x210 mm/page_alloc.c:1537 prep_new_page mm/page_alloc.c:1544 [inline] get_page_from_freelist+0x339a/0x3530 mm/page_alloc.c:3312 __alloc_pages+0x255/0x670 mm/page_alloc.c:4568 alloc_pages_mpol+0x3de/0x640 mm/mempolicy.c:2133 alloc_slab_page+0x6a/0x160 mm/slub.c:1870 allocate_slab mm/slub.c:2017 [inline] new_slab+0x84/0x2f0 mm/slub.c:2070 ___slab_alloc+0xc85/0x1310 mm/slub.c:3223 __slab_alloc mm/slub.c:3322 [inline] __slab_alloc_node mm/slub.c:3375 [inline] slab_alloc_node mm/slub.c:3468 [inline] __kmem_cache_alloc_node+0x21d/0x300 mm/slub.c:3517 kmalloc_trace+0x2a/0xe0 mm/slab_common.c:1098 kmalloc include/linux/slab.h:600 [inline] kzalloc include/linux/slab.h:721 [inline] ptp_open+0xd9/0x430 drivers/ptp/ptp_chardev.c:112 posix_clock_open+0x155/0x1f0 kernel/time/posix-clock.c:134 chrdev_open+0x5ab/0x630 fs/char_dev.c:414 do_dentry_open+0x8fd/0x1590 fs/open.c:948 do_open fs/namei.c:3622 [inline] path_openat+0x2845/0x3280 fs/namei.c:3779 do_filp_open+0x234/0x490 fs/namei.c:3809 do_sys_openat2+0x13e/0x1d0 fs/open.c:1440 page last free stack trace: reset_page_owner include/linux/page_owner.h:24 [inline] free_pages_prepare mm/page_alloc.c:1137 [inline] free_unref_page_prepare+0x92a/0xa50 mm/page_alloc.c:2347 free_unref_page+0x37/0x3f0 mm/page_alloc.c:2487 page_to_skb+0x3dc/0x9a0 drivers/net/virtio_net.c:592 receive_mergeable drivers/net/virtio_net.c:1651 [inline] receive_buf+0x3b9/0x3800 drivers/net/virtio_net.c:1772 virtnet_receive drivers/net/virtio_net.c:2077 [inline] virtnet_poll+0x75a/0x1670 drivers/net/virtio_net.c:2151 __napi_poll+0xc7/0x470 net/core/dev.c:6531 napi_poll net/core/dev.c:6600 [inline] net_rx_action+0x78b/0x1010 net/core/dev.c:6733 __do_softirq+0x2bf/0x93a kernel/softirq.c:553 Memory state around the buggy address: ffff888027cd8f00: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff888027cd8f80: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb >ffff888027cd9000: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff888027cd9080: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff888027cd9100: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ==================================================================