KASAN: double-free or invalid-free in 0xea0

4 views
Skip to first unread message

syzbot

unread,
Dec 4, 2022, 5:03:50 PM12/4/22
to syzkaller...@googlegroups.com
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=1094d2cb880000
kernel config: https://syzkaller.appspot.com/x/.config?x=aa85f51ec321d5a9
dashboard link: https://syzkaller.appspot.com/bug?extid=64d44843607c5f708c0d
compiler: gcc version 10.2.1 20210110 (Debian 10.2.1-6)
syz repro: https://syzkaller.appspot.com/x/repro.syz?x=135779d5880000
C reproducer: https://syzkaller.appspot.com/x/repro.c?x=1074964d880000

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/e7a6256aafc1/mount_0.gz

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

SYSC_mount fs/namespace.c:3121 [inline]
SyS_mount+0xa8/0x120 fs/namespace.c:3098
do_syscall_64+0x1d5/0x640 arch/x86/entry/common.c:292
entry_SYSCALL_64_after_hwframe+0x5e/0xd3
==================================================================
BUG: KASAN: double-free or invalid-free in 0xea0

CPU: 0 PID: 7971 Comm: syz-executor188 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_double_free+0x51/0x80 mm/kasan/report.c:333
kasan_slab_free+0x16f/0x1a0 mm/kasan/kasan.c:514
__cache_free mm/slab.c:3496 [inline]
kfree+0xc9/0x250 mm/slab.c:3815
dbUnmount+0xf2/0x130 fs/jfs/jfs_dmap.c:262
jfs_umount+0x1cc/0x310 fs/jfs/jfs_umount.c:102
jfs_put_super+0x61/0x140 fs/jfs/super.c:223
generic_shutdown_super+0x144/0x370 fs/super.c:446
kill_block_super+0x95/0xe0 fs/super.c:1161
deactivate_locked_super+0x6c/0xd0 fs/super.c:319
deactivate_super+0x7f/0xa0 fs/super.c:350
cleanup_mnt+0x186/0x2c0 fs/namespace.c:1183
task_work_run+0x11f/0x190 kernel/task_work.c:113
tracehook_notify_resume include/linux/tracehook.h:191 [inline]
exit_to_usermode_loop+0x1ad/0x200 arch/x86/entry/common.c:164
prepare_exit_to_usermode arch/x86/entry/common.c:199 [inline]
syscall_return_slowpath arch/x86/entry/common.c:270 [inline]
do_syscall_64+0x4a3/0x640 arch/x86/entry/common.c:297
entry_SYSCALL_64_after_hwframe+0x5e/0xd3

Allocated by task 7972:
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
kmem_cache_alloc_trace+0x131/0x3d0 mm/slab.c:3618
kmalloc include/linux/slab.h:488 [inline]
dbMount+0x4d/0x8b0 fs/jfs/jfs_dmap.c:177
jfs_mount+0x110/0x380 fs/jfs/jfs_mount.c:133
jfs_fill_super+0x52a/0xab0 fs/jfs/super.c:589
mount_bdev+0x2b3/0x360 fs/super.c:1134
mount_fs+0x92/0x2a0 fs/super.c:1237
vfs_kern_mount.part.0+0x5b/0x470 fs/namespace.c:1046
vfs_kern_mount fs/namespace.c:1036 [inline]
do_new_mount fs/namespace.c:2572 [inline]
do_mount+0xe65/0x2a30 fs/namespace.c:2905
SYSC_mount fs/namespace.c:3121 [inline]
SyS_mount+0xa8/0x120 fs/namespace.c:3098
do_syscall_64+0x1d5/0x640 arch/x86/entry/common.c:292
entry_SYSCALL_64_after_hwframe+0x5e/0xd3

Freed by task 7972:
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
dbUnmount+0xf2/0x130 fs/jfs/jfs_dmap.c:262
jfs_mount_rw+0x1fe/0x430 fs/jfs/jfs_mount.c:255
jfs_remount+0x47c/0x5a0 fs/jfs/super.c:488
do_remount_sb+0x150/0x530 fs/super.c:868
do_remount fs/namespace.c:2393 [inline]
do_mount+0x15f3/0x2a30 fs/namespace.c:2896
SYSC_mount fs/namespace.c:3121 [inline]
SyS_mount+0xa8/0x120 fs/namespace.c:3098
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 ffff8880b3230e80
which belongs to the cache kmalloc-2048 of size 2048
The buggy address is located 0 bytes inside of
2048-byte region [ffff8880b3230e80, ffff8880b3231680)
The buggy address belongs to the page:
page:ffffea0002cc8c00 count:1 mapcount:0 mapping:ffff8880b3230600 index:0x0 compound_mapcount: 0
flags: 0xfff00000008100(slab|head)
raw: 00fff00000008100 ffff8880b3230600 0000000000000000 0000000100000003
raw: ffffea0002586020 ffffea0002561ea0 ffff88813fe74c40 0000000000000000
page dumped because: kasan: bad access detected

Memory state around the buggy address:
ffff8880b3230d80: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
ffff8880b3230e00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
>ffff8880b3230e80: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
^
ffff8880b3230f00: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
ffff8880b3230f80: 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.
syzbot can test patches for this issue, for details see:
https://goo.gl/tpsmEJ#testing-patches
Reply all
Reply to author
Forward
0 new messages