2023-06-10 06:16:39

by syzbot

[permalink] [raw]
Subject: [syzbot] [udf?] KASAN: slab-use-after-free Read in udf_free_blocks

Hello,

syzbot found the following issue on:

HEAD commit: f8dba31b0a82 Merge tag 'asym-keys-fix-for-linus-v6.4-rc5' ..
git tree: upstream
console output: https://syzkaller.appspot.com/x/log.txt?x=11e8f4b3280000
kernel config: https://syzkaller.appspot.com/x/.config?x=3c980bfe8b399968
dashboard link: https://syzkaller.appspot.com/bug?extid=0b7937459742a0a4cffd
compiler: gcc (Debian 10.2.1-6) 10.2.1 20210110, GNU ld (GNU Binutils for Debian) 2.35.2
syz repro: https://syzkaller.appspot.com/x/repro.syz?x=10bcb6b5280000
C reproducer: https://syzkaller.appspot.com/x/repro.c?x=12fbcfd1280000

Downloadable assets:
disk image: https://storage.googleapis.com/syzbot-assets/0aac0833aa9d/disk-f8dba31b.raw.xz
vmlinux: https://storage.googleapis.com/syzbot-assets/06f1060b83c8/vmlinux-f8dba31b.xz
kernel image: https://storage.googleapis.com/syzbot-assets/8450975febdf/bzImage-f8dba31b.xz
mounted in repro: https://storage.googleapis.com/syzbot-assets/5473bd744cf1/mount_0.gz

IMPORTANT: if you fix the issue, please add the following tag to the commit:
Reported-by: [email protected]

==================================================================
BUG: KASAN: slab-use-after-free in udf_free_blocks+0x11f3/0x1330 fs/udf/balloc.c:681
Read of size 2 at addr ffff888079663b2a by task syz-executor147/5322

CPU: 0 PID: 5322 Comm: syz-executor147 Not tainted 6.4.0-rc5-syzkaller-00002-gf8dba31b0a82 #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 05/25/2023
Call Trace:
<TASK>
__dump_stack lib/dump_stack.c:88 [inline]
dump_stack_lvl+0xd9/0x150 lib/dump_stack.c:106
print_address_description.constprop.0+0x2c/0x3c0 mm/kasan/report.c:351
print_report mm/kasan/report.c:462 [inline]
kasan_report+0x11c/0x130 mm/kasan/report.c:572
udf_free_blocks+0x11f3/0x1330 fs/udf/balloc.c:681
udf_discard_prealloc+0x47b/0x4e0 fs/udf/truncate.c:151
udf_map_block+0x408/0x560 fs/udf/inode.c:448
__udf_get_block+0x9c/0x330 fs/udf/inode.c:464
__block_write_begin_int+0x3bd/0x14b0 fs/buffer.c:2064
__block_write_begin fs/buffer.c:2114 [inline]
block_write_begin+0xb9/0x4d0 fs/buffer.c:2175
udf_write_begin+0x285/0x370 fs/udf/inode.c:265
generic_perform_write+0x256/0x570 mm/filemap.c:3923
__generic_file_write_iter+0x2ae/0x500 mm/filemap.c:4051
udf_file_write_iter+0x233/0x740 fs/udf/file.c:115
call_write_iter include/linux/fs.h:1868 [inline]
do_iter_readv_writev+0x20b/0x3b0 fs/read_write.c:735
do_iter_write+0x185/0x7e0 fs/read_write.c:860
vfs_iter_write+0x74/0xa0 fs/read_write.c:901
iter_file_splice_write+0x743/0xc80 fs/splice.c:795
do_splice_from fs/splice.c:873 [inline]
direct_splice_actor+0x114/0x180 fs/splice.c:1039
splice_direct_to_actor+0x335/0x8a0 fs/splice.c:994
do_splice_direct+0x1ab/0x280 fs/splice.c:1082
do_sendfile+0xb19/0x12c0 fs/read_write.c:1254
__do_sys_sendfile64 fs/read_write.c:1322 [inline]
__se_sys_sendfile64 fs/read_write.c:1308 [inline]
__x64_sys_sendfile64+0x1d0/0x210 fs/read_write.c:1308
do_syscall_x64 arch/x86/entry/common.c:50 [inline]
do_syscall_64+0x39/0xb0 arch/x86/entry/common.c:80
entry_SYSCALL_64_after_hwframe+0x63/0xcd
RIP: 0033:0x7f9f5e6044c9
Code: 28 00 00 00 75 05 48 83 c4 28 c3 e8 41 16 00 00 90 48 89 f8 48 89 f7 48 89 d6 48 89 ca 4d 89 c2 4d 89 c8 4c 8b 4c 24 08 0f 05 <48> 3d 01 f0 ff ff 73 01 c3 48 c7 c1 b8 ff ff ff f7 d8 64 89 01 48
RSP: 002b:00007f9f5628a2f8 EFLAGS: 00000246 ORIG_RAX: 0000000000000028
RAX: ffffffffffffffda RBX: 00007f9f5e691590 RCX: 00007f9f5e6044c9
RDX: 0000000000000000 RSI: 0000000000000007 RDI: 0000000000000005
RBP: 00007f9f5e657328 R08: 00007f9f5628a700 R09: 0000000000000000
R10: 0000000100000001 R11: 0000000000000246 R12: 6573726168636f69
R13: 0030656c69662f2e R14: 0031656c69662f2e R15: 00007f9f5e691598
</TASK>

