KASAN: use-after-free Write in udf_close_lvid

16 views
Skip to first unread message

syzbot

unread,
Dec 21, 2021, 10:22:26 AM12/21/21
to syzkaller...@googlegroups.com
Hello,

syzbot found the following issue on:

HEAD commit: 3f8a27f9e27b Linux 4.19.211
git tree: linux-4.19.y
console output: https://syzkaller.appspot.com/x/log.txt?x=17b78295b00000
kernel config: https://syzkaller.appspot.com/x/.config?x=9b9277b418617afe
dashboard link: https://syzkaller.appspot.com/bug?extid=efb32e5b4b237e0a8392
compiler: gcc version 10.2.1 20210110 (Debian 10.2.1-6)

Unfortunately, I don't have any reproducer for this issue yet.

IMPORTANT: if you fix the issue, please add the following tag to the commit:
Reported-by: syzbot+efb32e...@syzkaller.appspotmail.com

IPVS: ftp: loaded support on port[0] = 21
==================================================================
BUG: KASAN: use-after-free in udf_close_lvid+0x67c/0x770 fs/udf/super.c:2051
Write of size 1 at addr ffff888040dafc18 by task syz-executor.0/8168

CPU: 0 PID: 8168 Comm: syz-executor.0 Not tainted 4.19.211-syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011
Call Trace:
__dump_stack lib/dump_stack.c:77 [inline]
dump_stack+0x1fc/0x2ef lib/dump_stack.c:118
print_address_description.cold+0x54/0x219 mm/kasan/report.c:256
kasan_report_error.cold+0x8a/0x1b9 mm/kasan/report.c:354
kasan_report mm/kasan/report.c:412 [inline]
__asan_report_store1_noabort+0x88/0x90 mm/kasan/report.c:435
udf_close_lvid+0x67c/0x770 fs/udf/super.c:2051
udf_put_super+0x217/0x290 fs/udf/super.c:2361
generic_shutdown_super+0x144/0x370 fs/super.c:456
kill_block_super+0x97/0xf0 fs/super.c:1185
deactivate_locked_super+0x94/0x160 fs/super.c:329
deactivate_super+0x174/0x1a0 fs/super.c:360
cleanup_mnt+0x1a8/0x290 fs/namespace.c:1098
task_work_run+0x148/0x1c0 kernel/task_work.c:113
tracehook_notify_resume include/linux/tracehook.h:193 [inline]
exit_to_usermode_loop+0x251/0x2a0 arch/x86/entry/common.c:167
prepare_exit_to_usermode arch/x86/entry/common.c:198 [inline]
syscall_return_slowpath arch/x86/entry/common.c:271 [inline]
do_syscall_64+0x538/0x620 arch/x86/entry/common.c:296
entry_SYSCALL_64_after_hwframe+0x49/0xbe
RIP: 0033:0x7ff66b961307
Code: ff ff ff f7 d8 64 89 01 48 83 c8 ff c3 66 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 01 f0 ff ff 73 01 c3 48 c7 c1 bc ff ff ff f7 d8 64 89 01 48
RSP: 002b:00007ffde977bf38 EFLAGS: 00000246 ORIG_RAX: 00000000000000a6
RAX: 0000000000000000 RBX: 0000000000000000 RCX: 00007ff66b961307
RDX: 00007ffde977c00b RSI: 000000000000000a RDI: 00007ffde977c000
RBP: 00007ffde977c000 R08: 00000000ffffffff R09: 00007ffde977bdd0
R10: 0000555556182903 R11: 0000000000000246 R12: 00007ff66b9b9172
R13: 00007ffde977d0c0 R14: 0000555556182810 R15: 00007ffde977d100

The buggy address belongs to the page:
page:ffffea0001036bc0 count:0 mapcount:-128 mapping:0000000000000000 index:0x1
flags: 0xfff00000000000()
raw: 00fff00000000000 ffffea0001149f08 ffffea0000f49a48 0000000000000000
raw: 0000000000000001 0000000000000000 00000000ffffff7f 0000000000000000
page dumped because: kasan: bad access detected

Memory state around the buggy address:
ffff888040dafb00: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
ffff888040dafb80: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
>ffff888040dafc00: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
^
ffff888040dafc80: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
ffff888040dafd00: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
==================================================================
UDF-fs: INFO Mounting volume 'LinuxUDF', timestamp 2020/09/19 18:44 (1000)
IPVS: ftp: loaded support on port[0] = 21


---
This report is generated by a bot. It may contain errors.
See https://goo.gl/tpsmEJ for more information about syzbot.
syzbot engineers can be reached at syzk...@googlegroups.com.

syzbot will keep track of this issue. See:
https://goo.gl/tpsmEJ#status for how to communicate with syzbot.

syzbot

unread,
Dec 21, 2021, 1:52:19 PM12/21/21
to syzkaller...@googlegroups.com
syzbot has found a reproducer for the following issue on:

