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=13b96393880000
kernel config:
https://syzkaller.appspot.com/x/.config?x=9b9277b418617afe
dashboard link:
https://syzkaller.appspot.com/bug?extid=ec97370b548269aab5ab
compiler: gcc version 10.2.1 20210110 (Debian 10.2.1-6)
Unfortunately, I don't have any reproducer for this issue yet.
Downloadable assets:
disk image:
https://storage.googleapis.com/syzbot-assets/98c0bdb4abb3/disk-3f8a27f9.raw.xz
vmlinux:
https://storage.googleapis.com/syzbot-assets/ea228ff02669/vmlinux-3f8a27f9.xz
IMPORTANT: if you fix the issue, please add the following tag to the commit:
Reported-by:
syzbot+ec9737...@syzkaller.appspotmail.com
XFS (loop1): Unmounting Filesystem
==================================================================
BUG: KASAN: use-after-free in rht_key_hashfn include/linux/rhashtable.h:132 [inline]
BUG: KASAN: use-after-free in rht_head_hashfn include/linux/rhashtable.h:147 [inline]
BUG: KASAN: use-after-free in __rhashtable_remove_fast_one include/linux/rhashtable.h:882 [inline]
BUG: KASAN: use-after-free in __rhashtable_remove_fast include/linux/rhashtable.h:962 [inline]
BUG: KASAN: use-after-free in rhashtable_remove_fast include/linux/rhashtable.h:991 [inline]
BUG: KASAN: use-after-free in xfs_buf_rele+0x147b/0x1540 fs/xfs/xfs_buf.c:1086
Read of size 4 at addr ffff88809d20accc by task syz-executor.0/11302
CPU: 0 PID: 11302 Comm: syz-executor.0 Not tainted 4.19.211-syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 10/26/2022
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_load4_noabort+0x88/0x90 mm/kasan/report.c:432
rht_key_hashfn include/linux/rhashtable.h:132 [inline]
rht_head_hashfn include/linux/rhashtable.h:147 [inline]
__rhashtable_remove_fast_one include/linux/rhashtable.h:882 [inline]
__rhashtable_remove_fast include/linux/rhashtable.h:962 [inline]
rhashtable_remove_fast include/linux/rhashtable.h:991 [inline]
xfs_buf_rele+0x147b/0x1540 fs/xfs/xfs_buf.c:1086
xfs_buftarg_shrink_scan+0x1bc/0x2c0 fs/xfs/xfs_buf.c:1753
do_shrink_slab+0x397/0xa40 mm/vmscan.c:537
shrink_slab+0x16f/0x550 mm/vmscan.c:693
drop_slab_node+0x33/0x70 mm/vmscan.c:724
drop_slab+0x4b/0x90 mm/vmscan.c:734
drop_caches_sysctl_handler+0xf6/0x110 fs/drop_caches.c:65
proc_sys_call_handler.isra.0+0x1f3/0x3b0 fs/proc/proc_sysctl.c:597
__vfs_write+0xf7/0x770 fs/read_write.c:485
__kernel_write+0x109/0x370 fs/read_write.c:506
write_pipe_buf+0x153/0x1f0 fs/splice.c:798
splice_from_pipe_feed fs/splice.c:503 [inline]
__splice_from_pipe+0x389/0x800 fs/splice.c:627
splice_from_pipe fs/splice.c:662 [inline]
default_file_splice_write+0xd8/0x180 fs/splice.c:810
do_splice_from fs/splice.c:852 [inline]
direct_splice_actor+0x115/0x160 fs/splice.c:1025
splice_direct_to_actor+0x33f/0x8d0 fs/splice.c:980
do_splice_direct+0x1a7/0x270 fs/splice.c:1068
do_sendfile+0x550/0xc30 fs/read_write.c:1447
__do_sys_sendfile64 fs/read_write.c:1502 [inline]
__se_sys_sendfile64+0xc4/0x160 fs/read_write.c:1494
do_syscall_64+0xf9/0x620 arch/x86/entry/common.c:293
entry_SYSCALL_64_after_hwframe+0x49/0xbe
RIP: 0033:0x7f6b6c50d0d9
Code: 28 00 00 00 75 05 48 83 c4 28 c3 e8 f1 19 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:00007f6b6aa7f168 EFLAGS: 00000246 ORIG_RAX: 0000000000000028
RAX: ffffffffffffffda RBX: 00007f6b6c62cf80 RCX: 00007f6b6c50d0d9
RDX: 0000000020002080 RSI: 0000000000000004 RDI: 0000000000000005
RBP: 00007f6b6c568ae9 R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000870 R11: 0000000000000246 R12: 0000000000000000
R13: 00007ffc16859e8f R14: 00007f6b6aa7f300 R15: 0000000000022000
Allocated by task 11242:
__do_kmalloc_node mm/slab.c:3689 [inline]
__kmalloc_node+0x4c/0x70 mm/slab.c:3696
kmalloc_node include/linux/slab.h:557 [inline]
kvmalloc_node+0x61/0xf0 mm/util.c:423
kvmalloc include/linux/mm.h:577 [inline]
kvzalloc include/linux/mm.h:585 [inline]
bucket_table_alloc+0x3a/0x440 lib/rhashtable.c:176
rhashtable_init+0x3bc/0x810 lib/rhashtable.c:1069
xfs_initialize_perag+0x1a9/0x4e0 fs/xfs/xfs_mount.c:207
xfs_mountfs+0xbfa/0x1bf0 fs/xfs/xfs_mount.c:862
xfs_fs_fill_super+0xd0e/0x1540 fs/xfs/xfs_super.c:1720
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
vfs_kern_mount fs/namespace.c:951 [inline]
do_new_mount fs/namespace.c:2492 [inline]
do_mount+0x115c/0x2f50 fs/namespace.c:2822
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
Freed by task 8145:
__cache_free mm/slab.c:3503 [inline]
kfree+0xcc/0x210 mm/slab.c:3822
kvfree+0x59/0x60 mm/util.c:452
rhashtable_free_and_destroy+0x15e/0x970 lib/rhashtable.c:1167
xfs_free_perag+0xab/0x120 fs/xfs/xfs_mount.c:152
xfs_unmountfs+0x1d0/0x2b0 fs/xfs/xfs_mount.c:1180
xfs_fs_put_super+0x62/0x130 fs/xfs/xfs_super.c:1774
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
The buggy address belongs to the object at ffff88809d20acc0
which belongs to the cache kmalloc-512 of size 512
The buggy address is located 12 bytes inside of
512-byte region [ffff88809d20acc0, ffff88809d20aec0)
The buggy address belongs to the page:
page:ffffea0002748280 count:1 mapcount:0 mapping:ffff88813bff0940 index:0x0
flags: 0xfff00000000100(slab)
raw: 00fff00000000100 ffffea000294f908 ffffea00025a1b48 ffff88813bff0940
raw: 0000000000000000 ffff88809d20a040 0000000100000006 0000000000000000
page dumped because: kasan: bad access detected
Memory state around the buggy address:
ffff88809d20ab80: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
ffff88809d20ac00: fb fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc
>ffff88809d20ac80: fc fc fc fc fc fc fc fc fb fb fb fb fb fb fb fb
^
ffff88809d20ad00: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
ffff88809d20ad80: 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
syzk...@googlegroups.com.
syzbot will keep track of this issue. See:
https://goo.gl/tpsmEJ#status for how to communicate with syzbot.