Allocated by task 4993:
kasan_save_stack+0x22/0x40 mm/kasan/common.c:45
kasan_set_track+0x25/0x30 mm/kasan/common.c:52
__kasan_slab_alloc+0x7f/0x90 mm/kasan/common.c:328
kasan_slab_alloc include/linux/kasan.h:186 [inline]
slab_post_alloc_hook mm/slab.h:711 [inline]
slab_alloc_node mm/slub.c:3451 [inline]
slab_alloc mm/slub.c:3459 [inline]
__kmem_cache_alloc_lru mm/slub.c:3466 [inline]
kmem_cache_alloc+0x17c/0x3b0 mm/slub.c:3475
getname_flags.part.0+0x50/0x4f0 fs/namei.c:140
getname_flags include/linux/audit.h:321 [inline]
getname+0x92/0xd0 fs/namei.c:219
do_sys_openat2+0xf5/0x4c0 fs/open.c:1350
do_sys_open fs/open.c:1372 [inline]
__do_sys_openat fs/open.c:1388 [inline]
__se_sys_openat fs/open.c:1383 [inline]
__x64_sys_openat+0x143/0x1f0 fs/open.c:1383
do_syscall_x64 arch/x86/entry/common.c:50 [inline]
do_syscall_64+0x39/0xb0 arch/x86/entry/common.c:80
entry_SYSCALL_64_after_hwframe+0x63/0xcd

Freed by task 4993:
kasan_save_stack+0x22/0x40 mm/kasan/common.c:45
kasan_set_track+0x25/0x30 mm/kasan/common.c:52
kasan_save_free_info+0x2e/0x40 mm/kasan/generic.c:521
____kasan_slab_free mm/kasan/common.c:236 [inline]
____kasan_slab_free+0x160/0x1c0 mm/kasan/common.c:200
kasan_slab_free include/linux/kasan.h:162 [inline]
slab_free_hook mm/slub.c:1781 [inline]
slab_free_freelist_hook+0x8b/0x1c0 mm/slub.c:1807
slab_free mm/slub.c:3786 [inline]
kmem_cache_free+0xe9/0x480 mm/slub.c:3808
putname fs/namei.c:273 [inline]
putname+0x102/0x140 fs/namei.c:259
do_sys_openat2+0x153/0x4c0 fs/open.c:1365
do_sys_open fs/open.c:1372 [inline]
__do_sys_openat fs/open.c:1388 [inline]
__se_sys_openat fs/open.c:1383 [inline]
__x64_sys_openat+0x143/0x1f0 fs/open.c:1383
do_syscall_x64 arch/x86/entry/common.c:50 [inline]
do_syscall_64+0x39/0xb0 arch/x86/entry/common.c:80
entry_SYSCALL_64_after_hwframe+0x63/0xcd

