[v6.1] general protection fault in __xfs_free_extent

0 views
Skip to first unread message

syzbot

unread,
May 28, 2023, 4:42:51 AM5/28/23
to syzkaller...@googlegroups.com
Hello,

syzbot found the following issue on:

HEAD commit: a343b0dd87b4 Linux 6.1.30
git tree: linux-6.1.y
console output: https://syzkaller.appspot.com/x/log.txt?x=14e346b9280000
kernel config: https://syzkaller.appspot.com/x/.config?x=5265a3c898f3cbbb
dashboard link: https://syzkaller.appspot.com/bug?extid=cd9f520086be60323733
compiler: Debian clang version 15.0.7, GNU ld (GNU Binutils for Debian) 2.35.2

Unfortunately, I don't have any reproducer for this issue yet.

Downloadable assets:
disk image: https://storage.googleapis.com/syzbot-assets/195d974b1f1c/disk-a343b0dd.raw.xz
vmlinux: https://storage.googleapis.com/syzbot-assets/ea41850547fb/vmlinux-a343b0dd.xz
kernel image: https://storage.googleapis.com/syzbot-assets/13ec9e70ad28/bzImage-a343b0dd.xz

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

XFS (loop2): Ending clean mount
XFS (loop2): Quotacheck needed: Please wait.
XFS (loop2): Quotacheck: Done.
general protection fault, probably for non-canonical address 0xdffffc0000000001: 0000 [#1] PREEMPT SMP KASAN
KASAN: null-ptr-deref in range [0x0000000000000008-0x000000000000000f]
CPU: 0 PID: 27216 Comm: syz-executor.2 Not tainted 6.1.30-syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 05/25/2023
RIP: 0010:xfs_free_extent_fix_freelist fs/xfs/libxfs/xfs_alloc.c:3358 [inline]
RIP: 0010:__xfs_free_extent+0x1f6/0x610 fs/xfs/libxfs/xfs_alloc.c:3407
Code: 00 74 05 e8 fc c6 cf fe 4c 89 ac 24 88 00 00 00 4c 89 7c 24 08 49 8d 5f 08 48 89 d8 48 c1 e8 03 49 bf 00 00 00 00 00 fc ff df <42> 0f b6 04 38 84 c0 0f 85 06 03 00 00 44 8b 23 4c 8d b4 24 80 00
RSP: 0018:ffffc9000399f540 EFLAGS: 00010202
RAX: 0000000000000001 RBX: 0000000000000008 RCX: 0000000000000000
RDX: 0000000000000080 RSI: 0000000000000000 RDI: ffffc9000399f5c8
RBP: ffffc9000399f6f0 R08: dffffc0000000000 R09: ffffc9000399f5d0
R10: 0000000000000000 R11: dffffc0000000001 R12: 1ffff1101502c0e4
R13: ffff8880a411c000 R14: dffffc0000000000 R15: dffffc0000000000
FS: 00007f5d4b3ca700(0000) GS:ffff8880b9800000(0000) knlGS:0000000000000000
CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 0000000020105030 CR3: 000000001e4e7000 CR4: 00000000003506f0
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
Call Trace:
<TASK>
xfs_free_extent fs/xfs/libxfs/xfs_alloc.h:147 [inline]
xfs_ag_extend_space+0x397/0x5d0 fs/xfs/libxfs/xfs_ag.c:985
xfs_growfs_data_private fs/xfs/xfs_fsops.c:151 [inline]
xfs_growfs_data+0x9b2/0x11c0 fs/xfs/xfs_fsops.c:294
xfs_file_ioctl+0x1170/0x1700 fs/xfs/xfs_ioctl.c:2068
vfs_ioctl fs/ioctl.c:51 [inline]
__do_sys_ioctl fs/ioctl.c:870 [inline]
__se_sys_ioctl+0xf1/0x160 fs/ioctl.c:856
do_syscall_x64 arch/x86/entry/common.c:50 [inline]
do_syscall_64+0x3d/0xb0 arch/x86/entry/common.c:80
entry_SYSCALL_64_after_hwframe+0x63/0xcd
RIP: 0033:0x7f5d4a68c169
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:00007f5d4b3ca168 EFLAGS: 00000246 ORIG_RAX: 0000000000000010
RAX: ffffffffffffffda RBX: 00007f5d4a7abf80 RCX: 00007f5d4a68c169
RDX: 0000000020000540 RSI: 000000004010586e RDI: 0000000000000004
RBP: 00007f5d4a6e7ca1 R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000
R13: 00007ffecb4b858f R14: 00007f5d4b3ca300 R15: 0000000000022000
</TASK>
Modules linked in:
---[ end trace 0000000000000000 ]---
RIP: 0010:xfs_free_extent_fix_freelist fs/xfs/libxfs/xfs_alloc.c:3358 [inline]
RIP: 0010:__xfs_free_extent+0x1f6/0x610 fs/xfs/libxfs/xfs_alloc.c:3407
Code: 00 74 05 e8 fc c6 cf fe 4c 89 ac 24 88 00 00 00 4c 89 7c 24 08 49 8d 5f 08 48 89 d8 48 c1 e8 03 49 bf 00 00 00 00 00 fc ff df <42> 0f b6 04 38 84 c0 0f 85 06 03 00 00 44 8b 23 4c 8d b4 24 80 00
RSP: 0018:ffffc9000399f540 EFLAGS: 00010202
RAX: 0000000000000001 RBX: 0000000000000008 RCX: 0000000000000000
RDX: 0000000000000080 RSI: 0000000000000000 RDI: ffffc9000399f5c8
RBP: ffffc9000399f6f0 R08: dffffc0000000000 R09: ffffc9000399f5d0
R10: 0000000000000000 R11: dffffc0000000001 R12: 1ffff1101502c0e4
R13: ffff8880a411c000 R14: dffffc0000000000 R15: dffffc0000000000
FS: 00007f5d4b3ca700(0000) GS:ffff8880b9800000(0000) knlGS:0000000000000000
CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 00007f8ec8384558 CR3: 000000001e4e7000 CR4: 00000000003506f0
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
----------------
Code disassembly (best guess), 1 bytes skipped:
0: 74 05 je 0x7
2: e8 fc c6 cf fe callq 0xfecfc703
7: 4c 89 ac 24 88 00 00 mov %r13,0x88(%rsp)
e: 00
f: 4c 89 7c 24 08 mov %r15,0x8(%rsp)
14: 49 8d 5f 08 lea 0x8(%r15),%rbx
18: 48 89 d8 mov %rbx,%rax
1b: 48 c1 e8 03 shr $0x3,%rax
1f: 49 bf 00 00 00 00 00 movabs $0xdffffc0000000000,%r15
26: fc ff df
* 29: 42 0f b6 04 38 movzbl (%rax,%r15,1),%eax <-- trapping instruction
2e: 84 c0 test %al,%al
30: 0f 85 06 03 00 00 jne 0x33c
36: 44 8b 23 mov (%rbx),%r12d
39: 4c rex.WR
3a: 8d .byte 0x8d
3b: b4 24 mov $0x24,%ah
3d: 80 .byte 0x80


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

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

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

syzbot

unread,
May 28, 2023, 7:13:03 AM5/28/23
to syzkaller...@googlegroups.com
syzbot has found a reproducer for the following issue on:

HEAD commit: a343b0dd87b4 Linux 6.1.30
git tree: linux-6.1.y
console output: https://syzkaller.appspot.com/x/log.txt?x=146f29f5280000
kernel config: https://syzkaller.appspot.com/x/.config?x=5265a3c898f3cbbb
dashboard link: https://syzkaller.appspot.com/bug?extid=cd9f520086be60323733
compiler: Debian clang version 15.0.7, GNU ld (GNU Binutils for Debian) 2.35.2
syz repro: https://syzkaller.appspot.com/x/repro.syz?x=10183536280000
C reproducer: https://syzkaller.appspot.com/x/repro.c?x=139d8f6d280000
mounted in repro: https://storage.googleapis.com/syzbot-assets/9d6ae9f3df15/mount_0.gz

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

loop0: detected capacity change from 0 to 32768
XFS (loop0): Mounting V5 Filesystem
XFS (loop0): Ending clean mount
XFS (loop0): Quotacheck needed: Please wait.
XFS (loop0): Quotacheck: Done.
general protection fault, probably for non-canonical address 0xdffffc0000000001: 0000 [#1] PREEMPT SMP KASAN
KASAN: null-ptr-deref in range [0x0000000000000008-0x000000000000000f]
CPU: 1 PID: 3543 Comm: syz-executor274 Not tainted 6.1.30-syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 05/25/2023
RIP: 0010:xfs_free_extent_fix_freelist fs/xfs/libxfs/xfs_alloc.c:3358 [inline]
RIP: 0010:__xfs_free_extent+0x1f6/0x610 fs/xfs/libxfs/xfs_alloc.c:3407
Code: 00 74 05 e8 fc c6 cf fe 4c 89 ac 24 88 00 00 00 4c 89 7c 24 08 49 8d 5f 08 48 89 d8 48 c1 e8 03 49 bf 00 00 00 00 00 fc ff df <42> 0f b6 04 38 84 c0 0f 85 06 03 00 00 44 8b 23 4c 8d b4 24 80 00
RSP: 0018:ffffc9000393f540 EFLAGS: 00010202
RAX: 0000000000000001 RBX: 0000000000000008 RCX: 0000000000000000
RDX: 0000000000000080 RSI: 0000000000000000 RDI: ffffc9000393f5c8
RBP: ffffc9000393f6f0 R08: dffffc0000000000 R09: ffffc9000393f5d0
R10: 0000000000000000 R11: dffffc0000000001 R12: 1ffff1100e4e1650
R13: ffff88807be3a000 R14: dffffc0000000000 R15: dffffc0000000000
FS: 000055555706d300(0000) GS:ffff8880b9900000(0000) knlGS:0000000000000000
CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 00007f3b07d50b40 CR3: 000000001a394000 CR4: 00000000003506e0
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
Call Trace:
<TASK>
xfs_free_extent fs/xfs/libxfs/xfs_alloc.h:147 [inline]
xfs_ag_extend_space+0x397/0x5d0 fs/xfs/libxfs/xfs_ag.c:985
xfs_growfs_data_private fs/xfs/xfs_fsops.c:151 [inline]
xfs_growfs_data+0x9b2/0x11c0 fs/xfs/xfs_fsops.c:294
xfs_file_ioctl+0x1170/0x1700 fs/xfs/xfs_ioctl.c:2068
vfs_ioctl fs/ioctl.c:51 [inline]
__do_sys_ioctl fs/ioctl.c:870 [inline]
__se_sys_ioctl+0xf1/0x160 fs/ioctl.c:856
do_syscall_x64 arch/x86/entry/common.c:50 [inline]
do_syscall_64+0x3d/0xb0 arch/x86/entry/common.c:80
entry_SYSCALL_64_after_hwframe+0x63/0xcd
RIP: 0033:0x7f3b07d78959
Code: 28 00 00 00 75 05 48 83 c4 28 c3 e8 51 14 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 c0 ff ff ff f7 d8 64 89 01 48
RSP: 002b:00007ffc4d528fe8 EFLAGS: 00000246 ORIG_RAX: 0000000000000010
RAX: ffffffffffffffda RBX: 0030656c69662f2e RCX: 00007f3b07d78959
RDX: 0000000020000540 RSI: 000000004010586e RDI: 0000000000000004
RBP: 00007f3b07d381f0 R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000246 R12: 00007f3b07d38280
R13: 0000000000000000 R14: 0000000000000000 R15: 0000000000000000
</TASK>
Modules linked in:
---[ end trace 0000000000000000 ]---
RIP: 0010:xfs_free_extent_fix_freelist fs/xfs/libxfs/xfs_alloc.c:3358 [inline]
RIP: 0010:__xfs_free_extent+0x1f6/0x610 fs/xfs/libxfs/xfs_alloc.c:3407
Code: 00 74 05 e8 fc c6 cf fe 4c 89 ac 24 88 00 00 00 4c 89 7c 24 08 49 8d 5f 08 48 89 d8 48 c1 e8 03 49 bf 00 00 00 00 00 fc ff df <42> 0f b6 04 38 84 c0 0f 85 06 03 00 00 44 8b 23 4c 8d b4 24 80 00
RSP: 0018:ffffc9000393f540 EFLAGS: 00010202
RAX: 0000000000000001 RBX: 0000000000000008 RCX: 0000000000000000
RDX: 0000000000000080 RSI: 0000000000000000 RDI: ffffc9000393f5c8
RBP: ffffc9000393f6f0 R08: dffffc0000000000 R09: ffffc9000393f5d0
R10: 0000000000000000 R11: dffffc0000000001 R12: 1ffff1100e4e1650
R13: ffff88807be3a000 R14: dffffc0000000000 R15: dffffc0000000000
FS: 000055555706d300(0000) GS:ffff8880b9900000(0000) knlGS:0000000000000000
CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 00007f3b07d50b40 CR3: 000000001a394000 CR4: 00000000003506e0
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
----------------
Code disassembly (best guess), 1 bytes skipped:
0: 74 05 je 0x7
2: e8 fc c6 cf fe callq 0xfecfc703
7: 4c 89 ac 24 88 00 00 mov %r13,0x88(%rsp)
e: 00
f: 4c 89 7c 24 08 mov %r15,0x8(%rsp)
14: 49 8d 5f 08 lea 0x8(%r15),%rbx
18: 48 89 d8 mov %rbx,%rax
1b: 48 c1 e8 03 shr $0x3,%rax
1f: 49 bf 00 00 00 00 00 movabs $0xdffffc0000000000,%r15
26: fc ff df
* 29: 42 0f b6 04 38 movzbl (%rax,%r15,1),%eax <-- trapping instruction
2e: 84 c0 test %al,%al
30: 0f 85 06 03 00 00 jne 0x33c
36: 44 8b 23 mov (%rbx),%r12d
39: 4c rex.WR
3a: 8d .byte 0x8d
3b: b4 24 mov $0x24,%ah
3d: 80 .byte 0x80


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

syzbot

unread,
Nov 11, 2023, 1:06:06 AM11/11/23
to syzkaller...@googlegroups.com
syzbot suspects this issue could be fixed by backporting the following commit:

commit b2ccab3199aa7cea9154d80ea2585312c5f6eba0
git tree: upstream
Author: Darrick J. Wong <djw...@kernel.org>
Date: Wed Apr 12 01:59:53 2023 +0000

xfs: pass per-ag references to xfs_free_extent

bisection log: https://syzkaller.appspot.com/x/bisect.txt?x=11d4ef87680000
Please keep in mind that other backports might be required as well.

For information about bisection process see: https://goo.gl/tpsmEJ#bisection
Reply all
Reply to author
Forward
0 new messages