HEAD commit: 3f8a27f9e27b Linux 4.19.211
git tree: linux-4.19.y
console output: https://syzkaller.appspot.com/x/log.txt?x=1087c82bb00000
kernel config: https://syzkaller.appspot.com/x/.config?x=9b9277b418617afe
dashboard link: https://syzkaller.appspot.com/bug?extid=efb32e5b4b237e0a8392
compiler: gcc version 10.2.1 20210110 (Debian 10.2.1-6)
syz repro: https://syzkaller.appspot.com/x/repro.syz?x=15e9285db00000
C reproducer: https://syzkaller.appspot.com/x/repro.c?x=1662fa95b00000

IMPORTANT: if you fix the issue, please add the following tag to the commit:
Reported-by: syzbot+efb32e...@syzkaller.appspotmail.com

UDF-fs: error (device loop5): udf_read_inode: (ino 1408) failed !bh
UDF-fs: error (device loop5): udf_fill_super: Error in udf_iget, block=96, partition=0
==================================================================
BUG: KASAN: use-after-free in udf_close_lvid+0x67c/0x770 fs/udf/super.c:2051
Write of size 1 at addr ffff8880a9ab6ef0 by task syz-executor951/14225

CPU: 1 PID: 14225 Comm: syz-executor951 Not tainted 4.19.211-syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011
UDF-fs: INFO Mounting volume 'LinuxUDF', timestamp 2020/09/19 18:44 (1000)
Call Trace:
__dump_stack lib/dump_stack.c:77 [inline]
dump_stack+0x1fc/0x2ef lib/dump_stack.c:118
print_address_description.cold+0x54/0x219 mm/kasan/report.c:256
kasan_report_error.cold+0x8a/0x1b9 mm/kasan/report.c:354
kasan_report mm/kasan/report.c:412 [inline]
__asan_report_store1_noabort+0x88/0x90 mm/kasan/report.c:435
udf_close_lvid+0x67c/0x770 fs/udf/super.c:2051
udf_fill_super+0xed2/0x17a0 fs/udf/super.c:2310
mount_bdev+0x2fc/0x3b0 fs/super.c:1158
mount_fs+0xa3/0x310 fs/super.c:1261
vfs_kern_mount.part.0+0x68/0x470 fs/namespace.c:961
UDF-fs: error (device loop4): udf_read_inode: (ino 1408) failed !bh
vfs_kern_mount fs/namespace.c:951 [inline]
do_new_mount fs/namespace.c:2492 [inline]
do_mount+0x115c/0x2f50 fs/namespace.c:2822
UDF-fs: error (device loop4): udf_fill_super: Error in udf_iget, block=96, partition=0
ksys_mount+0xcf/0x130 fs/namespace.c:3038
__do_sys_mount fs/namespace.c:3052 [inline]
__se_sys_mount fs/namespace.c:3049 [inline]
__x64_sys_mount+0xba/0x150 fs/namespace.c:3049
do_syscall_64+0xf9/0x620 arch/x86/entry/common.c:293
entry_SYSCALL_64_after_hwframe+0x49/0xbe
RIP: 0033:0x7fe8f063c6aa
Code: 48 c7 c2 b8 ff ff ff f7 d8 64 89 02 b8 ff ff ff ff eb d2 e8 d8 00 00 00 0f 1f 84 00 00 00 00 00 49 89 ca b8 a5 00 00 00 0f 05 <48> 3d 01 f0 ff ff 73 01 c3 48 c7 c1 b8 ff ff ff f7 d8 64 89 01 48
UDF-fs: error (device loop3): udf_fill_super: Error in udf_iget, block=96, partition=0
RSP: 002b:00007fe8f05e7168 EFLAGS: 00000286 ORIG_RAX: 00000000000000a5
RAX: ffffffffffffffda RBX: 00007fe8f05e71c0 RCX: 00007fe8f063c6aa
RDX: 0000000020000000 RSI: 0000000020000700 RDI: 00007fe8f05e7180
RBP: 000000000000000e R08: 00007fe8f05e71c0 R09: 00007fe8f05e76b8
R10: 0000000000000810 R11: 0000000000000286 R12: 00007fe8f05e7180
R13: 0000000020000350 R14: 0000000000000003 R15: 0000000000000004

The buggy address belongs to the page:
page:ffffea0002a6ad80 count:0 mapcount:-128 mapping:0000000000000000 index:0x0
flags: 0xfff00000000000()
raw: 00fff00000000000 ffffea0002c30f48 ffffea0002d26708 0000000000000000
raw: 0000000000000000 0000000000000000 00000000ffffff7f 0000000000000000
page dumped because: kasan: bad access detected

Memory state around the buggy address:
ffff8880a9ab6d80: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
ffff8880a9ab6e00: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
>ffff8880a9ab6e80: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
^
ffff8880a9ab6f00: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
ffff8880a9ab6f80: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
==================================================================

Reply all
Reply to author
Forward
0 new messages