The buggy address belongs to the object at ffff888079663300
which belongs to the cache names_cache of size 4096
The buggy address is located 2090 bytes inside of
freed 4096-byte region [ffff888079663300, ffff888079664300)

The buggy address belongs to the physical page:
page:ffffea0001e59800 refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x79660
head:ffffea0001e59800 order:3 entire_mapcount:0 nr_pages_mapped:0 pincount:0
flags: 0xfff00000010200(slab|head|node=0|zone=1|lastcpupid=0x7ff)
page_type: 0xffffffff()
raw: 00fff00000010200 ffff888140006780 dead000000000100 dead000000000122
raw: 0000000000000000 0000000000070007 00000001ffffffff 0000000000000000
page dumped because: kasan: bad access detected
page_owner tracks the page as allocated
page last allocated via order 3, migratetype Unmovable, gfp_mask 0xd20c0(__GFP_IO|__GFP_FS|__GFP_NOWARN|__GFP_NORETRY|__GFP_COMP|__GFP_NOMEMALLOC), pid 4466, tgid 4466 (udevd), ts 11901820024, free_ts 9305063821
set_page_owner include/linux/page_owner.h:31 [inline]
post_alloc_hook+0x2db/0x350 mm/page_alloc.c:1731
prep_new_page mm/page_alloc.c:1738 [inline]
get_page_from_freelist+0xf41/0x2c00 mm/page_alloc.c:3502
__alloc_pages+0x1cb/0x4a0 mm/page_alloc.c:4768
alloc_pages+0x1aa/0x270 mm/mempolicy.c:2279
alloc_slab_page mm/slub.c:1851 [inline]
allocate_slab+0x25f/0x390 mm/slub.c:1998
new_slab mm/slub.c:2051 [inline]
___slab_alloc+0xa91/0x1400 mm/slub.c:3192
__slab_alloc.constprop.0+0x56/0xa0 mm/slub.c:3291
__slab_alloc_node mm/slub.c:3344 [inline]
slab_alloc_node mm/slub.c:3441 [inline]
slab_alloc mm/slub.c:3459 [inline]
__kmem_cache_alloc_lru mm/slub.c:3466 [inline]
kmem_cache_alloc+0x38e/0x3b0 mm/slub.c:3475
getname_flags.part.0+0x50/0x4f0 fs/namei.c:140
getname_flags include/linux/audit.h:321 [inline]
getname+0x92/0xd0 fs/namei.c:219
do_sys_openat2+0xf5/0x4c0 fs/open.c:1350
do_sys_open fs/open.c:1372 [inline]
__do_sys_openat fs/open.c:1388 [inline]
__se_sys_openat fs/open.c:1383 [inline]
__x64_sys_openat+0x143/0x1f0 fs/open.c:1383
do_syscall_x64 arch/x86/entry/common.c:50 [inline]
do_syscall_64+0x39/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:1302 [inline]
free_unref_page_prepare+0x62e/0xcb0 mm/page_alloc.c:2564
free_unref_page+0x33/0x370 mm/page_alloc.c:2659
free_contig_range+0xb5/0x180 mm/page_alloc.c:6994
destroy_args+0x6c4/0x920 mm/debug_vm_pgtable.c:1023
debug_vm_pgtable+0x2412/0x4210 mm/debug_vm_pgtable.c:1403
do_one_initcall+0x102/0x540 init/main.c:1246
do_initcall_level init/main.c:1319 [inline]
do_initcalls init/main.c:1335 [inline]
do_basic_setup init/main.c:1354 [inline]
kernel_init_freeable+0x64e/0xba0 init/main.c:1571
kernel_init+0x1e/0x2c0 init/main.c:1462
ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:308

