[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <CANypQFaxY=1aGi=F69+XRz8HakXoP3rarym55yPPvhpZFiQOeQ@mail.gmail.com>
Date: Mon, 19 Jan 2026 23:15:46 +0800
From: Jiaming Zhang <r772577952@...il.com>
To: cem@...nel.org, linux-xfs@...r.kernel.org
Cc: brauner@...nel.org, linux-kernel@...r.kernel.org, willy@...radead.org,
syzkaller@...glegroups.com
Subject: [Linux Kernel Bug] general protection fault in xfarray_destroy
Dear Linux kernel developers and maintainers,
We are writing to report a general protection fault discovered in the
xfs subsystem with our generated syzkaller specifications. This issue
is reproducible on the latest version of linux (v6.19-rc6, commit
24d479d26b25bce5faea3ddd9fa8f3a6c3129ea7).
The root cause of this issue is that in xfarray_destroy(), `array`
might be input as NULL, leading to a null pointer dereference. We can
fix this issue by adding a NULL check, e.g.
```
/* Destroy the array. */
void
xfarray_destroy(
struct xfarray *array)
{
+ if (!array)
+ return;
+
xfile_destroy(array->xfile);
kfree(array);
}
```
If this solution is acceptable, we are happy to submit a patch.
The kernel console output, kernel config, syzkaller reproducer, and C
reproducer are also attached to help with analysis. The KASAN report
from kernel, formatted by syz-symbolize, is listed below:
---
XFS (loop1): Mounting V5 Filesystem 9f91832a-3b79-45c3-9d6d-ed0bc7357fe4
XFS (loop1): Ending clean mount
Oops: general protection fault, probably for non-canonical address
0xdffffc0000000000: 0000 [#1] SMP KASAN NOPTI
KASAN: null-ptr-deref in range [0x0000000000000000-0x0000000000000007]
CPU: 0 UID: 0 PID: 11079 Comm: repro.out Not tainted 6.19.0-rc6 #5 PREEMPT(full)
Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS 1.15.0-1 04/01/2014
RIP: 0010:xfarray_destroy+0x1e/0x40 fs/xfs/scrub/xfarray.c:125
Code: 90 90 90 90 90 90 90 90 90 90 90 90 0f 1f 40 d6 53 48 89 fb e8
63 6d 34 fe 48 89 d8 48 c1 e8 03 48 b9 00 00 00 00 00 fc ff df <80> 3c
08 00 74 08 48 89 df e8 84 33 9c fe 48 8b 3b e8 9c 65 00 00
RSP: 0018:ffffc90004f37470 EFLAGS: 00010246
RAX: 0000000000000000 RBX: 0000000000000000 RCX: dffffc0000000000
RDX: 0000000000000000 RSI: 0000000000000008 RDI: 0000000000000000
RBP: ffffc90004f37530 R08: ffff8880213a51bf R09: 1ffff11004274a37
R10: dffffc0000000000 R11: ffffed1004274a38 R12: 00000000fffffff4
R13: 1ffff11009fe7400 R14: ffff88804ff3a008 R15: 1ffff11009fe7401
FS: 000000003ceb63c0(0000) GS:ffff888098fe0000(0000) knlGS:0000000000000000
CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 00005589c578eea0 CR3: 000000005c4d1000 CR4: 0000000000752ef0
PKRU: 55555554
Call Trace:
<TASK>
xchk_nlinks_teardown_scan fs/xfs/scrub/nlinks.c:974 [inline]
xchk_nlinks_setup_scan+0x320/0x480 fs/xfs/scrub/nlinks.c:1035
xchk_nlinks+0x93/0x290 fs/xfs/scrub/nlinks.c:1048
xfs_scrub_metadata+0xc08/0x1920 fs/xfs/scrub/scrub.c:-1
xfs_ioc_scrubv_metadata+0x74a/0xaf0 fs/xfs/scrub/scrub.c:981
xfs_file_ioctl+0x751/0x1560 fs/xfs/xfs_ioctl.c:1266
vfs_ioctl fs/ioctl.c:51 [inline]
__do_sys_ioctl fs/ioctl.c:597 [inline]
__se_sys_ioctl+0xfc/0x170 fs/ioctl.c:583
do_syscall_x64 arch/x86/entry/syscall_64.c:63 [inline]
do_syscall_64+0xe8/0xf80 arch/x86/entry/syscall_64.c:94
entry_SYSCALL_64_after_hwframe+0x77/0x7f
RIP: 0033:0x459b79
Code: 28 00 00 00 75 05 48 83 c4 28 c3 e8 01 18 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:00007fffaf305f38 EFLAGS: 00000246 ORIG_RAX: 0000000000000010
RAX: ffffffffffffffda RBX: 00000000004004a0 RCX: 0000000000459b79
RDX: 00002000000000c0 RSI: 00000000c0285840 RDI: 0000000000000004
RBP: 00007fffaf305fa0 R08: 00007fffaf305c86 R09: 0000000000000008
R10: 0000000000000000 R11: 0000000000000246 R12: 000000000040ac80
R13: 0000000000000000 R14: 00000000004c6018 R15: 00000000004004a0
</TASK>
Modules linked in:
---[ end trace 0000000000000000 ]---
RIP: 0010:xfarray_destroy+0x1e/0x40 fs/xfs/scrub/xfarray.c:125
Code: 90 90 90 90 90 90 90 90 90 90 90 90 0f 1f 40 d6 53 48 89 fb e8
63 6d 34 fe 48 89 d8 48 c1 e8 03 48 b9 00 00 00 00 00 fc ff df <80> 3c
08 00 74 08 48 89 df e8 84 33 9c fe 48 8b 3b e8 9c 65 00 00
RSP: 0018:ffffc90004f37470 EFLAGS: 00010246
RAX: 0000000000000000 RBX: 0000000000000000 RCX: dffffc0000000000
RDX: 0000000000000000 RSI: 0000000000000008 RDI: 0000000000000000
RBP: ffffc90004f37530 R08: ffff8880213a51bf R09: 1ffff11004274a37
R10: dffffc0000000000 R11: ffffed1004274a38 R12: 00000000fffffff4
R13: 1ffff11009fe7400 R14: ffff88804ff3a008 R15: 1ffff11009fe7401
FS: 000000003ceb63c0(0000) GS:ffff888098fe0000(0000) knlGS:0000000000000000
CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 00007fc0b8403e80 CR3: 000000005c4d1000 CR4: 0000000000752ef0
PKRU: 55555554
----------------
Code disassembly (best guess):
0: 90 nop
1: 90 nop
2: 90 nop
3: 90 nop
4: 90 nop
5: 90 nop
6: 90 nop
7: 90 nop
8: 90 nop
9: 90 nop
a: 90 nop
b: 90 nop
c: 0f 1f 40 d6 nopl -0x2a(%rax)
10: 53 push %rbx
11: 48 89 fb mov %rdi,%rbx
14: e8 63 6d 34 fe call 0xfe346d7c
19: 48 89 d8 mov %rbx,%rax
1c: 48 c1 e8 03 shr $0x3,%rax
20: 48 b9 00 00 00 00 00 movabs $0xdffffc0000000000,%rcx
27: fc ff df
* 2a: 80 3c 08 00 cmpb $0x0,(%rax,%rcx,1) <-- trapping
instruction
2e: 74 08 je 0x38
30: 48 89 df mov %rbx,%rdi
33: e8 84 33 9c fe call 0xfe9c33bc
38: 48 8b 3b mov (%rbx),%rdi
3b: e8 9c 65 00 00 call 0x65dc
---
Please let me know if any further information is required.
Best Regards,
Jiaming Zhang
View attachment "repro.c" of type "text/plain" (200085 bytes)
Download attachment "repro.syz" of type "application/octet-stream" (51735 bytes)
Download attachment "kernel.log" of type "application/octet-stream" (200572 bytes)
Download attachment "report" of type "application/octet-stream" (4539 bytes)
Download attachment ".config" of type "application/xml" (273663 bytes)
Powered by blists - more mailing lists