================================================================== BUG: KASAN: use-after-free in udf_close_lvid+0x508/0x5c0 fs/udf/super.c:2035 Write of size 1 at addr ffff888090c696e8 by task syz-executor.0/5070 CPU: 1 PID: 5070 Comm: syz-executor.0 Not tainted 6.6.0-rc5-syzkaller-00227-gad7f1baed071 #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 09/06/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 udf_close_lvid+0x508/0x5c0 fs/udf/super.c:2035 udf_put_super+0x19c/0x200 fs/udf/super.c:2322 generic_shutdown_super+0x161/0x3c0 fs/super.c:693 kill_block_super+0x3b/0x70 fs/super.c:1646 deactivate_locked_super+0x9a/0x170 fs/super.c:481 deactivate_super+0xde/0x100 fs/super.c:514 cleanup_mnt+0x222/0x3d0 fs/namespace.c:1254 task_work_run+0x14d/0x240 kernel/task_work.c:180 resume_user_mode_work include/linux/resume_user_mode.h:49 [inline] exit_to_user_mode_loop kernel/entry/common.c:171 [inline] exit_to_user_mode_prepare+0x215/0x240 kernel/entry/common.c:204 __syscall_exit_to_user_mode_work kernel/entry/common.c:285 [inline] syscall_exit_to_user_mode+0x1d/0x60 kernel/entry/common.c:296 do_syscall_64+0x44/0xb0 arch/x86/entry/common.c:86 entry_SYSCALL_64_after_hwframe+0x63/0xcd RIP: 0033:0x7f096e67de17 Code: b0 ff ff ff f7 d8 64 89 01 48 83 c8 ff c3 0f 1f 44 00 00 31 f6 e9 09 00 00 00 66 0f 1f 84 00 00 00 00 00 b8 a6 00 00 00 0f 05 <48> 3d 00 f0 ff ff 77 01 c3 48 c7 c2 b0 ff ff ff f7 d8 64 89 02 b8 RSP: 002b:00007ffe0c203928 EFLAGS: 00000246 ORIG_RAX: 00000000000000a6 RAX: 0000000000000000 RBX: 0000000000000000 RCX: 00007f096e67de17 RDX: 0000000000000000 RSI: 000000000000000a RDI: 00007ffe0c2039e0 RBP: 00007ffe0c2039e0 R08: 0000000000000000 R09: 0000000000000000 R10: 00000000ffffffff R11: 0000000000000246 R12: 00007ffe0c204aa0 R13: 00007f096e6c73b9 R14: 00000000000a73fb R15: 0000000000000004 The buggy address belongs to the physical page: page:ffffea0002431a40 refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x90c69 flags: 0xfff00000000000(node=0|zone=1|lastcpupid=0x7ff) page_type: 0xffffffff() raw: 00fff00000000000 dead000000000100 dead000000000122 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 0, migratetype Unmovable, gfp_mask 0x502cc2(GFP_HIGHUSER|__GFP_NOWARN|__GFP_ACCOUNT), pid 9745, tgid 9743 (syz-executor.2), ts 394416207080, free_ts 395105992918 set_page_owner include/linux/page_owner.h:31 [inline] post_alloc_hook+0x2cf/0x340 mm/page_alloc.c:1536 prep_new_page mm/page_alloc.c:1543 [inline] get_page_from_freelist+0xee0/0x2f20 mm/page_alloc.c:3170 __alloc_pages+0x1d0/0x4a0 mm/page_alloc.c:4426 alloc_pages+0x1a9/0x270 mm/mempolicy.c:2297 vm_area_alloc_pages mm/vmalloc.c:3063 [inline] __vmalloc_area_node mm/vmalloc.c:3139 [inline] __vmalloc_node_range+0xa6e/0x1540 mm/vmalloc.c:3320 kvmalloc_node+0x14b/0x1a0 mm/util.c:632 kvmalloc include/linux/slab.h:737 [inline] xt_alloc_table_info+0x3e/0xa0 net/netfilter/x_tables.c:1192 do_replace net/ipv4/netfilter/ip_tables.c:1122 [inline] do_ipt_set_ctl+0x534/0xbb0 net/ipv4/netfilter/ip_tables.c:1627 nf_setsockopt+0x87/0xe0 net/netfilter/nf_sockopt.c:101 ip_setsockopt+0xc7/0xe0 net/ipv4/ip_sockglue.c:1429 raw_setsockopt+0x218/0x290 net/ipv4/raw.c:833 __sys_setsockopt+0x2cd/0x5b0 net/socket.c:2325 __do_sys_setsockopt net/socket.c:2336 [inline] __se_sys_setsockopt net/socket.c:2333 [inline] __x64_sys_setsockopt+0xbd/0x150 net/socket.c:2333 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x38/0xb0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x63/0xcd page last free stack trace: reset_page_owner include/linux/page_owner.h:24 [inline] free_pages_prepare mm/page_alloc.c:1136 [inline] free_unref_page_prepare+0x476/0xa40 mm/page_alloc.c:2312 free_unref_page+0x33/0x3b0 mm/page_alloc.c:2405 vfree+0x181/0x7a0 mm/vmalloc.c:2842 __vmalloc_area_node mm/vmalloc.c:3203 [inline] __vmalloc_node_range+0xf6f/0x1540 mm/vmalloc.c:3320 kvmalloc_node+0x14b/0x1a0 mm/util.c:632 kvmalloc include/linux/slab.h:737 [inline] xt_alloc_table_info+0x3e/0xa0 net/netfilter/x_tables.c:1192 do_replace net/ipv4/netfilter/ip_tables.c:1122 [inline] do_ipt_set_ctl+0x534/0xbb0 net/ipv4/netfilter/ip_tables.c:1627 nf_setsockopt+0x87/0xe0 net/netfilter/nf_sockopt.c:101 ip_setsockopt+0xc7/0xe0 net/ipv4/ip_sockglue.c:1429 raw_setsockopt+0x218/0x290 net/ipv4/raw.c:833 __sys_setsockopt+0x2cd/0x5b0 net/socket.c:2325 __do_sys_setsockopt net/socket.c:2336 [inline] __se_sys_setsockopt net/socket.c:2333 [inline] __x64_sys_setsockopt+0xbd/0x150 net/socket.c:2333 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x38/0xb0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x63/0xcd Memory state around the buggy address: ffff888090c69580: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ffff888090c69600: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff >ffff888090c69680: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ^ ffff888090c69700: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ffff888090c69780: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ==================================================================