Memory state around the buggy address:
ffff888079663a00: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
ffff888079663a80: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
>ffff888079663b00: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
^
ffff888079663b80: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
ffff888079663c00: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
==================================================================


---
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 [email protected].

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

If the bug is already fixed, let syzbot know by replying with:
#syz fix: exact-commit-title

If you want syzbot to run the reproducer, reply with:
#syz test: git://repo/address.git branch-or-commit-hash
If you attach or paste a git patch, syzbot will apply it before testing.

If you want to change bug's subsystems, reply with:
#syz set subsystems: new-subsystem
(See the list of subsystem names on the web dashboard)

If the bug is a duplicate of another bug, reply with:
#syz dup: exact-subject-of-another-report

If you want to undo deduplication, reply with:
#syz undup


2023-11-25 11:54:16

by syzbot

[permalink] [raw]
Subject: Re: [syzbot] [udf?] KASAN: slab-use-after-free Read in udf_free_blocks

syzbot has bisected this issue to:

commit 36273e5b4e3a934c6d346c8f0b16b97e018094af
Author: Christoph Hellwig <[email protected]>
Date: Sun Nov 13 16:29:02 2022 +0000

udf: remove ->writepage

bisection log: https://syzkaller.appspot.com/x/bisect.txt?x=14d71cece80000
start commit: 123212f53f3e Add linux-next specific files for 20230707
git tree: linux-next
final oops: https://syzkaller.appspot.com/x/report.txt?x=16d71cece80000
console output: https://syzkaller.appspot.com/x/log.txt?x=12d71cece80000
kernel config: https://syzkaller.appspot.com/x/.config?x=15ec80b62f588543
dashboard link: https://syzkaller.appspot.com/bug?extid=0b7937459742a0a4cffd
syz repro: https://syzkaller.appspot.com/x/repro.syz?x=15be1190a80000
C reproducer: https://syzkaller.appspot.com/x/repro.c?x=17d4666aa80000

Reported-by: [email protected]
Fixes: 36273e5b4e3a ("udf: remove ->writepage")

For information about bisection process see: https://goo.gl/tpsmEJ#bisection

2023-11-25 13:10:52

by syzbot

[permalink] [raw]
Subject: Re: [syzbot] [udf?] KASAN: slab-use-after-free Read in udf_free_blocks

For archival purposes, forwarding an incoming command email to
[email protected].

***

Subject: [udf?] KASAN: slab-use-after-free Read in udf_free_blocks
Author: [email protected]

please test uaf in udf_free_blocks

#syz test https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git 123212f53f3e

diff --git a/fs/open.c b/fs/open.c
index 02dc608d40d8..bc2d1db2fcba 100644
--- a/fs/open.c
+++ b/fs/open.c
@@ -1441,11 +1441,11 @@ static long do_sys_openat2(int dfd, const char __user *filename,
if (IS_ERR(f)) {
put_unused_fd(fd);
fd = PTR_ERR(f);
+ putname(tmp);
} else {
fd_install(fd, f);
}
}
- putname(tmp);
return fd;
}


2023-11-25 13:39:28

by syzbot

[permalink] [raw]
Subject: Re: [syzbot] [udf?] KASAN: slab-use-after-free Read in udf_free_blocks

Hello,

syzbot has tested the proposed patch but the reproducer is still triggering an issue:
KASAN: slab-out-of-bounds Read in udf_free_blocks

==================================================================
BUG: KASAN: slab-out-of-bounds in udf_free_blocks+0x12d7/0x1330 fs/udf/balloc.c:677
Read of size 2 at addr ffff888022c83282 by task syz-executor.0/5711

