KASAN: use-after-free Read in relay_switch_subbuf (2)

10 views
Skip to first unread message

syzbot

unread,
Oct 17, 2021, 2:33:24 PM10/17/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=12d68244b00000
kernel config: https://syzkaller.appspot.com/x/.config?x=9b9277b418617afe
dashboard link: https://syzkaller.appspot.com/bug?extid=1a4f3a6cd1e92ae4ef9d
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+1a4f3a...@syzkaller.appspotmail.com

==================================================================
BUG: KASAN: use-after-free in d_inode include/linux/dcache.h:516 [inline]
BUG: KASAN: use-after-free in relay_switch_subbuf+0x8cc/0x940 kernel/relay.c:761
Read of size 8 at addr ffff88808e4a84b8 by task syz-executor.5/31194

CPU: 0 PID: 31194 Comm: syz-executor.5 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_load8_noabort+0x88/0x90 mm/kasan/report.c:433
d_inode include/linux/dcache.h:516 [inline]
relay_switch_subbuf+0x8cc/0x940 kernel/relay.c:761
relay_reserve include/linux/relay.h:261 [inline]
trace_note+0x5eb/0x750 kernel/trace/blktrace.c:96
trace_note_tsk kernel/trace/blktrace.c:127 [inline]
__blk_add_trace+0xb86/0xe20 kernel/trace/blktrace.c:267
blk_add_trace_plug+0xfe/0x240 kernel/trace/blktrace.c:1000
trace_block_plug include/trace/events/block.h:456 [inline]
blk_mq_make_request+0x14b7/0x1c00 block/blk-mq.c:1902
generic_make_request+0x613/0xdf0 block/blk-core.c:2467
submit_bio+0xb1/0x430 block/blk-core.c:2576
metapage_writepage+0x87a/0xd10 fs/jfs/jfs_metapage.c:452
__writepage+0x5e/0xe0 mm/page-writeback.c:2305
write_cache_pages+0x802/0x12d0 mm/page-writeback.c:2240
generic_writepages mm/page-writeback.c:2329 [inline]
generic_writepages mm/page-writeback.c:2318 [inline]
do_writepages+0x1dd/0x290 mm/page-writeback.c:2346
__filemap_fdatawrite_range+0x27d/0x350 mm/filemap.c:446
__filemap_fdatawrite mm/filemap.c:454 [inline]
filemap_fdatawrite mm/filemap.c:459 [inline]
filemap_write_and_wait mm/filemap.c:640 [inline]
filemap_write_and_wait+0x42/0xd0 mm/filemap.c:635
diSync+0x48d/0x5e0 fs/jfs/jfs_imap.c:263
diUnmount+0xba/0x120 fs/jfs/jfs_imap.c:200
jfs_umount+0xce/0x310 fs/jfs/jfs_umount.c:76
jfs_put_super+0x61/0x140 fs/jfs/super.c:223
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:0x7f3410fdbf6a
Code: 48 c7 c2 bc ff ff ff f7 d8 64 89 02 b8 ff ff ff ff eb d2 e8 b8 04 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 bc ff ff ff f7 d8 64 89 01 48
RSP: 002b:00007f340e54ffa8 EFLAGS: 00000206 ORIG_RAX: 00000000000000a5
RAX: ffffffffffffffec RBX: 0000000020000200 RCX: 00007f3410fdbf6a
RDX: 0000000020000000 RSI: 0000000020000100 RDI: 00007f340e550000
RBP: 00007f340e550040 R08: 00007f340e550040 R09: 0000000020000000
R10: 0000000000000000 R11: 0000000000000206 R12: 0000000020000000
R13: 0000000020000100 R14: 00007f340e550000 R15: 0000000020064f00

Allocated by task 23199:
kmem_cache_alloc+0x122/0x370 mm/slab.c:3559
__d_alloc+0x2b/0xa10 fs/dcache.c:1612
d_alloc+0x4a/0x230 fs/dcache.c:1696
d_alloc_parallel+0xeb/0x19e0 fs/dcache.c:2443
__lookup_slow+0x18d/0x4a0 fs/namei.c:1655
lookup_slow fs/namei.c:1689 [inline]
walk_component+0x7ac/0xda0 fs/namei.c:1811
link_path_walk.part.0+0x541/0x1230 fs/namei.c:2139
link_path_walk fs/namei.c:2073 [inline]
path_openat+0x1db/0x2df0 fs/namei.c:3536
do_filp_open+0x18c/0x3f0 fs/namei.c:3567
do_sys_open+0x3b3/0x520 fs/open.c:1085
do_syscall_64+0xf9/0x620 arch/x86/entry/common.c:293
entry_SYSCALL_64_after_hwframe+0x49/0xbe

Freed by task 22705:
__cache_free mm/slab.c:3503 [inline]
kmem_cache_free+0x7f/0x260 mm/slab.c:3765
__rcu_reclaim kernel/rcu/rcu.h:236 [inline]
rcu_do_batch kernel/rcu/tree.c:2584 [inline]
invoke_rcu_callbacks kernel/rcu/tree.c:2897 [inline]
__rcu_process_callbacks kernel/rcu/tree.c:2864 [inline]
rcu_process_callbacks+0x8ff/0x18b0 kernel/rcu/tree.c:2881
__do_softirq+0x265/0x980 kernel/softirq.c:292

The buggy address belongs to the object at ffff88808e4a8460
which belongs to the cache dentry of size 288
The buggy address is located 88 bytes inside of
288-byte region [ffff88808e4a8460, ffff88808e4a8580)
The buggy address belongs to the page:
page:ffffea0002392a00 count:1 mapcount:0 mapping:ffff88813be45200 index:0xffff88808e4a89e0
flags: 0xfff00000000100(slab)
raw: 00fff00000000100 ffffea0002b70ac8 ffffea0002399348 ffff88813be45200
raw: ffff88808e4a89e0 ffff88808e4a8040 0000000100000006 0000000000000000
page dumped because: kasan: bad access detected

Memory state around the buggy address:
ffff88808e4a8380: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
ffff88808e4a8400: fb fb fb fb fc fc fc fc fc fc fc fc fb fb fb fb
>ffff88808e4a8480: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
^
ffff88808e4a8500: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
ffff88808e4a8580: fc fc fc fc fc fc fc fc 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 syzk...@googlegroups.com.

syzbot will keep track of this issue. See:
https://goo.gl/tpsmEJ#status for how to communicate with syzbot.
Reply all
Reply to author
Forward
0 new messages