[v6.1] WARNING: locking bug in ext4_xattr_inode_iget

2 views
Skip to first unread message

syzbot

unread,
May 6, 2023, 6:34:09 AM5/6/23
to syzkaller...@googlegroups.com
Hello,

syzbot found the following issue on:

HEAD commit: ca48fc16c493 Linux 6.1.27
git tree: linux-6.1.y
console output: https://syzkaller.appspot.com/x/log.txt?x=1583176a280000
kernel config: https://syzkaller.appspot.com/x/.config?x=aea4bb7802570997
dashboard link: https://syzkaller.appspot.com/bug?extid=4b8823967328f40d1f25
compiler: Debian clang version 15.0.7, GNU ld (GNU Binutils for Debian) 2.35.2
userspace arch: arm64
syz repro: https://syzkaller.appspot.com/x/repro.syz?x=12a31712280000
C reproducer: https://syzkaller.appspot.com/x/repro.c?x=13e4796c280000

Downloadable assets:
disk image: https://storage.googleapis.com/syzbot-assets/ec11c1903c52/disk-ca48fc16.raw.xz
vmlinux: https://storage.googleapis.com/syzbot-assets/8ce41c1ad391/vmlinux-ca48fc16.xz
kernel image: https://storage.googleapis.com/syzbot-assets/affba5631cad/Image-ca48fc16.gz.xz
mounted in repro: https://storage.googleapis.com/syzbot-assets/566fb7a68e35/mount_0.gz

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