CPU: 0 PID: 5711 Comm: syz-executor.0 Not tainted 6.4.0-next-20230707-syzkaller-dirty #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 11/10/2023
Call Trace:
<TASK>
__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/0x5f0 mm/kasan/report.c:475
kasan_report+0xbe/0xf0 mm/kasan/report.c:588
udf_free_blocks+0x12d7/0x1330 fs/udf/balloc.c:677
udf_split_extents fs/udf/inode.c:954 [inline]
inode_getblk+0x37c8/0x4310 fs/udf/inode.c:889
udf_map_block+0x2e4/0x560 fs/udf/inode.c:446
__udf_get_block+0x99/0x330 fs/udf/inode.c:460
__block_write_begin_int+0x3a7/0x1460 fs/buffer.c:2128
__block_write_begin fs/buffer.c:2178 [inline]
block_write_begin+0xb1/0x490 fs/buffer.c:2237
udf_write_begin+0x283/0x360 fs/udf/inode.c:261
generic_perform_write+0x26c/0x5f0 mm/filemap.c:3925
__generic_file_write_iter+0x1f9/0x240 mm/filemap.c:4020
udf_file_write_iter+0x239/0x740 fs/udf/file.c:111
call_write_iter include/linux/fs.h:1873 [inline]
do_iter_readv_writev+0x208/0x3b0 fs/read_write.c:735
do_iter_write+0x17f/0x830 fs/read_write.c:860
vfs_iter_write+0x7a/0xb0 fs/read_write.c:901
iter_file_splice_write+0x666/0xba0 fs/splice.c:738
do_splice_from fs/splice.c:933 [inline]
direct_splice_actor+0x118/0x180 fs/splice.c:1142
splice_direct_to_actor+0x347/0xa30 fs/splice.c:1088
do_splice_direct+0x1af/0x280 fs/splice.c:1194
do_sendfile+0xb70/0x1370 fs/read_write.c:1254
__do_sys_sendfile64 fs/read_write.c:1322 [inline]
__se_sys_sendfile64 fs/read_write.c:1308 [inline]
__x64_sys_sendfile64+0x1cd/0x210 fs/read_write.c:1308
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
RIP: 0033:0x7fa4e6e7c959
Code: 28 00 00 00 75 05 48 83 c4 28 c3 e8 e1 20 00 00 90 48 89 f8 48 89 f7 48 89 d6 48 89 ca 4d 89 c2 4d 89 c8 4c 8b 4c 24 08 0f 05 <48> 3d 01 f0 ff ff 73 01 c3 48 c7 c1 b0 ff ff ff f7 d8 64 89 01 48
RSP: 002b:00007fa4e7c600c8 EFLAGS: 00000246 ORIG_RAX: 0000000000000028
RAX: ffffffffffffffda RBX: 00007fa4e6f9c050 RCX: 00007fa4e6e7c959
RDX: 0000000000000000 RSI: 0000000000000007 RDI: 0000000000000005
RBP: 00007fa4e6ed8c88 R08: 0000000000000000 R09: 0000000000000000
R10: 0000000100000001 R11: 0000000000000246 R12: 0000000000000000
R13: 000000000000006e R14: 00007fa4e6f9c050 R15: 00007ffce58c34a8
</TASK>

Allocated by task 5404:
kasan_save_stack+0x20/0x40 mm/kasan/common.c:45
kasan_set_track+0x25/0x30 mm/kasan/common.c:52
__kasan_slab_alloc+0x81/0x90 mm/kasan/common.c:328
kasan_slab_alloc include/linux/kasan.h:186 [inline]
slab_post_alloc_hook mm/slab.h:762 [inline]
slab_alloc_node mm/slub.c:3470 [inline]
slab_alloc mm/slub.c:3478 [inline]
__kmem_cache_alloc_lru mm/slub.c:3485 [inline]
kmem_cache_alloc+0x169/0x3b0 mm/slub.c:3494
getname_flags.part.0+0x50/0x4d0 fs/namei.c:140
getname_flags include/linux/audit.h:319 [inline]
getname+0x90/0xe0 fs/namei.c:219
do_sys_openat2+0xe6/0x1c0 fs/open.c:1401
do_sys_open fs/open.c:1422 [inline]
__do_sys_openat fs/open.c:1438 [inline]
__se_sys_openat fs/open.c:1433 [inline]
__x64_sys_openat+0x175/0x210 fs/open.c:1433
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

