ffff88807ed08000, ffff88807ed09048, ffff88807ed0d048, ffff888024b325e8, ptp_release ================================================================== BUG: KASAN: slab-use-after-free in __list_del_entry_valid_or_report+0x198/0x1b0 lib/list_debug.c:62 Read of size 8 at addr ffff88807ed0d048 by task syz-executor.2/7352 CPU: 0 PID: 7352 Comm: syz-executor.2 Not tainted 6.6.0-rc6-next-20231018-syzkaller-dirty #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+0xd9/0x1b0 lib/dump_stack.c:106 print_address_description mm/kasan/report.c:364 [inline] print_report+0xc4/0x620 mm/kasan/report.c:475 kasan_report+0xda/0x110 mm/kasan/report.c:588 __list_del_entry_valid_or_report+0x198/0x1b0 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+0x195/0x3c0 drivers/ptp/ptp_chardev.c:151 posix_clock_release+0xa4/0x160 kernel/time/posix-clock.c:157 __fput+0x270/0xbb0 fs/file_table.c:394 __fput_sync+0x47/0x50 fs/file_table.c:475 __do_sys_close fs/open.c:1590 [inline] __se_sys_close fs/open.c:1575 [inline] __x64_sys_close+0x87/0xf0 fs/open.c:1575 do_syscall_x64 arch/x86/entry/common.c:51 [inline] do_syscall_64+0x3f/0x110 arch/x86/entry/common.c:82 entry_SYSCALL_64_after_hwframe+0x63/0x6b RIP: 0033:0x7f8f1b47b9da Code: 48 3d 00 f0 ff ff 77 48 c3 0f 1f 80 00 00 00 00 48 83 ec 18 89 7c 24 0c e8 03 7f 02 00 8b 7c 24 0c 89 c2 b8 03 00 00 00 0f 05 <48> 3d 00 f0 ff ff 77 36 89 d7 89 44 24 0c e8 63 7f 02 00 8b 44 24 RSP: 002b:00007ffcf81e91f0 EFLAGS: 00000293 ORIG_RAX: 0000000000000003 RAX: ffffffffffffffda RBX: 0000000000000004 RCX: 00007f8f1b47b9da RDX: 0000000000000000 RSI: 0000000000000000 RDI: 0000000000000003 RBP: 0000000000000032 R08: 0000001b2e460000 R09: 00007f8f1b59bf8c R10: 00007ffcf81e9340 R11: 0000000000000293 R12: 00007f8f1b0000a8 R13: ffffffffffffffff R14: 00007f8f1b000000 R15: 0000000000028400 Allocated by task 7351: kasan_save_stack+0x33/0x50 mm/kasan/common.c:45 kasan_set_track+0x25/0x30 mm/kasan/common.c:52 ____kasan_kmalloc mm/kasan/common.c:374 [inline] __kasan_kmalloc+0xa2/0xb0 mm/kasan/common.c:383 kmalloc include/linux/slab.h:600 [inline] kzalloc include/linux/slab.h:721 [inline] ptp_open+0xe3/0x510 drivers/ptp/ptp_chardev.c:112 posix_clock_open+0x17e/0x240 kernel/time/posix-clock.c:134 chrdev_open+0x26d/0x6e0 fs/char_dev.c:414 do_dentry_open+0x8d4/0x18d0 fs/open.c:948 do_open fs/namei.c:3621 [inline] path_openat+0x1d3b/0x2ce0 fs/namei.c:3778 do_filp_open+0x1de/0x430 fs/namei.c:3808 do_sys_openat2+0x176/0x1e0 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+0x175/0x210 fs/open.c:1466 do_syscall_x64 arch/x86/entry/common.c:51 [inline] do_syscall_64+0x3f/0x110 arch/x86/entry/common.c:82 entry_SYSCALL_64_after_hwframe+0x63/0x6b Freed by task 7350: kasan_save_stack+0x33/0x50 mm/kasan/common.c:45 kasan_set_track+0x25/0x30 mm/kasan/common.c:52 kasan_save_free_info+0x2b/0x40 mm/kasan/generic.c:522 ____kasan_slab_free mm/kasan/common.c:236 [inline] ____kasan_slab_free+0x15b/0x1b0 mm/kasan/common.c:200 kasan_slab_free include/linux/kasan.h:164 [inline] slab_free_hook mm/slub.c:1800 [inline] slab_free_freelist_hook+0x114/0x1e0 mm/slub.c:1826 slab_free mm/slub.c:3809 [inline] __kmem_cache_free+0xc0/0x180 mm/slub.c:3822 ptp_release+0x2ed/0x3c0 drivers/ptp/ptp_chardev.c:156 posix_clock_release+0xa4/0x160 kernel/time/posix-clock.c:157 __fput+0x270/0xbb0 fs/file_table.c:394 __fput_sync+0x47/0x50 fs/file_table.c:475 __do_sys_close fs/open.c:1590 [inline] __se_sys_close fs/open.c:1575 [inline] __x64_sys_close+0x87/0xf0 fs/open.c:1575 do_syscall_x64 arch/x86/entry/common.c:51 [inline] do_syscall_64+0x3f/0x110 arch/x86/entry/common.c:82 entry_SYSCALL_64_after_hwframe+0x63/0x6b The buggy address belongs to the object at ffff88807ed0c000 which belongs to the cache kmalloc-8k of size 8192 The buggy address is located 4168 bytes inside of freed 8192-byte region [ffff88807ed0c000, ffff88807ed0e000) The buggy address belongs to the physical page: page:ffffea0001fb4200 refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x7ed08 head:ffffea0001fb4200 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 ffffea0001ed8c00 dead000000000002 raw: 0000000000000000 0000000080020002 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 0x1d20c0(__GFP_IO|__GFP_FS|__GFP_NOWARN|__GFP_NORETRY|__GFP_COMP|__GFP_NOMEMALLOC|__GFP_HARDWALL), pid 5807, tgid 5800 (syz-executor.2), ts 128144428861, free_ts 128110488621 set_page_owner include/linux/page_owner.h:31 [inline] post_alloc_hook+0x2cf/0x340 mm/page_alloc.c:1537 prep_new_page mm/page_alloc.c:1544 [inline] get_page_from_freelist+0xa16/0x3680 mm/page_alloc.c:3348 __alloc_pages+0x1d0/0x4c0 mm/page_alloc.c:4604 alloc_pages_mpol+0x258/0x5f0 mm/mempolicy.c:2133 alloc_slab_page mm/slub.c:1870 [inline] allocate_slab+0x251/0x380 mm/slub.c:2017 new_slab mm/slub.c:2070 [inline] ___slab_alloc+0x8c7/0x1580 mm/slub.c:3223 __slab_alloc.constprop.0+0x56/0xa0 mm/slub.c:3322 __slab_alloc_node mm/slub.c:3375 [inline] slab_alloc_node mm/slub.c:3468 [inline] __kmem_cache_alloc_node+0x131/0x310 mm/slub.c:3517 kmalloc_trace+0x27/0xf0 mm/slab_common.c:1098 kmalloc include/linux/slab.h:600 [inline] kzalloc include/linux/slab.h:721 [inline] ptp_open+0xe3/0x510 drivers/ptp/ptp_chardev.c:112 posix_clock_open+0x17e/0x240 kernel/time/posix-clock.c:134 chrdev_open+0x26d/0x6e0 fs/char_dev.c:414 do_dentry_open+0x8d4/0x18d0 fs/open.c:948 do_open fs/namei.c:3621 [inline] path_openat+0x1d3b/0x2ce0 fs/namei.c:3778 do_filp_open+0x1de/0x430 fs/namei.c:3808 do_sys_openat2+0x176/0x1e0 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+0x476/0xa40 mm/page_alloc.c:2383 free_unref_page+0x33/0x3b0 mm/page_alloc.c:2523 __unfreeze_partials+0x21d/0x240 mm/slub.c:2655 qlink_free mm/kasan/quarantine.c:168 [inline] qlist_free_all+0x6a/0x170 mm/kasan/quarantine.c:187 kasan_quarantine_reduce+0x18e/0x1d0 mm/kasan/quarantine.c:294 __kasan_slab_alloc+0x65/0x90 mm/kasan/common.c:305 kasan_slab_alloc include/linux/kasan.h:188 [inline] slab_post_alloc_hook mm/slab.h:763 [inline] slab_alloc_node mm/slub.c:3478 [inline] slab_alloc mm/slub.c:3486 [inline] __kmem_cache_alloc_lru mm/slub.c:3493 [inline] kmem_cache_alloc+0x163/0x390 mm/slub.c:3502 getname_flags.part.0+0x50/0x4e0 fs/namei.c:140 getname_flags+0x9c/0xf0 include/linux/audit.h:321 getname fs/namei.c:219 [inline] __do_sys_symlinkat fs/namei.c:4505 [inline] __se_sys_symlinkat fs/namei.c:4502 [inline] __x64_sys_symlinkat+0x7b/0xc0 fs/namei.c:4502 do_syscall_x64 arch/x86/entry/common.c:51 [inline] do_syscall_64+0x3f/0x110 arch/x86/entry/common.c:82 entry_SYSCALL_64_after_hwframe+0x63/0x6b Memory state around the buggy address: ffff88807ed0cf00: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff88807ed0cf80: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb >ffff88807ed0d000: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff88807ed0d080: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff88807ed0d100: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ==================================================================