================================================================== BUG: KASAN: use-after-free in udf_close_lvid+0x508/0x5c0 fs/udf/super.c:2035 Write of size 1 at addr ffff88814a206138 by task syz-executor.3/7508 CPU: 1 PID: 7508 Comm: syz-executor.3 Not tainted 6.7.0-rc8-syzkaller-00174-g95c8a35f1c01 #0 Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.2-debian-1.16.2-1 04/01/2014 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 udf_close_lvid+0x508/0x5c0 fs/udf/super.c:2035 udf_put_super+0x19c/0x200 fs/udf/super.c:2322 generic_shutdown_super+0x161/0x3d0 fs/super.c:696 kill_block_super+0x3b/0x90 fs/super.c:1667 deactivate_locked_super+0xbc/0x1a0 fs/super.c:484 deactivate_super+0xde/0x100 fs/super.c:517 cleanup_mnt+0x222/0x450 fs/namespace.c:1256 task_work_run+0x14d/0x240 kernel/task_work.c:180 exit_task_work include/linux/task_work.h:38 [inline] do_exit+0xa8a/0x2ad0 kernel/exit.c:869 do_group_exit+0xd4/0x2a0 kernel/exit.c:1018 get_signal+0x23b5/0x2790 kernel/signal.c:2904 arch_do_signal_or_restart+0x90/0x7f0 arch/x86/kernel/signal.c:309 exit_to_user_mode_loop kernel/entry/common.c:168 [inline] exit_to_user_mode_prepare+0x121/0x240 kernel/entry/common.c:204 __syscall_exit_to_user_mode_work kernel/entry/common.c:285 [inline] syscall_exit_to_user_mode+0x1e/0x60 kernel/entry/common.c:296 do_syscall_64+0x4d/0x110 arch/x86/entry/common.c:89 entry_SYSCALL_64_after_hwframe+0x63/0x6b RIP: 0033:0x7f898f2a8135 Code: Unable to access opcode bytes at 0x7f898f2a810b. RSP: 002b:00007f899006d010 EFLAGS: 00000293 ORIG_RAX: 00000000000000e6 RAX: fffffffffffffdfc RBX: 00007f898f3abf80 RCX: 00007f898f2a8135 RDX: 00007f899006d050 RSI: 0000000000000000 RDI: 0000000000000000 RBP: 00007f898f2c947a R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000293 R12: 0000000000000000 R13: 000000000000000b R14: 00007f898f3abf80 R15: 00007ffed0f60698 The buggy address belongs to the physical page: page:ffffea0005288180 refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x14a206 flags: 0x57ff00000000000(node=1|zone=2|lastcpupid=0x7ff) page_type: 0xffffffff() raw: 057ff00000000000 0000000000000000 ffffea0005288188 0000000000000000 raw: 0000000000000000 0000000000000000 00000000ffffffff 0000000000000000 page dumped because: kasan: bad access detected page_owner tracks the page as freed page last allocated via order 8, migratetype Unmovable, gfp_mask 0x1521c2(__GFP_HIGHMEM|__GFP_IO|__GFP_FS|__GFP_NOWARN|__GFP_NORETRY|__GFP_COMP|__GFP_ZERO|__GFP_HARDWALL), pid 11906, tgid 11905 (syz-executor.0), ts 235057021195, free_ts 235337834003 set_page_owner include/linux/page_owner.h:31 [inline] post_alloc_hook+0x2d0/0x350 mm/page_alloc.c:1537 prep_new_page mm/page_alloc.c:1544 [inline] get_page_from_freelist+0xa25/0x36d0 mm/page_alloc.c:3312 __alloc_pages+0x22e/0x2420 mm/page_alloc.c:4568 alloc_pages_mpol+0x258/0x5f0 mm/mempolicy.c:2133 alloc_largest_available drivers/dma-buf/heaps/system_heap.c:326 [inline] system_heap_allocate+0x272/0xf70 drivers/dma-buf/heaps/system_heap.c:371 dma_heap_buffer_alloc drivers/dma-buf/dma-heap.c:67 [inline] dma_heap_ioctl_allocate drivers/dma-buf/dma-heap.c:111 [inline] dma_heap_ioctl+0x33e/0x690 drivers/dma-buf/dma-heap.c:171 vfs_ioctl fs/ioctl.c:51 [inline] __do_sys_ioctl fs/ioctl.c:871 [inline] __se_sys_ioctl fs/ioctl.c:857 [inline] __x64_sys_ioctl+0x18f/0x210 fs/ioctl.c:857 do_syscall_x64 arch/x86/entry/common.c:52 [inline] do_syscall_64+0x40/0x110 arch/x86/entry/common.c:83 entry_SYSCALL_64_after_hwframe+0x63/0x6b 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_pages_ok+0x60a/0xc50 mm/page_alloc.c:1267 system_heap_dma_buf_release+0x168/0x260 drivers/dma-buf/heaps/system_heap.c:295 dma_buf_release+0x153/0x2c0 drivers/dma-buf/dma-buf.c:79 __dentry_kill+0x423/0x640 fs/dcache.c:612 dentry_kill fs/dcache.c:733 [inline] dput+0x7eb/0xd90 fs/dcache.c:913 __fput+0x3b9/0xb70 fs/file_table.c:402 __fput_sync+0x47/0x50 fs/file_table.c:475 __do_sys_close fs/open.c:1587 [inline] __se_sys_close fs/open.c:1572 [inline] __x64_sys_close+0x87/0xf0 fs/open.c:1572 do_syscall_x64 arch/x86/entry/common.c:52 [inline] do_syscall_64+0x40/0x110 arch/x86/entry/common.c:83 entry_SYSCALL_64_after_hwframe+0x63/0x6b Memory state around the buggy address: ffff88814a206000: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ffff88814a206080: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff >ffff88814a206100: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ^ ffff88814a206180: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ffff88814a206200: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ==================================================================