KASAN: use-after-free Read in dbNextAG

11 views
Skip to first unread message

syzbot

unread,
Sep 24, 2022, 9:19:36 PM9/24/22
to syzkaller...@googlegroups.com
Hello,

syzbot found the following issue on:

HEAD commit: 4edbf74132a4 Linux 4.14.294
git tree: linux-4.14.y
console output: https://syzkaller.appspot.com/x/log.txt?x=160bdf18880000
kernel config: https://syzkaller.appspot.com/x/.config?x=94d4cf9c4e23980f
dashboard link: https://syzkaller.appspot.com/bug?extid=a679e589b848dbf6fc9c
compiler: gcc version 10.2.1 20210110 (Debian 10.2.1-6)
syz repro: https://syzkaller.appspot.com/x/repro.syz?x=16c231ef080000
C reproducer: https://syzkaller.appspot.com/x/repro.c?x=152e0d74880000

Downloadable assets:
disk image: https://storage.googleapis.com/b40da19b4827/disk-4edbf741.raw.xz
vmlinux: https://storage.googleapis.com/a36e39677c18/vmlinux-4edbf741.xz

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

==================================================================
BUG: KASAN: use-after-free in __read_once_size include/linux/compiler.h:185 [inline]
BUG: KASAN: use-after-free in atomic_read arch/x86/include/asm/atomic.h:27 [inline]
BUG: KASAN: use-after-free in dbNextAG+0x2ff/0x370 fs/jfs/jfs_dmap.c:630
Read of size 4 at addr ffff8881bf92ee80 by task syz-executor176/8001

CPU: 1 PID: 8001 Comm: syz-executor176 Not tainted 4.14.294-syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 08/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_load4_noabort+0x68/0x70 mm/kasan/report.c:429
__read_once_size include/linux/compiler.h:185 [inline]
atomic_read arch/x86/include/asm/atomic.h:27 [inline]
dbNextAG+0x2ff/0x370 fs/jfs/jfs_dmap.c:630
diAlloc+0x87a/0x1230 fs/jfs/jfs_imap.c:1386
ialloc+0x7b/0x940 fs/jfs/jfs_inode.c:70
jfs_mkdir.part.0+0xfd/0x7e0 fs/jfs/namei.c:238
jfs_mkdir+0x35/0x50 fs/jfs/namei.c:223
vfs_mkdir+0x463/0x6e0 fs/namei.c:3851
SYSC_mkdirat fs/namei.c:3874 [inline]
SyS_mkdirat+0x1fd/0x270 fs/namei.c:3858
do_syscall_64+0x1d5/0x640 arch/x86/entry/common.c:292
entry_SYSCALL_64_after_hwframe+0x46/0xbb
RIP: 0033:0x7f4965e24397
RSP: 002b:00007ffe5a546848 EFLAGS: 00000246 ORIG_RAX: 0000000000000053
RAX: ffffffffffffffda RBX: 00007ffe5a5468f0 RCX: 00007f4965e24397
RDX: 0000000000000000 RSI: 00000000000001ff RDI: 00000000200001c0
RBP: 00000000ffffffff R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000
R13: 00000000ffffffff R14: 00000000200001c0 R15: 0000000000000000

The buggy address belongs to the page:
page:ffffea0006fe4b80 count:0 mapcount:0 mapping: (null) index:0x0
flags: 0x57ff00000000000()
raw: 057ff00000000000 0000000000000000 0000000000000000 00000000ffffffff
raw: ffffea0006fe4ba0 ffffea0006fe4ba0 0000000000000000 0000000000000000
page dumped because: kasan: bad access detected

Memory state around the buggy address:
ffff8881bf92ed80: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
ffff8881bf92ee00: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
>ffff8881bf92ee80: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
^
ffff8881bf92ef00: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
ffff8881bf92ef80: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
==================================================================


---
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

syzbot

unread,
Sep 24, 2022, 9:19:36 PM9/24/22
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=166f5d60880000
kernel config: https://syzkaller.appspot.com/x/.config?x=9b9277b418617afe
dashboard link: https://syzkaller.appspot.com/bug?extid=d83a549f8d8f79ed75f9
compiler: gcc version 10.2.1 20210110 (Debian 10.2.1-6)
syz repro: https://syzkaller.appspot.com/x/repro.syz?x=150fc12f080000
C reproducer: https://syzkaller.appspot.com/x/repro.c?x=17585e40880000

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

==================================================================
BUG: KASAN: use-after-free in atomic_read include/asm-generic/atomic-instrumented.h:21 [inline]
BUG: KASAN: use-after-free in dbNextAG+0x14f/0x530 fs/jfs/jfs_dmap.c:622
Read of size 4 at addr ffff8881b8cbac80 by task syz-executor408/8078

CPU: 1 PID: 8078 Comm: syz-executor408 Not tainted 4.19.211-syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 08/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+0x8f/0xa0 mm/kasan/report.c:412
atomic_read include/asm-generic/atomic-instrumented.h:21 [inline]
dbNextAG+0x14f/0x530 fs/jfs/jfs_dmap.c:622
diAlloc+0x7ea/0x1440 fs/jfs/jfs_imap.c:1380
ialloc+0x8c/0x970 fs/jfs/jfs_inode.c:69
jfs_mkdir.part.0+0x131/0x870 fs/jfs/namei.c:237
jfs_mkdir+0x3f/0x60 fs/jfs/namei.c:222
vfs_mkdir+0x508/0x7a0 fs/namei.c:3819
do_mkdirat+0x262/0x2d0 fs/namei.c:3842
do_syscall_64+0xf9/0x620 arch/x86/entry/common.c:293
entry_SYSCALL_64_after_hwframe+0x49/0xbe
RIP: 0033:0x7faa817d7397
Code: ff ff ff ff c3 66 0f 1f 44 00 00 48 c7 c0 c0 ff ff ff 64 c7 00 16 00 00 00 b8 ff ff ff ff c3 0f 1f 40 00 b8 53 00 00 00 0f 05 <48> 3d 01 f0 ff ff 73 01 c3 48 c7 c1 c0 ff ff ff f7 d8 64 89 01 48
RSP: 002b:00007ffedfbfe818 EFLAGS: 00000246 ORIG_RAX: 0000000000000053
RAX: ffffffffffffffda RBX: 00007ffedfbfe8c0 RCX: 00007faa817d7397
RDX: 0000000000000000 RSI: 00000000000001ff RDI: 00000000200001c0
RBP: 00000000ffffffff R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000
R13: 00000000ffffffff R14: 00000000200001c0 R15: 0000000000000000

The buggy address belongs to the page:
page:ffffea0006e32e80 count:0 mapcount:0 mapping:0000000000000000 index:0x0
flags: 0x57ff00000000000()
raw: 057ff00000000000 ffffea0006e32e88 ffffea0006e32e88 0000000000000000
raw: 0000000000000000 0000000000000000 00000000ffffffff 0000000000000000
page dumped because: kasan: bad access detected

Memory state around the buggy address:
ffff8881b8cbab80: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
ffff8881b8cbac00: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
>ffff8881b8cbac80: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
^
ffff8881b8cbad00: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
ffff8881b8cbad80: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
Reply all
Reply to author
Forward
0 new messages