The buggy address belongs to the object at ffff888022c82200
which belongs to the cache names_cache of size 4096
The buggy address is located 130 bytes to the right of
allocated 4096-byte region [ffff888022c82200, ffff888022c83200)

The buggy address belongs to the physical page:
page:ffffea00008b2000 refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x22c80
head:ffffea00008b2000 order:3 entire_mapcount:0 nr_pages_mapped:0 pincount:0
anon flags: 0xfff00000010200(slab|head|node=0|zone=1|lastcpupid=0x7ff)
page_type: 0xffffffff()
raw: 00fff00000010200 ffff888014675640 0000000000000000 dead000000000001
raw: 0000000000000000 0000000000070007 00000001ffffffff 0000000000000000
page dumped because: kasan: bad access detected
page_owner tracks the page as allocated
page last allocated via order 3, migratetype Unmovable, gfp_mask 0xd20c0(__GFP_IO|__GFP_FS|__GFP_NOWARN|__GFP_NORETRY|__GFP_COMP|__GFP_NOMEMALLOC), pid 4976, tgid 4976 (dhcpcd-run-hook), ts 34232111308, free_ts 34204262065
set_page_owner include/linux/page_owner.h:31 [inline]
post_alloc_hook+0x2d2/0x350 mm/page_alloc.c:1569
prep_new_page mm/page_alloc.c:1576 [inline]
get_page_from_freelist+0x10d7/0x3190 mm/page_alloc.c:3256
__alloc_pages+0x1c8/0x4a0 mm/page_alloc.c:4512
alloc_pages+0x1a9/0x270 mm/mempolicy.c:2279
alloc_slab_page mm/slub.c:1862 [inline]
allocate_slab+0x24e/0x380 mm/slub.c:2009
new_slab mm/slub.c:2062 [inline]
___slab_alloc+0x889/0x1530 mm/slub.c:3215
__slab_alloc.constprop.0+0x56/0xa0 mm/slub.c:3314
__slab_alloc_node mm/slub.c:3367 [inline]
slab_alloc_node mm/slub.c:3460 [inline]
slab_alloc mm/slub.c:3478 [inline]
__kmem_cache_alloc_lru mm/slub.c:3485 [inline]
kmem_cache_alloc+0x389/0x3b0 mm/slub.c:3494
getname_flags.part.0+0x50/0x4d0 fs/namei.c:140
getname_flags+0x9c/0xf0 include/linux/audit.h:319
vfs_fstatat+0x77/0xb0 fs/stat.c:275
__do_sys_newfstatat+0x86/0x100 fs/stat.c:446
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:1160 [inline]
free_unref_page_prepare+0x508/0xb90 mm/page_alloc.c:2383
free_unref_page+0x33/0x3b0 mm/page_alloc.c:2478
__unfreeze_partials+0x1fb/0x210 mm/slub.c:2647
qlink_free mm/kasan/quarantine.c:166 [inline]
qlist_free_all+0x6a/0x170 mm/kasan/quarantine.c:185
kasan_quarantine_reduce+0x18b/0x1d0 mm/kasan/quarantine.c:292
__kasan_slab_alloc+0x65/0x90 mm/kasan/common.c:305
kasan_slab_alloc include/linux/kasan.h:186 [inline]
slab_post_alloc_hook mm/slab.h:762 [inline]
slab_alloc_node mm/slub.c:3470 [inline]
slab_alloc mm/slub.c:3478 [inline]
__kmem_cache_alloc_lru mm/slub.c:3485 [inline]
kmem_cache_alloc+0x169/0x3b0 mm/slub.c:3494
getname_flags.part.0+0x50/0x4d0 fs/namei.c:140
getname_flags+0x9c/0xf0 include/linux/audit.h:319
vfs_fstatat+0x77/0xb0 fs/stat.c:275
__do_sys_newfstatat+0x86/0x100 fs/stat.c:446
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:
ffff888022c83180: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
ffff888022c83200: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
>ffff888022c83280: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
^
ffff888022c83300: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
ffff888022c83380: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
==================================================================