EXT4-fs error (device loop0): ext4_xattr_inode_iget:400: inode #12: comm syz-executor697: casefold flag without casefold feature
------------[ cut here ]------------
Looking for class "&ea_inode->i_rwsem" with key ext4_fs_type, but found a different class "&type->i_mutex_dir_key" with the same key
WARNING: CPU: 0 PID: 4224 at kernel/locking/lockdep.c:941 look_up_lock_class+0xec/0x158 kernel/locking/lockdep.c:938
Modules linked in:
CPU: 0 PID: 4224 Comm: syz-executor697 Not tainted 6.1.27-syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 04/14/2023
pstate: 604000c5 (nZCv daIF +PAN -UAO -TCO -DIT -SSBS BTYPE=--)
pc : look_up_lock_class+0xec/0x158 kernel/locking/lockdep.c:938
lr : look_up_lock_class+0xec/0x158 kernel/locking/lockdep.c:938
sp : ffff80001da36d10
x29: ffff80001da36d10 x28: dfff800000000000 x27: 0000000100000000
x26: ffff8000195af780 x25: ffff8000195af000 x24: ffff0000d7dc9b40
x23: ffff8000154e1cc0 x22: 0000000000000000 x21: ffff800015900b39
x20: ffff0000dec67258 x19: ffff8000181ed6c0 x18: 1fffe000368b6776
x17: 0000000000000000 x16: ffff8000120e6354 x15: 0000000000000000
x14: 0000000000000000 x13: 0000000000000001 x12: 0000000000000001
x11: ff808000081ae818 x10: 0000000000000000 x9 : 2126701d1e4e3500
x8 : 2126701d1e4e3500 x7 : 0000000000000001 x6 : 0000000000000001
x5 : ffff80001da365f8 x4 : ffff800015672960 x3 : ffff800008585158
x2 : 0000000000000001 x1 : 0000000100000000 x0 : 0000000000000000
Call trace:
look_up_lock_class+0xec/0x158 kernel/locking/lockdep.c:938
register_lock_class+0x90/0x6a8 kernel/locking/lockdep.c:1290
lockdep_init_map_type+0x358/0x7d4 kernel/locking/lockdep.c:4859
ext4_xattr_inode_set_class fs/ext4/xattr.c:126 [inline]
ext4_xattr_inode_iget+0x278/0x4b8 fs/ext4/xattr.c:425
ext4_xattr_inode_get+0x148/0x674 fs/ext4/xattr.c:501
ext4_xattr_move_to_block fs/ext4/xattr.c:2590 [inline]
ext4_xattr_make_inode_space fs/ext4/xattr.c:2692 [inline]
ext4_expand_extra_isize_ea+0xb9c/0x1688 fs/ext4/xattr.c:2784
__ext4_expand_extra_isize+0x290/0x348 fs/ext4/inode.c:5890
ext4_try_to_expand_extra_isize fs/ext4/inode.c:5933 [inline]
__ext4_mark_inode_dirty+0x484/0x8fc fs/ext4/inode.c:6011
ext4_evict_inode+0xb74/0x12cc fs/ext4/inode.c:279
evict+0x260/0x68c fs/inode.c:664
iput_final fs/inode.c:1747 [inline]
iput+0x7c0/0x8a4 fs/inode.c:1773
ext4_process_orphan+0x244/0x2b8 fs/ext4/orphan.c:360
ext4_orphan_cleanup+0x968/0x1140 fs/ext4/orphan.c:474
__ext4_fill_super fs/ext4/super.c:5531 [inline]
ext4_fill_super+0x6f6c/0x75cc fs/ext4/super.c:5659
get_tree_bdev+0x360/0x54c fs/super.c:1346
ext4_get_tree+0x28/0x38 fs/ext4/super.c:5689
vfs_get_tree+0x90/0x274 fs/super.c:1553
do_new_mount+0x25c/0x8c8 fs/namespace.c:3040
path_mount+0x590/0xe58 fs/namespace.c:3370
do_mount fs/namespace.c:3383 [inline]
__do_sys_mount fs/namespace.c:3591 [inline]
__se_sys_mount fs/namespace.c:3568 [inline]
__arm64_sys_mount+0x45c/0x594 fs/namespace.c:3568
__invoke_syscall arch/arm64/kernel/syscall.c:38 [inline]
invoke_syscall+0x98/0x2c0 arch/arm64/kernel/syscall.c:52
el0_svc_common+0x138/0x258 arch/arm64/kernel/syscall.c:142
do_el0_svc+0x64/0x218 arch/arm64/kernel/syscall.c:206
el0_svc+0x58/0x168 arch/arm64/kernel/entry-common.c:637
el0t_64_sync_handler+0x84/0xf0 arch/arm64/kernel/entry-common.c:655
el0t_64_sync+0x18c/0x190 arch/arm64/kernel/entry.S:581
irq event stamp: 19271
hardirqs last enabled at (19271): [<ffff80000827b628>] raw_spin_rq_unlock_irq kernel/sched/sched.h:1367 [inline]
hardirqs last enabled at (19271): [<ffff80000827b628>] finish_lock_switch+0xbc/0x1e8 kernel/sched/core.c:5000
hardirqs last disabled at (19270): [<ffff8000121b163c>] __schedule+0x2a4/0x1c98 kernel/sched/core.c:6453
softirqs last enabled at (19242): [<ffff800008020d74>] softirq_handle_end kernel/softirq.c:414 [inline]
softirqs last enabled at (19242): [<ffff800008020d74>] __do_softirq+0xc14/0xea0 kernel/softirq.c:600
softirqs last disabled at (19233): [<ffff80000802a948>] ____do_softirq+0x14/0x20 arch/arm64/kernel/irq.c:79
---[ end trace 0000000000000000 ]---
EXT4-fs warning (device loop0): ext4_xattr_inode_get:511: inode #12: comm syz-executor697: ea_inode file size=60 entry size=6
EXT4-fs warning (device loop0): ext4_expand_extra_isize_ea:2810: Unable to expand inode 15. Delete some EAs or run e2fsck.
EXT4-fs error (device loop0): ext4_xattr_inode_iget:400: inode #12: comm syz-executor697: casefold flag without casefold feature
EXT4-fs error (device loop0): ext4_do_update_inode:5181: inode #15: comm syz-executor697: corrupted inode contents
EXT4-fs error (device loop0): ext4_dirty_inode:6043: inode #15: comm syz-executor697: mark_inode_dirty error
EXT4-fs error (device loop0): ext4_do_update_inode:5181: inode #15: comm syz-executor697: corrupted inode contents
EXT4-fs error (device loop0): ext4_xattr_delete_inode:2955: inode #15: comm syz-executor697: mark_inode_dirty error
EXT4-fs error (device loop0): ext4_xattr_delete_inode:2958: inode #15: comm syz-executor697: mark inode dirty (error -117)
EXT4-fs warning (device loop0): ext4_evict_inode:299: xattr delete (err -117)
EXT4-fs (loop0): 1


---
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 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 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 8, 2023, 11:21:57 AM5/8/23
to syzkaller...@googlegroups.com
Hello,

syzbot found the following issue on:

