Hello,
syzbot found the following issue on:
HEAD commit: 179ef7fe8677 Linux 4.14.300
git tree: linux-4.14.y
console output:
https://syzkaller.appspot.com/x/log.txt?x=17c66825880000
kernel config:
https://syzkaller.appspot.com/x/.config?x=aa85f51ec321d5a9
dashboard link:
https://syzkaller.appspot.com/bug?extid=71309098e18549147e83
compiler: gcc version 10.2.1 20210110 (Debian 10.2.1-6)
syz repro:
https://syzkaller.appspot.com/x/repro.syz?x=1056bea7880000
C reproducer:
https://syzkaller.appspot.com/x/repro.c?x=100d89bd880000
Downloadable assets:
disk image:
https://storage.googleapis.com/syzbot-assets/d311ef57b59a/disk-179ef7fe.raw.xz
vmlinux:
https://storage.googleapis.com/syzbot-assets/25bf5d729f69/vmlinux-179ef7fe.xz
kernel image:
https://storage.googleapis.com/syzbot-assets/db9b96571e69/bzImage-179ef7fe.xz
mounted in repro:
https://storage.googleapis.com/syzbot-assets/d8cad6d1cae1/mount_0.gz
IMPORTANT: if you fix the issue, please add the following tag to the commit:
Reported-by:
syzbot+713090...@syzkaller.appspotmail.com
UDF-fs: INFO Mounting volume 'LinuxUDF', timestamp 2022/11/22 14:59 (1000)
==================================================================
BUG: KASAN: use-after-free in udf_get_filelongad+0x111/0x120 fs/udf/directory.c:237
Read of size 4 at addr ffff8880b4371c98 by task syz-executor278/7977
CPU: 1 PID: 7977 Comm: syz-executor278 Not tainted 4.14.300-syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 10/26/2022
Call Trace:
__dump_stack lib/dump_stack.c:17 [inline]
dump_stack+0x1b2/0x281 lib/dump_stack.c:58
print_address_description.cold+0x54/0x1d3 mm/kasan/report.c:252
kasan_report_error.cold+0x8a/0x191 mm/kasan/report.c:351
kasan_report mm/kasan/report.c:409 [inline]
__asan_report_load_n_noabort+0x6b/0x80 mm/kasan/report.c:440
udf_get_filelongad+0x111/0x120 fs/udf/directory.c:237
udf_current_aext+0x183/0x8b0 fs/udf/inode.c:2179
udf_next_aext+0x1f5/0x360 fs/udf/inode.c:2115
udf_extend_file fs/udf/inode.c:657 [inline]
udf_setsize+0x69f/0xe90 fs/udf/inode.c:1251
udf_setattr+0xd2/0x130 fs/udf/file.c:268
notify_change+0x56b/0xd10 fs/attr.c:315
do_truncate+0xff/0x1a0 fs/open.c:63
do_sys_ftruncate.constprop.0+0x3a3/0x480 fs/open.c:205
do_syscall_64+0x1d5/0x640 arch/x86/entry/common.c:292
entry_SYSCALL_64_after_hwframe+0x5e/0xd3
Allocated by task 5881:
save_stack mm/kasan/kasan.c:447 [inline]
set_track mm/kasan/kasan.c:459 [inline]
kasan_kmalloc+0xeb/0x160 mm/kasan/kasan.c:551
__do_kmalloc_node mm/slab.c:3682 [inline]
__kmalloc_node_track_caller+0x4c/0x70 mm/slab.c:3696
__kmalloc_reserve net/core/skbuff.c:137 [inline]
__alloc_skb+0x96/0x510 net/core/skbuff.c:205
alloc_skb include/linux/skbuff.h:980 [inline]
alloc_skb_with_frags+0x85/0x500 net/core/skbuff.c:5261
sock_alloc_send_pskb+0x577/0x6d0 net/core/sock.c:2101
unix_dgram_sendmsg+0x331/0x1080 net/unix/af_unix.c:1722
sock_sendmsg_nosec net/socket.c:646 [inline]
sock_sendmsg+0xb5/0x100 net/socket.c:656
sock_write_iter+0x22c/0x370 net/socket.c:925
call_write_iter include/linux/fs.h:1780 [inline]
new_sync_write fs/read_write.c:469 [inline]
__vfs_write+0x44c/0x630 fs/read_write.c:482
vfs_write+0x17f/0x4d0 fs/read_write.c:544
SYSC_write fs/read_write.c:590 [inline]
SyS_write+0xf2/0x210 fs/read_write.c:582
do_syscall_64+0x1d5/0x640 arch/x86/entry/common.c:292
entry_SYSCALL_64_after_hwframe+0x5e/0xd3
Freed by task 4631:
save_stack mm/kasan/kasan.c:447 [inline]
set_track mm/kasan/kasan.c:459 [inline]
kasan_slab_free+0xc3/0x1a0 mm/kasan/kasan.c:524
__cache_free mm/slab.c:3496 [inline]
kfree+0xc9/0x250 mm/slab.c:3815
skb_free_head net/core/skbuff.c:563 [inline]
skb_release_data+0x5f6/0x820 net/core/skbuff.c:583
skb_release_all net/core/skbuff.c:640 [inline]
__kfree_skb net/core/skbuff.c:654 [inline]
consume_skb+0xe0/0x380 net/core/skbuff.c:714
skb_free_datagram+0x16/0xe0 net/core/datagram.c:331
unix_dgram_recvmsg+0x67e/0xc60 net/unix/af_unix.c:2225
sock_recvmsg_nosec net/socket.c:819 [inline]
sock_recvmsg net/socket.c:826 [inline]
sock_recvmsg+0xc0/0x100 net/socket.c:822
___sys_recvmsg+0x20b/0x4d0 net/socket.c:2221
__sys_recvmsg+0xa0/0x120 net/socket.c:2266
SYSC_recvmsg net/socket.c:2278 [inline]
SyS_recvmsg+0x27/0x40 net/socket.c:2273
do_syscall_64+0x1d5/0x640 arch/x86/entry/common.c:292
entry_SYSCALL_64_after_hwframe+0x5e/0xd3
The buggy address belongs to the object at ffff8880b4371ac0
which belongs to the cache kmalloc-512 of size 512
The buggy address is located 472 bytes inside of
512-byte region [ffff8880b4371ac0, ffff8880b4371cc0)
The buggy address belongs to the page:
page:ffffea0002d0dc40 count:1 mapcount:0 mapping:ffff8880b43710c0 index:0x0
flags: 0xfff00000000100(slab)
raw: 00fff00000000100 ffff8880b43710c0 0000000000000000 0000000100000006
raw: ffffea000257ed60 ffffea00025942e0 ffff88813fe74940 0000000000000000
page dumped because: kasan: bad access detected
Memory state around the buggy address:
ffff8880b4371b80: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
ffff8880b4371c00: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
>ffff8880b4371c80: fb fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc
^
ffff8880b4371d00: fc fc fc fc fc fc fc fc 00 00 00 00 00 00 00 00
ffff8880b4371d80: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00