* [syzbot] [ext4?] WARNING in ext4_xattr_block_set (3)
@ 2025-09-16 20:09 syzbot
2025-09-23 5:02 ` Forwarded: [PATCH] ext4: skip inode expansion on readonly filesystems syzbot
` (2 more replies)
0 siblings, 3 replies; 8+ messages in thread
From: syzbot @ 2025-09-16 20:09 UTC (permalink / raw)
To: adilger.kernel, linux-ext4, linux-kernel, syzkaller-bugs, tytso
Hello,
syzbot found the following issue on:
HEAD commit: 46a51f4f5eda Merge tag 'for-v6.17-rc' of git://git.kernel...
git tree: upstream
console output: https://syzkaller.appspot.com/x/log.txt?x=1709747c580000
kernel config: https://syzkaller.appspot.com/x/.config?x=f5b21423ca3f0a96
dashboard link: https://syzkaller.appspot.com/bug?extid=4c9d23743a2409b80293
compiler: Debian clang version 20.1.8 (++20250708063551+0c9f909b7976-1~exp1~20250708183702.136), Debian LLD 20.1.8
syz repro: https://syzkaller.appspot.com/x/repro.syz?x=1089747c580000
C reproducer: https://syzkaller.appspot.com/x/repro.c?x=100fcf62580000
Downloadable assets:
disk image: https://storage.googleapis.com/syzbot-assets/230712d5bcfe/disk-46a51f4f.raw.xz
vmlinux: https://storage.googleapis.com/syzbot-assets/c02b11d16746/vmlinux-46a51f4f.xz
kernel image: https://storage.googleapis.com/syzbot-assets/c1526fd71bea/bzImage-46a51f4f.xz
mounted in repro: https://storage.googleapis.com/syzbot-assets/c8e39bedb73d/mount_0.gz
fsck result: failed (log: https://syzkaller.appspot.com/x/fsck.log?x=17b2fb12580000)
IMPORTANT: if you fix the issue, please add the following tag to the commit:
Reported-by: syzbot+4c9d23743a2409b80293@syzkaller.appspotmail.com
loop0: detected capacity change from 0 to 512
EXT4-fs (loop0): orphan cleanup on readonly fs
------------[ cut here ]------------
WARNING: CPU: 1 PID: 6102 at fs/ext4/xattr.c:1906 ext4_xattr_block_set+0x25b5/0x2ac0 fs/ext4/xattr.c:1906
Modules linked in:
CPU: 1 UID: 0 PID: 6102 Comm: syz.0.17 Not tainted syzkaller #0 PREEMPT_{RT,(full)}
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 08/18/2025
RIP: 0010:ext4_xattr_block_set+0x25b5/0x2ac0 fs/ext4/xattr.c:1906
Code: 00 00 00 e8 dd 71 a2 ff f0 80 63 28 fd eb 28 e8 71 34 43 ff 31 db 48 c7 44 24 20 00 00 00 00 e9 88 f1 ff ff e8 5c 34 43 ff 90 <0f> 0b 90 e9 0e dc ff ff e8 4e 34 43 ff 48 8b 5c 24 10 4c 8b 74 24
RSP: 0018:ffffc90003e77220 EFLAGS: 00010293
RAX: ffffffff827b39b4 RBX: ffffc90003e77548 RCX: ffff88802e9a8000
RDX: 0000000000000000 RSI: 0000000000000000 RDI: 0000000000000000
RBP: ffffc90003e77408 R08: 0000000000000000 R09: 0000000000000000
R10: ffff88805487c400 R11: ffff88805487c000 R12: 0000000000000000
R13: 1ffff920007ceeaa R14: 1ffff920007ceea9 R15: ffffc90003e77550
FS: 000055556e470500(0000) GS:ffff8881269bc000(0000) knlGS:0000000000000000
CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 00005624941c2138 CR3: 000000004081c000 CR4: 00000000003526f0
Call Trace:
<TASK>
ext4_xattr_move_to_block fs/ext4/xattr.c:2659 [inline]
ext4_xattr_make_inode_space fs/ext4/xattr.c:2734 [inline]
ext4_expand_extra_isize_ea+0x12d5/0x1ea0 fs/ext4/xattr.c:2822
__ext4_expand_extra_isize+0x30d/0x400 fs/ext4/inode.c:6385
ext4_try_to_expand_extra_isize fs/ext4/inode.c:6428 [inline]
__ext4_mark_inode_dirty+0x46c/0x700 fs/ext4/inode.c:6506
ext4_evict_inode+0x80d/0xee0 fs/ext4/inode.c:254
evict+0x504/0x9c0 fs/inode.c:810
ext4_orphan_cleanup+0xc20/0x1460 fs/ext4/orphan.c:474
__ext4_fill_super fs/ext4/super.c:5609 [inline]
ext4_fill_super+0x57fa/0x60b0 fs/ext4/super.c:5728
get_tree_bdev_flags+0x40e/0x4d0 fs/super.c:1692
vfs_get_tree+0x8f/0x2b0 fs/super.c:1815
do_new_mount+0x2a2/0x9e0 fs/namespace.c:3808
do_mount fs/namespace.c:4136 [inline]
__do_sys_mount fs/namespace.c:4347 [inline]
__se_sys_mount+0x317/0x410 fs/namespace.c:4324
do_syscall_x64 arch/x86/entry/syscall_64.c:63 [inline]
do_syscall_64+0xfa/0x3b0 arch/x86/entry/syscall_64.c:94
entry_SYSCALL_64_after_hwframe+0x77/0x7f
RIP: 0033:0x7f976e92034a
Code: d8 64 89 02 48 c7 c0 ff ff ff ff eb a6 e8 de 1a 00 00 66 2e 0f 1f 84 00 00 00 00 00 0f 1f 40 00 49 89 ca b8 a5 00 00 00 0f 05 <48> 3d 01 f0 ff ff 73 01 c3 48 c7 c1 a8 ff ff ff f7 d8 64 89 01 48
RSP: 002b:00007ffc3b5e27e8 EFLAGS: 00000246 ORIG_RAX: 00000000000000a5
RAX: ffffffffffffffda RBX: 00007ffc3b5e2870 RCX: 00007f976e92034a
RDX: 0000200000000180 RSI: 00002000000001c0 RDI: 00007ffc3b5e2830
RBP: 0000200000000180 R08: 00007ffc3b5e2870 R09: 000000000080078b
R10: 000000000080078b R11: 0000000000000246 R12: 00002000000001c0
R13: 00007ffc3b5e2830 R14: 0000000000000473 R15: 0000200000000680
</TASK>
---
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 syzkaller@googlegroups.com.
syzbot will keep track of this issue. See:
https://goo.gl/tpsmEJ#status for how to communicate with syzbot.
If the report is already addressed, let syzbot know by replying with:
#syz fix: exact-commit-title
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.
If you want to overwrite report's subsystems, reply with:
#syz set subsystems: new-subsystem
(See the list of subsystem names on the web dashboard)
If the report is a duplicate of another one, reply with:
#syz dup: exact-subject-of-another-report
If you want to undo deduplication, reply with:
#syz undup
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [syzbot] [ext4?] WARNING in ext4_xattr_block_set (3)
2025-09-23 2:31 [PATCH] ext4: skip inode expansion on readonly filesystems Deepanshu Kartikey
@ 2025-09-23 3:22 ` syzbot
0 siblings, 0 replies; 8+ messages in thread
From: syzbot @ 2025-09-23 3:22 UTC (permalink / raw)
To: kartikey406, linux-kernel, syzkaller-bugs
Hello,
syzbot has tested the proposed patch but the reproducer is still triggering an issue:
WARNING in ext4_xattr_block_set
loop0: detected capacity change from 0 to 512
EXT4-fs (loop0): orphan cleanup on readonly fs
------------[ cut here ]------------
WARNING: CPU: 0 PID: 6732 at fs/ext4/xattr.c:1906 ext4_xattr_block_set+0x25b5/0x2ac0 fs/ext4/xattr.c:1906
Modules linked in:
CPU: 0 UID: 0 PID: 6732 Comm: syz.0.17 Not tainted syzkaller #0 PREEMPT_{RT,(full)}
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 08/18/2025
RIP: 0010:ext4_xattr_block_set+0x25b5/0x2ac0 fs/ext4/xattr.c:1906
Code: 00 00 00 e8 ed 6f a2 ff f0 80 63 28 fd eb 28 e8 b1 26 43 ff 31 db 48 c7 44 24 20 00 00 00 00 e9 88 f1 ff ff e8 9c 26 43 ff 90 <0f> 0b 90 e9 0e dc ff ff e8 8e 26 43 ff 48 8b 5c 24 10 4c 8b 74 24
RSP: 0018:ffffc900046d7200 EFLAGS: 00010293
RAX: ffffffff827b47a4 RBX: ffffc900046d7540 RCX: ffff88802d373b80
RDX: 0000000000000000 RSI: 0000000000000000 RDI: 0000000000000000
RBP: ffffc900046d7400 R08: 0000000000000000 R09: 0000000000000000
R10: ffff8880518b6400 R11: ffff8880518b6000 R12: 0000000000000000
R13: 1ffff920008daea9 R14: 1ffff920008daea8 R15: ffffc900046d7548
FS: 00007f40f60f66c0(0000) GS:ffff8881268bc000(0000) knlGS:0000000000000000
CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 00007f7af07de000 CR3: 0000000033526000 CR4: 00000000003526f0
Call Trace:
<TASK>
ext4_xattr_move_to_block fs/ext4/xattr.c:2659 [inline]
ext4_xattr_make_inode_space fs/ext4/xattr.c:2734 [inline]
ext4_expand_extra_isize_ea+0x12d5/0x1ea0 fs/ext4/xattr.c:2822
__ext4_expand_extra_isize+0x30d/0x400 fs/ext4/inode.c:6385
ext4_try_to_expand_extra_isize fs/ext4/inode.c:6430 [inline]
__ext4_mark_inode_dirty+0x4f3/0x780 fs/ext4/inode.c:6508
ext4_evict_inode+0x80d/0xee0 fs/ext4/inode.c:254
evict+0x501/0x9c0 fs/inode.c:810
ext4_orphan_cleanup+0xc20/0x1460 fs/ext4/orphan.c:474
__ext4_fill_super fs/ext4/super.c:5609 [inline]
ext4_fill_super+0x57fa/0x60b0 fs/ext4/super.c:5728
get_tree_bdev_flags+0x40b/0x4d0 fs/super.c:1692
vfs_get_tree+0x8f/0x2b0 fs/super.c:1815
do_new_mount+0x2a2/0x9e0 fs/namespace.c:3808
do_mount fs/namespace.c:4136 [inline]
__do_sys_mount fs/namespace.c:4347 [inline]
__se_sys_mount+0x317/0x410 fs/namespace.c:4324
do_syscall_x64 arch/x86/entry/syscall_64.c:63 [inline]
do_syscall_64+0xfa/0x3b0 arch/x86/entry/syscall_64.c:94
entry_SYSCALL_64_after_hwframe+0x77/0x7f
RIP: 0033:0x7f40f6a9034a
Code: d8 64 89 02 48 c7 c0 ff ff ff ff eb a6 e8 de 1a 00 00 66 2e 0f 1f 84 00 00 00 00 00 0f 1f 40 00 49 89 ca b8 a5 00 00 00 0f 05 <48> 3d 01 f0 ff ff 73 01 c3 48 c7 c1 a8 ff ff ff f7 d8 64 89 01 48
RSP: 002b:00007f40f60f5e68 EFLAGS: 00000246 ORIG_RAX: 00000000000000a5
RAX: ffffffffffffffda RBX: 00007f40f60f5ef0 RCX: 00007f40f6a9034a
RDX: 0000200000000180 RSI: 00002000000001c0 RDI: 00007f40f60f5eb0
RBP: 0000200000000180 R08: 00007f40f60f5ef0 R09: 000000000080078b
R10: 000000000080078b R11: 0000000000000246 R12: 00002000000001c0
R13: 00007f40f60f5eb0 R14: 0000000000000473 R15: 0000200000000680
</TASK>
Tested on:
commit: cec1e6e5 Merge tag 'sched_ext-for-6.17-rc7-fixes' of g..
git tree: upstream
console output: https://syzkaller.appspot.com/x/log.txt?x=1485f712580000
kernel config: https://syzkaller.appspot.com/x/.config?x=f5b21423ca3f0a96
dashboard link: https://syzkaller.appspot.com/bug?extid=4c9d23743a2409b80293
compiler: Debian clang version 20.1.8 (++20250708063551+0c9f909b7976-1~exp1~20250708183702.136), Debian LLD 20.1.8
patch: https://syzkaller.appspot.com/x/patch.diff?x=16b4c27c580000
^ permalink raw reply [flat|nested] 8+ messages in thread
* Forwarded: [PATCH] ext4: skip inode expansion on readonly filesystems
2025-09-16 20:09 [syzbot] [ext4?] WARNING in ext4_xattr_block_set (3) syzbot
@ 2025-09-23 5:02 ` syzbot
2025-09-23 6:11 ` Forwarded: [PATCH] Subject: " syzbot
2025-09-23 8:35 ` Forwarded: [PATCH] ext4: handle corrupted xattr entries in ext4_xattr_move_to_block syzbot
2 siblings, 0 replies; 8+ messages in thread
From: syzbot @ 2025-09-23 5:02 UTC (permalink / raw)
To: linux-kernel, syzkaller-bugs
For archival purposes, forwarding an incoming command email to
linux-kernel@vger.kernel.org, syzkaller-bugs@googlegroups.com.
***
Subject: [PATCH] ext4: skip inode expansion on readonly filesystems
Author: kartikey406@gmail.com
#syz test: git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
Fix WARNING in ext4_xattr_block_set() during orphan cleanup on readonly
filesystems when debug_want_extra_isize mount option is used.
The issue occurs when ext4_try_to_expand_extra_isize() attempts to modify
inodes on readonly filesystems during orphan cleanup, leading to warnings
when encountering invalid xattr entries. Add a readonly check to skip
expansion in this case.
Reported-by: syzbot+4c9d23743a2409b80293@syzkaller.appspotmail.com
Link: https://syzkaller.appspot.com/bug?extid=4c9d23743a2409b80293
Signed-off-by: Deepanshu Kartikey <kartikey406@gmail.com>
---
fs/ext4/inode.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/fs/ext4/inode.c b/fs/ext4/inode.c
index 5b7a15db4953..ff51a4567c4f 100644
--- a/fs/ext4/inode.c
+++ b/fs/ext4/inode.c
@@ -6345,7 +6345,8 @@ static int __ext4_expand_extra_isize(struct inode *inode,
unsigned int inode_size = EXT4_INODE_SIZE(inode->i_sb);
struct ext4_inode_info *ei = EXT4_I(inode);
int error;
-
+ if (sb_rdonly(inode->i_sb))
+ return 0;
/* this was checked at iget time, but double check for good measure */
if ((EXT4_GOOD_OLD_INODE_SIZE + ei->i_extra_isize > inode_size) ||
(ei->i_extra_isize & 3)) {
@@ -6403,6 +6404,8 @@ static int ext4_try_to_expand_extra_isize(struct inode *inode,
struct ext4_iloc iloc,
handle_t *handle)
{
+ if (sb_rdonly(inode->i_sb))
+ return 0;
int no_expand;
int error;
--
2.43.0
^ permalink raw reply related [flat|nested] 8+ messages in thread
* Re: [syzbot] [ext4?] WARNING in ext4_xattr_block_set (3)
[not found] <20250923050202.1078052-1-kartikey406@gmail.com>
@ 2025-09-23 5:43 ` syzbot
0 siblings, 0 replies; 8+ messages in thread
From: syzbot @ 2025-09-23 5:43 UTC (permalink / raw)
To: kartikey406, linux-ext4, linux-kernel, syzkaller-bugs
Hello,
syzbot has tested the proposed patch but the reproducer is still triggering an issue:
WARNING in ext4_xattr_block_set
loop0: detected capacity change from 0 to 512
EXT4-fs (loop0): orphan cleanup on readonly fs
------------[ cut here ]------------
WARNING: CPU: 0 PID: 6741 at fs/ext4/xattr.c:1906 ext4_xattr_block_set+0x25b5/0x2ac0 fs/ext4/xattr.c:1906
Modules linked in:
CPU: 0 UID: 0 PID: 6741 Comm: syz.0.17 Not tainted syzkaller #0 PREEMPT_{RT,(full)}
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 08/18/2025
RIP: 0010:ext4_xattr_block_set+0x25b5/0x2ac0 fs/ext4/xattr.c:1906
Code: 00 00 00 e8 8d 6f a2 ff f0 80 63 28 fd eb 28 e8 51 26 43 ff 31 db 48 c7 44 24 20 00 00 00 00 e9 88 f1 ff ff e8 3c 26 43 ff 90 <0f> 0b 90 e9 0e dc ff ff e8 2e 26 43 ff 48 8b 5c 24 10 4c 8b 74 24
RSP: 0018:ffffc90003a8f220 EFLAGS: 00010293
RAX: ffffffff827b4804 RBX: ffffc90003a8f548 RCX: ffff888028990000
RDX: 0000000000000000 RSI: 0000000000000000 RDI: 0000000000000000
RBP: ffffc90003a8f408 R08: 0000000000000000 R09: 0000000000000000
R10: ffff888048888400 R11: ffff888048888000 R12: 0000000000000000
R13: 1ffff92000751eaa R14: 1ffff92000751ea9 R15: ffffc90003a8f550
FS: 00007f9e5efd66c0(0000) GS:ffff8881268bc000(0000) knlGS:0000000000000000
CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 00007f1005681000 CR3: 000000002f6d2000 CR4: 00000000003526f0
Call Trace:
<TASK>
ext4_xattr_move_to_block fs/ext4/xattr.c:2659 [inline]
ext4_xattr_make_inode_space fs/ext4/xattr.c:2734 [inline]
ext4_expand_extra_isize_ea+0x12d5/0x1ea0 fs/ext4/xattr.c:2822
__ext4_expand_extra_isize+0x365/0x460 fs/ext4/inode.c:6386
ext4_try_to_expand_extra_isize fs/ext4/inode.c:6431 [inline]
__ext4_mark_inode_dirty+0x4f3/0x780 fs/ext4/inode.c:6509
ext4_evict_inode+0x80d/0xee0 fs/ext4/inode.c:254
evict+0x501/0x9c0 fs/inode.c:810
ext4_orphan_cleanup+0xc20/0x1460 fs/ext4/orphan.c:474
__ext4_fill_super fs/ext4/super.c:5609 [inline]
ext4_fill_super+0x57fa/0x60b0 fs/ext4/super.c:5728
get_tree_bdev_flags+0x40b/0x4d0 fs/super.c:1692
vfs_get_tree+0x8f/0x2b0 fs/super.c:1815
do_new_mount+0x2a2/0x9e0 fs/namespace.c:3808
do_mount fs/namespace.c:4136 [inline]
__do_sys_mount fs/namespace.c:4347 [inline]
__se_sys_mount+0x317/0x410 fs/namespace.c:4324
do_syscall_x64 arch/x86/entry/syscall_64.c:63 [inline]
do_syscall_64+0xfa/0x3b0 arch/x86/entry/syscall_64.c:94
entry_SYSCALL_64_after_hwframe+0x77/0x7f
RIP: 0033:0x7f9e5f97066a
Code: d8 64 89 02 48 c7 c0 ff ff ff ff eb a6 e8 de 1a 00 00 66 2e 0f 1f 84 00 00 00 00 00 0f 1f 40 00 49 89 ca b8 a5 00 00 00 0f 05 <48> 3d 01 f0 ff ff 73 01 c3 48 c7 c1 a8 ff ff ff f7 d8 64 89 01 48
RSP: 002b:00007f9e5efd5e68 EFLAGS: 00000246 ORIG_RAX: 00000000000000a5
RAX: ffffffffffffffda RBX: 00007f9e5efd5ef0 RCX: 00007f9e5f97066a
RDX: 0000200000000180 RSI: 00002000000001c0 RDI: 00007f9e5efd5eb0
RBP: 0000200000000180 R08: 00007f9e5efd5ef0 R09: 000000000080078b
R10: 000000000080078b R11: 0000000000000246 R12: 00002000000001c0
R13: 00007f9e5efd5eb0 R14: 0000000000000473 R15: 0000200000000680
</TASK>
Tested on:
commit: cec1e6e5 Merge tag 'sched_ext-for-6.17-rc7-fixes' of g..
git tree: upstream
console output: https://syzkaller.appspot.com/x/log.txt?x=126bf712580000
kernel config: https://syzkaller.appspot.com/x/.config?x=f5b21423ca3f0a96
dashboard link: https://syzkaller.appspot.com/bug?extid=4c9d23743a2409b80293
compiler: Debian clang version 20.1.8 (++20250708063551+0c9f909b7976-1~exp1~20250708183702.136), Debian LLD 20.1.8
patch: https://syzkaller.appspot.com/x/patch.diff?x=179118e2580000
^ permalink raw reply [flat|nested] 8+ messages in thread
* Forwarded: [PATCH] Subject: [PATCH] ext4: skip inode expansion on readonly filesystems
2025-09-16 20:09 [syzbot] [ext4?] WARNING in ext4_xattr_block_set (3) syzbot
2025-09-23 5:02 ` Forwarded: [PATCH] ext4: skip inode expansion on readonly filesystems syzbot
@ 2025-09-23 6:11 ` syzbot
2025-09-23 8:35 ` Forwarded: [PATCH] ext4: handle corrupted xattr entries in ext4_xattr_move_to_block syzbot
2 siblings, 0 replies; 8+ messages in thread
From: syzbot @ 2025-09-23 6:11 UTC (permalink / raw)
To: linux-kernel, syzkaller-bugs
For archival purposes, forwarding an incoming command email to
linux-kernel@vger.kernel.org, syzkaller-bugs@googlegroups.com.
***
Subject: [PATCH] Subject: [PATCH] ext4: skip inode expansion on readonly filesystems
Author: kartikey406@gmail.com
#syz test: git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
Fix WARNING in ext4_xattr_block_set() during orphan cleanup on readonly
filesystems when debug_want_extra_isize mount option is used.
The issue occurs when ext4_try_to_expand_extra_isize() attempts to modify
inodes on readonly filesystems during orphan cleanup, leading to warnings
when encountering invalid xattr entries. Add a readonly check to skip
expansion in this case.
Reported-by: syzbot+4c9d23743a2409b80293@syzkaller.appspotmail.com
Link: https://syzkaller.appspot.com/bug?extid=4c9d23743a2409b80293
Signed-off-by: Deepanshu Kartikey <kartikey406@gmail.com>
---
fs/ext4/inode.c | 9 +++++++++
1 file changed, 9 insertions(+)
diff --git a/fs/ext4/inode.c b/fs/ext4/inode.c
index 5b7a15db4953..67300baa8e4e 100644
--- a/fs/ext4/inode.c
+++ b/fs/ext4/inode.c
@@ -6345,6 +6345,15 @@ static int __ext4_expand_extra_isize(struct inode *inode,
unsigned int inode_size = EXT4_INODE_SIZE(inode->i_sb);
struct ext4_inode_info *ei = EXT4_I(inode);
int error;
+ if (sb_rdonly(inode->i_sb)) {
+ printk(KERN_ERR "ext4: READONLY CHECK TRIGGERED - skipping expansion\n");
+ return 0;
+ }
+
+ if (IS_RDONLY(inode)) {
+ printk(KERN_ERR "ext4: READONLY CHECK TRIGGERED IS_RDONLY - skipping expansion\n");
+ return 0;
+ }
/* this was checked at iget time, but double check for good measure */
if ((EXT4_GOOD_OLD_INODE_SIZE + ei->i_extra_isize > inode_size) ||
--
2.43.0
^ permalink raw reply related [flat|nested] 8+ messages in thread
* Re: [syzbot] [ext4?] WARNING in ext4_xattr_block_set (3)
[not found] <20250923061138.1081531-1-kartikey406@gmail.com>
@ 2025-09-23 6:29 ` syzbot
0 siblings, 0 replies; 8+ messages in thread
From: syzbot @ 2025-09-23 6:29 UTC (permalink / raw)
To: kartikey406, linux-kernel, syzkaller-bugs
Hello,
syzbot has tested the proposed patch but the reproducer is still triggering an issue:
WARNING in ext4_xattr_block_set
loop0: detected capacity change from 0 to 512
EXT4-fs (loop0): orphan cleanup on readonly fs
------------[ cut here ]-[ 169.204299][ T6620] ------------[ cut here ]------------
WARNING: CPU: 0 PID: 6620 at fs/ext4/xattr.c:1906 ext4_xattr_block_set+0x25b5/0x2ac0 fs/ext4/xattr.c:1906
Modules linked in:
CPU: 0 UID: 0 PID: 6620 Comm: syz.0.17 Not tainted syzkaller #0 PREEMPT_{RT,(full)}
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 08/18/2025
RIP: 0010:ext4_xattr_block_set+0x25b5/0x2ac0 fs/ext4/xattr.c:1906
Code: 00 00 00 e8 fd 6f a2 ff f0 80 63 28 fd eb 28 e8 c1 26 43 ff 31 db 48 c7 44 24 20 00 00 00 00 e9 88 f1 ff ff e8 ac 26 43 ff 90 <0f> 0b 90 e9 0e dc ff ff e8 9e 26 43 ff 48 8b 5c 24 10 4c 8b 74 24
RSP: 0018:ffffc9000403f220 EFLAGS: 00010293
RAX: ffffffff827b4794 RBX: ffffc9000403f548 RCX: ffff88802f6f3b80
RDX: 0000000000000000 RSI: 0000000000000000 RDI: 0000000000000000
RBP: ffffc9000403f408 R08: 0000000000000000 R09: 0000000000000000
R10: ffff88803f7fd400 R11: ffff88803f7fd000 R12: 0000000000000000
R13: 1ffff92000807eaa R14: 1ffff92000807ea9 R15: ffffc9000403f550
FS: 00007f2f4637e6c0(0000) GS:ffff8881268bc000(0000) knlGS:0000000000000000
CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 00007f1a8a1c1000 CR3: 000000003b234000 CR4: 00000000003526f0
Call Trace:
<TASK>
ext4_xattr_move_to_block fs/ext4/xattr.c:2659 [inline]
ext4_xattr_make_inode_space fs/ext4/xattr.c:2734 [inline]
ext4_expand_extra_isize_ea+0x12d5/0x1ea0 fs/ext4/xattr.c:2822
__ext4_expand_extra_isize+0x35b/0x470 fs/ext4/inode.c:6394
ext4_try_to_expand_extra_isize fs/ext4/inode.c:6437 [inline]
__ext4_mark_inode_dirty+0x46c/0x700 fs/ext4/inode.c:6515
ext4_evict_inode+0x80d/0xee0 fs/ext4/inode.c:254
evict+0x501/0x9c0 fs/inode.c:810
ext4_orphan_cleanup+0xc20/0x1460 fs/ext4/orphan.c:474
__ext4_fill_super fs/ext4/super.c:5609 [inline]
ext4_fill_super+0x57fa/0x60b0 fs/ext4/super.c:5728
get_tree_bdev_flags+0x40b/0x4d0 fs/super.c:1692
vfs_get_tree+0x8f/0x2b0 fs/super.c:1815
do_new_mount+0x2a2/0x9e0 fs/namespace.c:3808
do_mount fs/namespace.c:4136 [inline]
__do_sys_mount fs/namespace.c:4347 [inline]
__se_sys_mount+0x317/0x410 fs/namespace.c:4324
do_syscall_x64 arch/x86/entry/syscall_64.c:63 [inline]
do_syscall_64+0xfa/0x3b0 arch/x86/entry/syscall_64.c:94
entry_SYSCALL_64_after_hwframe+0x77/0x7f
RIP: 0033:0x7f2f46d1066a
Code: d8 64 89 02 48 c7 c0 ff ff ff ff eb a6 e8 de 1a 00 00 66 2e 0f 1f 84 00 00 00 00 00 0f 1f 40 00 49 89 ca b8 a5 00 00 00 0f 05 <48> 3d 01 f0 ff ff 73 01 c3 48 c7 c1 a8 ff ff ff f7 d8 64 89 01 48
RSP: 002b:00007f2f4637de68 EFLAGS: 00000246 ORIG_RAX: 00000000000000a5
RAX: ffffffffffffffda RBX: 00007f2f4637def0 RCX: 00007f2f46d1066a
RDX: 0000200000000180 RSI: 00002000000001c0 RDI: 00007f2f4637deb0
RBP: 0000200000000180 R08: 00007f2f4637def0 R09: 000000000080078b
R10: 000000000080078b R11: 0000000000000246 R12: 00002000000001c0
R13: 00007f2f4637deb0 R14: 0000000000000473 R15: 0000200000000680
</TASK>
Tested on:
commit: cec1e6e5 Merge tag 'sched_ext-for-6.17-rc7-fixes' of g..
git tree: upstream
console output: https://syzkaller.appspot.com/x/log.txt?x=1397f712580000
kernel config: https://syzkaller.appspot.com/x/.config?x=f5b21423ca3f0a96
dashboard link: https://syzkaller.appspot.com/bug?extid=4c9d23743a2409b80293
compiler: Debian clang version 20.1.8 (++20250708063551+0c9f909b7976-1~exp1~20250708183702.136), Debian LLD 20.1.8
patch: https://syzkaller.appspot.com/x/patch.diff?x=14e518e2580000
^ permalink raw reply [flat|nested] 8+ messages in thread
* Forwarded: [PATCH] ext4: handle corrupted xattr entries in ext4_xattr_move_to_block
2025-09-16 20:09 [syzbot] [ext4?] WARNING in ext4_xattr_block_set (3) syzbot
2025-09-23 5:02 ` Forwarded: [PATCH] ext4: skip inode expansion on readonly filesystems syzbot
2025-09-23 6:11 ` Forwarded: [PATCH] Subject: " syzbot
@ 2025-09-23 8:35 ` syzbot
2 siblings, 0 replies; 8+ messages in thread
From: syzbot @ 2025-09-23 8:35 UTC (permalink / raw)
To: linux-kernel, syzkaller-bugs
For archival purposes, forwarding an incoming command email to
linux-kernel@vger.kernel.org, syzkaller-bugs@googlegroups.com.
***
Subject: [PATCH] ext4: handle corrupted xattr entries in ext4_xattr_move_to_block
Author: kartikey406@gmail.com
#syz test: git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
During inode expansion, ext4_xattr_move_to_block() can encounter corrupted
xattr entries where e_value_size is zero but e_value_inum is non-zero,
indicating the entry claims to store its value in a separate inode but
has no actual value. This leads to a WARNING in ext4_xattr_block_set()
when it hits WARN_ON_ONCE(!i->value_len).
Add validation in ext4_xattr_move_to_block() to detect this corruption
pattern early and return -EFSCORRUPTED instead of allowing the invalid
data to propagate and trigger warnings.
Reported-by: syzbot+4c9d23743a2409b80293@syzkaller.appspotmail.com
Link: https://syzkaller.appspot.com/bug?extid=4c9d23743a2409b80293
Signed-off-by: Deepanshu Kartikey <kartikey406@gmail.com>
---
fs/ext4/xattr.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/fs/ext4/xattr.c b/fs/ext4/xattr.c
index 5a6fe1513fd2..cbe06d7e3bb6 100644
--- a/fs/ext4/xattr.c
+++ b/fs/ext4/xattr.c
@@ -2607,7 +2607,10 @@ static int ext4_xattr_move_to_block(handle_t *handle, struct inode *inode,
struct ext4_xattr_ibody_header *header = IHDR(inode, raw_inode);
int needs_kvfree = 0;
int error;
-
+ if (value_size == 0 && entry->e_value_inum != 0) {
+ error = -EFSCORRUPTED;
+ goto out;
+ }
is = kzalloc(sizeof(struct ext4_xattr_ibody_find), GFP_NOFS);
bs = kzalloc(sizeof(struct ext4_xattr_block_find), GFP_NOFS);
b_entry_name = kmalloc(entry->e_name_len + 1, GFP_NOFS);
--
2.43.0
^ permalink raw reply related [flat|nested] 8+ messages in thread
* Re: [syzbot] [ext4?] WARNING in ext4_xattr_block_set (3)
[not found] <20250923083522.1086124-1-kartikey406@gmail.com>
@ 2025-09-23 8:55 ` syzbot
0 siblings, 0 replies; 8+ messages in thread
From: syzbot @ 2025-09-23 8:55 UTC (permalink / raw)
To: kartikey406, linux-kernel, syzkaller-bugs
Hello,
syzbot has tested the proposed patch but the reproducer is still triggering an issue:
WARNING in ext4_xattr_inode_update_ref
loop0: detected capacity change from 0 to 512
EXT4-fs (loop0): orphan cleanup on readonly fs
EXT4-fs warning (device loop0): ext4_expand_extra_isize_ea:2851: Unable to expand inode 15. Delete some EAs or run e2fsck.
------------[ cut here ]------------
EA inode 11 i_nlink=2
WARNING: CPU: 1 PID: 6503 at fs/ext4/xattr.c:1053 ext4_xattr_inode_update_ref+0x534/0x5d0 fs/ext4/xattr.c:1051
Modules linked in:
CPU: 1 UID: 0 PID: 6503 Comm: syz.0.17 Not tainted syzkaller #0 PREEMPT_{RT,(full)}
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 08/18/2025
RIP: 0010:ext4_xattr_inode_update_ref+0x534/0x5d0 fs/ext4/xattr.c:1051
Code: 00 00 00 00 00 fc ff df 41 0f b6 44 05 00 84 c0 0f 85 86 00 00 00 41 8b 14 24 48 c7 c7 e0 70 1f 8b 4c 89 fe e8 ed 87 07 ff 90 <0f> 0b 90 90 48 bb 00 00 00 00 00 fc ff df e9 bb fd ff ff e8 74 59
RSP: 0018:ffffc900042af2e0 EFLAGS: 00010246
RAX: ce552e21466e5d00 RBX: dffffc0000000000 RCX: ffff88802f2e8000
RDX: 0000000000000000 RSI: 0000000000000000 RDI: 0000000000000000
RBP: ffffc900042af3d0 R08: 0000000000000000 R09: 0000000000000000
R10: dffffc0000000000 R11: ffffed1017124863 R12: ffff888057ec8f58
R13: 1ffff1100afd91eb R14: 00000000ffffffff R15: 000000000000000b
FS: 00007f61d52b66c0(0000) GS:ffff8881269bc000(0000) knlGS:0000000000000000
CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 00007f0c2b6a1000 CR3: 0000000025d4e000 CR4: 00000000003526f0
Call Trace:
<TASK>
ext4_xattr_inode_dec_ref fs/ext4/xattr.c:1076 [inline]
ext4_xattr_inode_dec_ref_all+0x867/0xda0 fs/ext4/xattr.c:1218
ext4_xattr_delete_inode+0xa4c/0xc10 fs/ext4/xattr.c:2945
ext4_evict_inode+0xac9/0xee0 fs/ext4/inode.c:271
evict+0x501/0x9c0 fs/inode.c:810
ext4_orphan_cleanup+0xc20/0x1460 fs/ext4/orphan.c:474
__ext4_fill_super fs/ext4/super.c:5609 [inline]
ext4_fill_super+0x57fa/0x60b0 fs/ext4/super.c:5728
get_tree_bdev_flags+0x40b/0x4d0 fs/super.c:1692
vfs_get_tree+0x8f/0x2b0 fs/super.c:1815
do_new_mount+0x2a2/0x9e0 fs/namespace.c:3808
do_mount fs/namespace.c:4136 [inline]
__do_sys_mount fs/namespace.c:4347 [inline]
__se_sys_mount+0x317/0x410 fs/namespace.c:4324
do_syscall_x64 arch/x86/entry/syscall_64.c:63 [inline]
do_syscall_64+0xfa/0x3b0 arch/x86/entry/syscall_64.c:94
entry_SYSCALL_64_after_hwframe+0x77/0x7f
RIP: 0033:0x7f61d5c5066a
Code: d8 64 89 02 48 c7 c0 ff ff ff ff eb a6 e8 de 1a 00 00 66 2e 0f 1f 84 00 00 00 00 00 0f 1f 40 00 49 89 ca b8 a5 00 00 00 0f 05 <48> 3d 01 f0 ff ff 73 01 c3 48 c7 c1 a8 ff ff ff f7 d8 64 89 01 48
RSP: 002b:00007f61d52b5e68 EFLAGS: 00000246 ORIG_RAX: 00000000000000a5
RAX: ffffffffffffffda RBX: 00007f61d52b5ef0 RCX: 00007f61d5c5066a
RDX: 0000200000000180 RSI: 00002000000001c0 RDI: 00007f61d52b5eb0
RBP: 0000200000000180 R08: 00007f61d52b5ef0 R09: 000000000080078b
R10: 000000000080078b R11: 0000000000000246 R12: 00002000000001c0
R13: 00007f61d52b5eb0 R14: 0000000000000473 R15: 0000200000000680
</TASK>
Tested on:
commit: cec1e6e5 Merge tag 'sched_ext-for-6.17-rc7-fixes' of g..
git tree: upstream
console output: https://syzkaller.appspot.com/x/log.txt?x=16fd04e2580000
kernel config: https://syzkaller.appspot.com/x/.config?x=f5b21423ca3f0a96
dashboard link: https://syzkaller.appspot.com/bug?extid=4c9d23743a2409b80293
compiler: Debian clang version 20.1.8 (++20250708063551+0c9f909b7976-1~exp1~20250708183702.136), Debian LLD 20.1.8
patch: https://syzkaller.appspot.com/x/patch.diff?x=132d04e2580000
^ permalink raw reply [flat|nested] 8+ messages in thread
end of thread, other threads:[~2025-09-23 8:55 UTC | newest]
Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-09-16 20:09 [syzbot] [ext4?] WARNING in ext4_xattr_block_set (3) syzbot
2025-09-23 5:02 ` Forwarded: [PATCH] ext4: skip inode expansion on readonly filesystems syzbot
2025-09-23 6:11 ` Forwarded: [PATCH] Subject: " syzbot
2025-09-23 8:35 ` Forwarded: [PATCH] ext4: handle corrupted xattr entries in ext4_xattr_move_to_block syzbot
-- strict thread matches above, loose matches on Subject: below --
2025-09-23 2:31 [PATCH] ext4: skip inode expansion on readonly filesystems Deepanshu Kartikey
2025-09-23 3:22 ` [syzbot] [ext4?] WARNING in ext4_xattr_block_set (3) syzbot
[not found] <20250923050202.1078052-1-kartikey406@gmail.com>
2025-09-23 5:43 ` syzbot
[not found] <20250923061138.1081531-1-kartikey406@gmail.com>
2025-09-23 6:29 ` syzbot
[not found] <20250923083522.1086124-1-kartikey406@gmail.com>
2025-09-23 8:55 ` syzbot
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox