syzbot


KASAN: use-after-free Read in udf_sync_fs

Status: upstream: reported C repro on 2023/06/16 18:53
Bug presence: origin:upstream
[Documentation on labels]
Reported-by: syzbot+d8d08094ff268799bae7@syzkaller.appspotmail.com
First crash: 481d, last: 5d07h
Bug presence (1)
Date Name Commit Repro Result
2023/06/16 upstream (ToT) 4973ca295528 C [report] KASAN: use-after-free Read in udf_sync_fs
Similar bugs (2)
Kernel Title Repro Cause bisect Fix bisect Count Last Reported Patched Status
linux-6.1 KASAN: use-after-free Read in udf_sync_fs origin:upstream C 48 42d 480d 0/3 upstream: reported C repro on 2023/06/18 11:33
upstream KASAN: use-after-free Read in udf_sync_fs udf C done done 37 286d 425d 25/28 fixed on 2024/02/03 12:44
Last patch testing requests (5)
Created Duration User Patch Repo Result
2024/10/05 06:45 14m retest repro linux-5.15.y report log
2024/10/05 06:45 9m retest repro linux-5.15.y report log
2024/10/05 06:45 9m retest repro linux-5.15.y report log
2024/10/05 06:45 9m retest repro linux-5.15.y report log
2024/10/05 06:45 13m retest repro linux-5.15.y report log
Fix bisection attempts (8)
Created Duration User Patch Repo Result
2024/07/29 16:11 2h19m bisect fix linux-5.15.y OK (0) job log log
2024/06/12 10:26 1h41m bisect fix linux-5.15.y OK (0) job log log
2024/03/31 22:48 1h24m bisect fix linux-5.15.y OK (0) job log log
2024/03/01 11:46 1h59m bisect fix linux-5.15.y OK (0) job log log
2024/01/21 12:34 1h50m bisect fix linux-5.15.y OK (0) job log log
2023/12/07 04:17 1h08m bisect fix linux-5.15.y OK (0) job log log
2023/10/21 19:29 1h00m bisect fix linux-5.15.y OK (0) job log log
2023/09/21 07:23 1h18m bisect fix linux-5.15.y OK (0) job log log

Sample crash report:
==================================================================
BUG: KASAN: use-after-free in crc_itu_t+0x218/0x2a0 lib/crc-itu-t.c:60
Read of size 1 at addr ffff88806c8e2000 by task syz-executor307/3563

CPU: 0 PID: 3563 Comm: syz-executor307 Not tainted 5.15.165-syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 08/06/2024
Call Trace:
 <TASK>
 __dump_stack lib/dump_stack.c:88 [inline]
 dump_stack_lvl+0x1e3/0x2d0 lib/dump_stack.c:106
 print_address_description+0x63/0x3b0 mm/kasan/report.c:248
 __kasan_report mm/kasan/report.c:434 [inline]
 kasan_report+0x16b/0x1c0 mm/kasan/report.c:451
 crc_itu_t+0x218/0x2a0 lib/crc-itu-t.c:60
 udf_finalize_lvid fs/udf/super.c:2026 [inline]
 udf_sync_fs+0x1ce/0x380 fs/udf/super.c:2382
 sync_filesystem+0xe8/0x220 fs/sync.c:56
 generic_shutdown_super+0x6e/0x2c0 fs/super.c:448
 kill_block_super+0x7a/0xe0 fs/super.c:1425
 deactivate_locked_super+0xa0/0x110 fs/super.c:335
 cleanup_mnt+0x44e/0x500 fs/namespace.c:1143
 task_work_run+0x129/0x1a0 kernel/task_work.c:188
 exit_task_work include/linux/task_work.h:33 [inline]
 do_exit+0x6a3/0x2480 kernel/exit.c:874
 do_group_exit+0x144/0x310 kernel/exit.c:996
 __do_sys_exit_group kernel/exit.c:1007 [inline]
 __se_sys_exit_group kernel/exit.c:1005 [inline]
 __x64_sys_exit_group+0x3b/0x40 kernel/exit.c:1005
 do_syscall_x64 arch/x86/entry/common.c:50 [inline]
 do_syscall_64+0x3b/0xb0 arch/x86/entry/common.c:80
 entry_SYSCALL_64_after_hwframe+0x66/0xd0