HEAD commit: 8a7f2a5c5aa1 Linux 5.15.110
git tree: linux-5.15.y
console output: https://syzkaller.appspot.com/x/log.txt?x=10b67bc4280000
kernel config: https://syzkaller.appspot.com/x/.config?x=7e93d602da27af41
dashboard link: https://syzkaller.appspot.com/bug?extid=ac6636cb5046144aa2e4
compiler: Debian clang version 15.0.7, GNU ld (GNU Binutils for Debian) 2.35.2
userspace arch: arm64
syz repro: https://syzkaller.appspot.com/x/repro.syz?x=1063e67a280000
C reproducer: https://syzkaller.appspot.com/x/repro.c?x=15317850280000

Downloadable assets:
disk image: https://storage.googleapis.com/syzbot-assets/16bea75b636d/disk-8a7f2a5c.raw.xz
vmlinux: https://storage.googleapis.com/syzbot-assets/3b169e33dcf2/vmlinux-8a7f2a5c.xz
kernel image: https://storage.googleapis.com/syzbot-assets/190d08a00950/Image-8a7f2a5c.gz.xz
mounted in repro: https://storage.googleapis.com/syzbot-assets/0efed7ec96f4/mount_0.gz

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

EXT4-fs (loop0): Warning: mounting with an experimental mount option 'dioread_nolock' for blocksize < PAGE_SIZE
EXT4-fs error (device loop0): ext4_xattr_inode_iget:400: inode #12: comm syz-executor160: casefold flag without casefold feature
------------[ cut here ]------------
WARNING: CPU: 0 PID: 3961 at kernel/locking/lockdep.c:896 look_up_lock_class+0x134/0x13c
Modules linked in:
CPU: 0 PID: 3961 Comm: syz-executor160 Not tainted 5.15.110-syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 04/14/2023
pstate: 804000c5 (Nzcv daIF +PAN -UAO -TCO -DIT -SSBS BTYPE=--)
pc : look_up_lock_class+0x134/0x13c
lr : look_up_lock_class+0x74/0x13c
sp : ffff80001a8f6cb0
x29: ffff80001a8f6cb0 x28: dfff800000000000 x27: 0000000100000000
x26: ffff8000183bed20 x25: ffff8000183be000 x24: ffff0000c86c3580
x23: ffff800014820d00 x22: 0000000000000000 x21: ffff800014c17e79
x20: ffff0000dc56c9b8 x19: ffff800016ffe000 x18: ffff80001a8f6240
x17: 1fffe000368ffd8e x16: ffff8000082eb17c x15: 000000000000b67f
x14: 1ffff0000291a06a x13: ffffffffffffffff x12: 0000000000000000
x11: ff8080000a9a1710 x10: 0000000000000000 x9 : ffff800017185d00
x8 : ffff800014c17e78 x7 : 0000000000000000 x6 : 0000000000000000
x5 : 0000000000000000 x4 : 0000000000000000 x3 : 0000000000000010
x2 : 0000000000000001 x1 : 0000000000000001 x0 : 0000000000000001
Call trace:
look_up_lock_class+0x134/0x13c
register_lock_class+0x90/0x6a4 kernel/locking/lockdep.c:1245
lockdep_init_map_type+0x284/0x768 kernel/locking/lockdep.c:4814
ext4_xattr_inode_set_class fs/ext4/xattr.c:126 [inline]
ext4_xattr_inode_iget+0x278/0x4b8 fs/ext4/xattr.c:425
ext4_xattr_inode_get+0x148/0x674 fs/ext4/xattr.c:501
ext4_xattr_move_to_block fs/ext4/xattr.c:2589 [inline]
ext4_xattr_make_inode_space fs/ext4/xattr.c:2691 [inline]
ext4_expand_extra_isize_ea+0xb9c/0x1688 fs/ext4/xattr.c:2783
__ext4_expand_extra_isize+0x290/0x348 fs/ext4/inode.c:5828
ext4_try_to_expand_extra_isize fs/ext4/inode.c:5871 [inline]
__ext4_mark_inode_dirty+0x4e8/0x924 fs/ext4/inode.c:5949
ext4_evict_inode+0xb68/0x124c fs/ext4/inode.c:282
evict+0x260/0x68c fs/inode.c:587
iput_final fs/inode.c:1663 [inline]
iput+0x744/0x824 fs/inode.c:1689
ext4_process_orphan+0x244/0x2b8 fs/ext4/orphan.c:360
ext4_orphan_cleanup+0x8bc/0x104c fs/ext4/orphan.c:474
ext4_fill_super+0x7f7c/0x868c fs/ext4/super.c:4964
mount_bdev+0x26c/0x368 fs/super.c:1378
ext4_mount+0x44/0x58 fs/ext4/super.c:6568
legacy_get_tree+0xd4/0x16c fs/fs_context.c:610
vfs_get_tree+0x90/0x274 fs/super.c:1508
do_new_mount+0x25c/0x8c8 fs/namespace.c:2994
path_mount+0x590/0x104c fs/namespace.c:3324
do_mount fs/namespace.c:3337 [inline]
__do_sys_mount fs/namespace.c:3545 [inline]
__se_sys_mount fs/namespace.c:3522 [inline]
__arm64_sys_mount+0x510/0x5e0 fs/namespace.c:3522
__invoke_syscall arch/arm64/kernel/syscall.c:38 [inline]
invoke_syscall+0x98/0x2b8 arch/arm64/kernel/syscall.c:52
el0_svc_common+0x138/0x258 arch/arm64/kernel/syscall.c:142
do_el0_svc+0x58/0x14c arch/arm64/kernel/syscall.c:181
el0_svc+0x7c/0x1f0 arch/arm64/kernel/entry-common.c:596
el0t_64_sync_handler+0x84/0xe4 arch/arm64/kernel/entry-common.c:614
el0t_64_sync+0x1a0/0x1a4 arch/arm64/kernel/entry.S:584
irq event stamp: 15861
hardirqs last enabled at (15861): [<ffff800008268c94>] raw_spin_rq_unlock_irq kernel/sched/sched.h:1338 [inline]
hardirqs last enabled at (15861): [<ffff800008268c94>] finish_lock_switch+0xbc/0x1e8 kernel/sched/core.c:4780
hardirqs last disabled at (15860): [<ffff800011a02f68>] __schedule+0x308/0x1e38 kernel/sched/core.c:6268
softirqs last enabled at (15832): [<ffff800008020ccc>] softirq_handle_end kernel/softirq.c:401 [inline]
softirqs last enabled at (15832): [<ffff800008020ccc>] __do_softirq+0xb5c/0xe20 kernel/softirq.c:587
softirqs last disabled at (15821): [<ffff8000081b573c>] do_softirq_own_stack include/asm-generic/softirq_stack.h:10 [inline]
softirqs last disabled at (15821): [<ffff8000081b573c>] invoke_softirq kernel/softirq.c:439 [inline]
softirqs last disabled at (15821): [<ffff8000081b573c>] __irq_exit_rcu+0x28c/0x534 kernel/softirq.c:636
---[ end trace c8d6962cd346aa74 ]---
EXT4-fs warning (device loop0): ext4_xattr_inode_get:511: inode #12: comm syz-executor160: ea_inode file size=60 entry size=6
EXT4-fs warning (device loop0): ext4_expand_extra_isize_ea:2809: Unable to expand inode 15. Delete some EAs or run e2fsck.
EXT4-fs error (device loop0): ext4_xattr_inode_iget:400: inode #12: comm syz-executor160: casefold flag without casefold feature
EXT4-fs error (device loop0): ext4_do_update_inode:5143: inode #15: comm syz-executor160: corrupted inode contents
EXT4-fs error (device loop0): ext4_dirty_inode:5981: inode #15: comm syz-executor160: mark_inode_dirty error
EXT4-fs error (device loop0): ext4_do_update_inode:5143: inode #15: comm syz-executor160: corrupted inode contents
EXT4-fs error (device loop0): ext4_xattr_delete_inode:2954: inode #15: comm syz-executor160: mark_inode_dirty error
EXT4-fs error (device loop0): ext4_xattr_delete_inode:2957: inode #15: comm syz-executor160: mark inode dirty (error -117)
EXT4-fs warning (device loop0): ext4_evict_inode:302: xattr delete (err -117)
EXT4-fs (loop0): 1 orphan inode deleted
EXT4-fs (loop0): mounted filesystem without journal. Opts: dioread_nolock,prjquota,debug_want_extra_isize=0x000000000000005c,noauto_da_alloc,mblk_io_submit,errors=continue,usrjquota=,,errors=continue. Quota mode: writeback.

syzbot

unread,
Sep 14, 2023, 12:49:38 PM9/14/23
to syzkaller...@googlegroups.com
Auto-closing this bug as obsolete.
No recent activity, existing reproducers are no longer triggering the issue.
Reply all
Reply to author
Forward
0 new messages