Tested on:

commit: 123212f5 Add linux-next specific files for 20230707
git tree: https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git
console output: https://syzkaller.appspot.com/x/log.txt?x=10059724e80000
kernel config: https://syzkaller.appspot.com/x/.config?x=aea084cf48368cf0
dashboard link: https://syzkaller.appspot.com/bug?extid=0b7937459742a0a4cffd
compiler: gcc (Debian 12.2.0-14) 12.2.0, GNU ld (GNU Binutils for Debian) 2.40
patch: https://syzkaller.appspot.com/x/patch.diff?x=116bcb5ce80000

2024-03-02 15:19:20

by syzbot

[permalink] [raw]
Subject: Re: [syzbot] [udf?] KASAN: slab-use-after-free Read in udf_free_blocks

syzbot suspects this issue was fixed by commit:

commit 6f861765464f43a71462d52026fbddfc858239a5
Author: Jan Kara <[email protected]>
Date: Wed Nov 1 17:43:10 2023 +0000

fs: Block writes to mounted block devices

bisection log: https://syzkaller.appspot.com/x/bisect.txt?x=11030516180000
start commit: f8dba31b0a82 Merge tag 'asym-keys-fix-for-linus-v6.4-rc5' ..
git tree: upstream
kernel config: https://syzkaller.appspot.com/x/.config?x=3c980bfe8b399968
dashboard link: https://syzkaller.appspot.com/bug?extid=0b7937459742a0a4cffd
syz repro: https://syzkaller.appspot.com/x/repro.syz?x=10bcb6b5280000
C reproducer: https://syzkaller.appspot.com/x/repro.c?x=12fbcfd1280000

If the result looks correct, please mark the issue as fixed by replying with:

#syz fix: fs: Block writes to mounted block devices

For information about bisection process see: https://goo.gl/tpsmEJ#bisection

2024-03-11 09:25:37

by Jan Kara

[permalink] [raw]
Subject: Re: [syzbot] [udf?] KASAN: slab-use-after-free Read in udf_free_blocks

On Sat 02-03-24 07:19:04, syzbot wrote:
> syzbot suspects this issue was fixed by commit:
>
> commit 6f861765464f43a71462d52026fbddfc858239a5
> Author: Jan Kara <[email protected]>
> Date: Wed Nov 1 17:43:10 2023 +0000
>
> fs: Block writes to mounted block devices
>
> bisection log: https://syzkaller.appspot.com/x/bisect.txt?x=11030516180000
> start commit: f8dba31b0a82 Merge tag 'asym-keys-fix-for-linus-v6.4-rc5' ..
> git tree: upstream
> kernel config: https://syzkaller.appspot.com/x/.config?x=3c980bfe8b399968
> dashboard link: https://syzkaller.appspot.com/bug?extid=0b7937459742a0a4cffd
> syz repro: https://syzkaller.appspot.com/x/repro.syz?x=10bcb6b5280000
> C reproducer: https://syzkaller.appspot.com/x/repro.c?x=12fbcfd1280000
>
> If the result looks correct, please mark the issue as fixed by replying with:

Looks good.

#syz fix: fs: Block writes to mounted block devices

Honza
--
Jan Kara <[email protected]>
SUSE Labs, CR