RIP: 0033:0x7f7eee2a8609
Code: Unable to access opcode bytes at RIP 0x7f7eee2a85df.
RSP: 002b:00007ffc1a7075d8 EFLAGS: 00000246 ORIG_RAX: 00000000000000e7
RAX: ffffffffffffffda RBX: 0000000000000001 RCX: 00007f7eee2a8609
RDX: 000000000000003c RSI: 00000000000000e7 RDI: 0000000000000001
RBP: 00007f7eee33d390 R08: ffffffffffffffb0 R09: 0000000000000010
R10: 0000000000000000 R11: 0000000000000246 R12: 00007f7eee33d390
R13: 0000000000000000 R14: 00007f7eee33e200 R15: 00007f7eee273730
 </TASK>

The buggy address belongs to the page:
page:ffffea0001b23880 refcount:0 mapcount:0 mapping:0000000000000000 index:0x1 pfn:0x6c8e2
flags: 0xfff00000000000(node=0|zone=1|lastcpupid=0x7ff)
raw: 00fff00000000000 ffffea0001b23908 ffffea0001b233c8 0000000000000000
raw: 0000000000000001 0000000000000000 00000000ffffffff 0000000000000000
page dumped because: kasan: bad access detected
page_owner tracks the page as freed
page last allocated via order 0, migratetype Movable, gfp_mask 0x108c48(GFP_NOFS|__GFP_NOFAIL|__GFP_HARDWALL|__GFP_MOVABLE), pid 3564, ts 47195348145, free_ts 47210921294
 prep_new_page mm/page_alloc.c:2426 [inline]
 get_page_from_freelist+0x322a/0x33c0 mm/page_alloc.c:4159
 __alloc_pages+0x272/0x700 mm/page_alloc.c:5423
 __page_cache_alloc+0xd4/0x4a0 mm/filemap.c:1022
 pagecache_get_page+0xa91/0x1010 mm/filemap.c:1940
 find_or_create_page include/linux/pagemap.h:420 [inline]
 grow_dev_page fs/buffer.c:949 [inline]
 grow_buffers fs/buffer.c:1014 [inline]
 __getblk_slow fs/buffer.c:1041 [inline]
 __getblk_gfp+0x22a/0xaf0 fs/buffer.c:1336
 __bread_gfp+0x2a/0x390 fs/buffer.c:1381
 udf_read_tagged+0x126/0xe70 fs/udf/misc.c:219
 udf_check_anchor_block+0x20c/0x700 fs/udf/super.c:1849
 udf_scan_anchors+0x586/0x680 fs/udf/super.c:1928
 udf_find_anchor fs/udf/super.c:1954 [inline]
 udf_load_vrs+0x2f6/0xc40 fs/udf/super.c:2011
 udf_fill_super+0x99d/0x23a0 fs/udf/super.c:2189
 mount_bdev+0x2c9/0x3f0 fs/super.c:1398
 legacy_get_tree+0xeb/0x180 fs/fs_context.c:611
 vfs_get_tree+0x88/0x270 fs/super.c:1528
 do_new_mount+0x2ba/0xb40 fs/namespace.c:3005
 do_mount fs/namespace.c:3348 [inline]
 __do_sys_mount fs/namespace.c:3556 [inline]
 __se_sys_mount+0x2d5/0x3c0 fs/namespace.c:3533
page last free stack trace:
 reset_page_owner include/linux/page_owner.h:24 [inline]
 free_pages_prepare mm/page_alloc.c:1340 [inline]
 free_pcp_prepare mm/page_alloc.c:1391 [inline]
 free_unref_page_prepare+0xc34/0xcf0 mm/page_alloc.c:3317
 free_unref_page_list+0x1f7/0x8e0 mm/page_alloc.c:3433
 release_pages+0x1bb9/0x1f40 mm/swap.c:963
 __pagevec_release+0x80/0xf0 mm/swap.c:983
 pagevec_release include/linux/pagevec.h:81 [inline]
 truncate_inode_pages_range+0x48b/0x1290 mm/truncate.c:329
 kill_bdev block/bdev.c:77 [inline]
 set_blocksize+0x2ff/0x370 block/bdev.c:157
 sb_set_blocksize+0x45/0xe0 block/bdev.c:166
 udf_load_vrs+0xdd/0xc40 fs/udf/super.c:1985
 udf_fill_super+0x99d/0x23a0 fs/udf/super.c:2189
 mount_bdev+0x2c9/0x3f0 fs/super.c:1398
 legacy_get_tree+0xeb/0x180 fs/fs_context.c:611
 vfs_get_tree+0x88/0x270 fs/super.c:1528
 do_new_mount+0x2ba/0xb40 fs/namespace.c:3005
 do_mount fs/namespace.c:3348 [inline]
 __do_sys_mount fs/namespace.c:3556 [inline]
 __se_sys_mount+0x2d5/0x3c0 fs/namespace.c:3533
 do_syscall_x64 arch/x86/entry/common.c:50 [inline]
 do_syscall_64+0x3b/0xb0 arch/x86/entry/common.c:80
 entry_SYSCALL_64_after_hwframe+0x66/0xd0

