================================================================== BUG: KASAN: slab-use-after-free in d_inode include/linux/dcache.h:520 [inline] BUG: KASAN: slab-use-after-free in fsnotify_parent include/linux/fsnotify.h:66 [inline] BUG: KASAN: slab-use-after-free in fsnotify_file include/linux/fsnotify.h:106 [inline] BUG: KASAN: slab-use-after-free in fsnotify_close include/linux/fsnotify.h:387 [inline] BUG: KASAN: slab-use-after-free in __fput+0xb0d/0xb80 fs/file_table.c:408 Read of size 8 at addr ffff8880799bd4f8 by task syz-executor.2/12594 CPU: 0 PID: 12594 Comm: syz-executor.2 Not tainted 6.9.0-rc5-syzkaller-00007-g4d2008430ce8 #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 03/27/2024 Call Trace: __dump_stack lib/dump_stack.c:88 [inline] dump_stack_lvl+0x116/0x1f0 lib/dump_stack.c:114 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 d_inode include/linux/dcache.h:520 [inline] fsnotify_parent include/linux/fsnotify.h:66 [inline] fsnotify_file include/linux/fsnotify.h:106 [inline] fsnotify_close include/linux/fsnotify.h:387 [inline] __fput+0xb0d/0xb80 fs/file_table.c:408 task_work_run+0x14e/0x250 kernel/task_work.c:180 resume_user_mode_work include/linux/resume_user_mode.h:50 [inline] exit_to_user_mode_loop kernel/entry/common.c:114 [inline] exit_to_user_mode_prepare include/linux/entry-common.h:328 [inline] __syscall_exit_to_user_mode_work kernel/entry/common.c:207 [inline] syscall_exit_to_user_mode+0x278/0x2a0 kernel/entry/common.c:218 do_syscall_64+0xdc/0x260 arch/x86/entry/common.c:89 entry_SYSCALL_64_after_hwframe+0x77/0x7f RIP: 0033:0x7f0b2307dea9 Code: 28 00 00 00 75 05 48 83 c4 28 c3 e8 e1 20 00 00 90 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 b0 ff ff ff f7 d8 64 89 01 48 RSP: 002b:00007f0b23ded0c8 EFLAGS: 00000246 ORIG_RAX: 00000000000000e8 RAX: 0000000000000001 RBX: 00007f0b231abf80 RCX: 00007f0b2307dea9 RDX: 0000000000000002 RSI: 00000000200000c0 RDI: 0000000000000005 RBP: 00007f0b230ca4a4 R08: 0000000000000000 R09: 0000000000000000 R10: 00000000000000fa R11: 0000000000000246 R12: 0000000000000000 R13: 000000000000000b R14: 00007f0b231abf80 R15: 00007ffc6b7c0838 Allocated by task 12596: kasan_save_stack+0x33/0x60 mm/kasan/common.c:47 kasan_save_track+0x14/0x30 mm/kasan/common.c:68 unpoison_slab_object mm/kasan/common.c:312 [inline] __kasan_slab_alloc+0x89/0x90 mm/kasan/common.c:338 kasan_slab_alloc include/linux/kasan.h:201 [inline] slab_post_alloc_hook mm/slub.c:3798 [inline] slab_alloc_node mm/slub.c:3845 [inline] kmem_cache_alloc_lru+0x142/0x6f0 mm/slub.c:3864 __d_alloc+0x31/0xaa0 fs/dcache.c:1624 d_alloc_pseudo+0x1c/0xc0 fs/dcache.c:1756 alloc_path_pseudo fs/file_table.c:330 [inline] alloc_file_pseudo+0xdc/0x210 fs/file_table.c:346 dma_buf_getfile drivers/dma-buf/dma-buf.c:547 [inline] dma_buf_export+0x3a9/0xb40 drivers/dma-buf/dma-buf.c:632 udmabuf_create+0xa47/0xe40 drivers/dma-buf/udmabuf.c:272 udmabuf_ioctl_create drivers/dma-buf/udmabuf.c:309 [inline] udmabuf_ioctl+0x199/0x320 drivers/dma-buf/udmabuf.c:340 vfs_ioctl fs/ioctl.c:51 [inline] __do_sys_ioctl fs/ioctl.c:904 [inline] __se_sys_ioctl fs/ioctl.c:890 [inline] __x64_sys_ioctl+0x193/0x220 fs/ioctl.c:890 do_syscall_x64 arch/x86/entry/common.c:52 [inline] do_syscall_64+0xcf/0x260 arch/x86/entry/common.c:83 entry_SYSCALL_64_after_hwframe+0x77/0x7f Freed by task 12594: 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 mm/kasan/common.c:240 [inline] __kasan_slab_free+0x11d/0x1a0 mm/kasan/common.c:256 kasan_slab_free include/linux/kasan.h:184 [inline] slab_free_hook mm/slub.c:2106 [inline] slab_free mm/slub.c:4280 [inline] kmem_cache_free+0x12e/0x380 mm/slub.c:4344 __d_free fs/dcache.c:297 [inline] dentry_free+0xdd/0x160 fs/dcache.c:374 __dentry_kill+0x498/0x600 fs/dcache.c:622 dput.part.0+0x4b1/0x9b0 fs/dcache.c:845 dput+0x1f/0x30 fs/dcache.c:835 __fput+0x3bc/0xb80 fs/file_table.c:430 task_work_run+0x14e/0x250 kernel/task_work.c:180 resume_user_mode_work include/linux/resume_user_mode.h:50 [inline] exit_to_user_mode_loop kernel/entry/common.c:114 [inline] exit_to_user_mode_prepare include/linux/entry-common.h:328 [inline] __syscall_exit_to_user_mode_work kernel/entry/common.c:207 [inline] syscall_exit_to_user_mode+0x278/0x2a0 kernel/entry/common.c:218 do_syscall_64+0xdc/0x260 arch/x86/entry/common.c:89 entry_SYSCALL_64_after_hwframe+0x77/0x7f The buggy address belongs to the object at ffff8880799bd490 which belongs to the cache dentry of size 312 The buggy address is located 104 bytes inside of freed 312-byte region [ffff8880799bd490, ffff8880799bd5c8) The buggy address belongs to the physical page: page: refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x799bc head: order:1 entire_mapcount:0 nr_pages_mapped:0 pincount:0 memcg:ffff88802c170601 ksm flags: 0xfff80000000840(slab|head|node=0|zone=1|lastcpupid=0xfff) page_type: 0xffffffff() raw: 00fff80000000840 ffff888015ef23c0 ffffea0001dbeb80 dead000000000003 raw: 0000000000000000 0000000000150015 00000001ffffffff ffff88802c170601 head: 00fff80000000840 ffff888015ef23c0 ffffea0001dbeb80 dead000000000003 head: 0000000000000000 0000000000150015 00000001ffffffff ffff88802c170601 head: 00fff80000000001 ffffea0001e66f01 dead000000000122 00000000ffffffff head: 0000000200000000 0000000000000000 00000000ffffffff 0000000000000000 page dumped because: kasan: bad access detected page_owner tracks the page as allocated page last allocated via order 1, migratetype Reclaimable, gfp_mask 0xd20d0(__GFP_IO|__GFP_FS|__GFP_NOWARN|__GFP_NORETRY|__GFP_COMP|__GFP_NOMEMALLOC|__GFP_RECLAIMABLE), pid 4538, tgid 2014757846 (udevd), ts 4538, free_ts 24965243046 set_page_owner include/linux/page_owner.h:32 [inline] post_alloc_hook+0x2d4/0x350 mm/page_alloc.c:1534 prep_new_page mm/page_alloc.c:1541 [inline] get_page_from_freelist+0xa28/0x3780 mm/page_alloc.c:3317 __alloc_pages+0x22b/0x2460 mm/page_alloc.c:4575 __alloc_pages_node include/linux/gfp.h:238 [inline] alloc_pages_node include/linux/gfp.h:261 [inline] alloc_slab_page mm/slub.c:2175 [inline] allocate_slab mm/slub.c:2338 [inline] new_slab+0xcc/0x3a0 mm/slub.c:2391 ___slab_alloc+0x66d/0x1790 mm/slub.c:3525 __slab_alloc.constprop.0+0x56/0xb0 mm/slub.c:3610 __slab_alloc_node mm/slub.c:3663 [inline] slab_alloc_node mm/slub.c:3835 [inline] kmem_cache_alloc_lru+0x379/0x6f0 mm/slub.c:3864 __d_alloc+0x31/0xaa0 fs/dcache.c:1624 d_alloc+0x4a/0x1e0 fs/dcache.c:1704 d_alloc_parallel+0xe9/0x12b0 fs/dcache.c:2462 __lookup_slow+0x194/0x460 fs/namei.c:1677 lookup_slow fs/namei.c:1709 [inline] walk_component+0x350/0x5b0 fs/namei.c:2004 lookup_last fs/namei.c:2461 [inline] path_lookupat+0x17f/0x770 fs/namei.c:2485 filename_lookup+0x1e5/0x5b0 fs/namei.c:2514 vfs_statx+0x13e/0x550 fs/stat.c:244 vfs_fstatat+0xb3/0x150 fs/stat.c:304 page last free pid 1 tgid 1 stack trace: reset_page_owner include/linux/page_owner.h:25 [inline] free_pages_prepare mm/page_alloc.c:1141 [inline] free_unref_page_prepare+0x527/0xb10 mm/page_alloc.c:2347 free_unref_page+0x33/0x3c0 mm/page_alloc.c:2487 free_contig_range+0xb6/0x1a0 mm/page_alloc.c:6572 destroy_args+0xa69/0xe40 mm/debug_vm_pgtable.c:1036 debug_vm_pgtable+0x16db/0x3220 mm/debug_vm_pgtable.c:1416 do_one_initcall+0x128/0x700 init/main.c:1245 do_initcall_level init/main.c:1307 [inline] do_initcalls init/main.c:1323 [inline] do_basic_setup init/main.c:1342 [inline] kernel_init_freeable+0x69d/0xca0 init/main.c:1555 kernel_init+0x1c/0x2b0 init/main.c:1444 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: ffff8880799bd380: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ffff8880799bd400: 00 00 00 00 00 00 00 00 00 00 fc fc fc fc fc fc >ffff8880799bd480: fc fc fa fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff8880799bd500: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff8880799bd580: fb fb fb fb fb fb fb fb fb fc fc fc fc fc fc fc ==================================================================