Memory state around the buggy address:
 ffff88806c8e1f00: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
 ffff88806c8e1f80: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
>ffff88806c8e2000: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
                   ^
 ffff88806c8e2080: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
 ffff88806c8e2100: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
==================================================================

Crashes (19):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2024/09/01 23:48 linux-5.15.y fa93fa65db6e 1eda0d14 .config console log report syz / log C [disk image] [vmlinux] [kernel image] [mounted in repro #1] [mounted in repro #2] ci2-linux-5-15-kasan KASAN: use-after-free Read in udf_sync_fs
2024/05/13 03:37 linux-5.15.y 284087d4f7d5 9026e142 .config console log report syz C [disk image] [vmlinux] [kernel image] [mounted in repro #1] [mounted in repro #2] ci2-linux-5-15-kasan KASAN: use-after-free Read in udf_sync_fs
2024/04/25 16:45 linux-5.15.y c52b9710c83d 8bdc0f22 .config console log report syz C [disk image] [vmlinux] [kernel image] [mounted in repro #1] [mounted in repro #2] ci2-linux-5-15-kasan KASAN: use-after-free Read in udf_sync_fs
2024/04/23 00:14 linux-5.15.y c52b9710c83d 36c961ad .config console log report syz C [disk image] [vmlinux] [kernel image] [mounted in repro #1] [mounted in repro #2] ci2-linux-5-15-kasan KASAN: use-after-free Read in udf_sync_fs
2023/06/28 04:46 linux-5.15.y f67653019430 4cd5bb25 .config console log report syz C [disk image] [vmlinux] [kernel image] [mounted in repro #1] [mounted in repro #2] ci2-linux-5-15-kasan KASAN: use-after-free Read in udf_sync_fs
2023/06/16 18:52 linux-5.15.y 471e639e59d1 f3921d4d .config console log report syz C [disk image] [vmlinux] [kernel image] [mounted in repro #1] [mounted in repro #2] ci2-linux-5-15-kasan KASAN: use-after-free Read in udf_sync_fs
2023/06/23 17:52 linux-5.15.y f67653019430 79782afc .config console log report syz C [disk image] [vmlinux] [kernel image] [mounted in repro #1] [mounted in repro #2] ci2-linux-5-15-kasan KASAN: use-after-free Read in udf_sync_fs
2023/06/20 20:35 linux-5.15.y 471e639e59d1 09ffe269 .config console log report syz C [disk image] [vmlinux] [kernel image] [mounted in repro #1] [mounted in repro #2] ci2-linux-5-15-kasan KASAN: use-after-free Read in udf_sync_fs
2024/08/15 19:10 linux-5.15.y 7e89efd3ae1c e4bacdaf .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan KASAN: use-after-free Read in udf_sync_fs
2024/08/15 19:08 linux-5.15.y 7e89efd3ae1c e4bacdaf .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan KASAN: use-after-free Read in udf_sync_fs
2024/08/15 19:06 linux-5.15.y 7e89efd3ae1c e4bacdaf .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan KASAN: use-after-free Read in udf_sync_fs
2024/08/15 18:34 linux-5.15.y 7e89efd3ae1c e4bacdaf .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan KASAN: use-after-free Read in udf_sync_fs
2024/07/29 18:04 linux-5.15.y 7e89efd3ae1c 5187fc86 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan KASAN: use-after-free Read in udf_sync_fs
2024/04/22 22:40 linux-5.15.y c52b9710c83d 36c961ad .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan KASAN: use-after-free Read in udf_sync_fs
2024/04/22 22:39 linux-5.15.y c52b9710c83d 36c961ad .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan KASAN: use-after-free Read in udf_sync_fs
2023/12/22 04:25 linux-5.15.y 1d146b1875fc 4f9530a3 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan KASAN: use-after-free Read in udf_sync_fs
2023/11/06 20:44 linux-5.15.y 12952a23a5da 78fae24e .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan KASAN: use-after-free Read in udf_sync_fs
2023/07/07 21:52 linux-5.15.y d54cfc420586 668cb1fa .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan KASAN: use-after-free Read in udf_sync_fs
2024/08/15 19:04 linux-5.15.y 7e89efd3ae1c e4bacdaf .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan KASAN: slab-out-of-bounds Read in udf_sync_fs
* Struck through repros no longer work on HEAD.