syzbot


possible deadlock in ext4_xattr_set_handle

Status: upstream: reported on 2026/05/12 19:17
Reported-by: syzbot+fccdae14434d56ae4932@syzkaller.appspotmail.com
First crash: 18d, last: 10d
Similar bugs (10)
Kernel Title Rank 🛈 Repro Cause bisect Fix bisect Count Last Reported Patched Status
upstream possible deadlock in ext4_xattr_set_handle (5) ext4 4 72 704d 747d 0/29 auto-obsoleted due to no activity on 2024/09/03 19:27
upstream possible deadlock in ext4_xattr_set_handle (3) ext4 4 C 451 1064d 1221d 22/29 fixed on 2023/07/01 16:05
upstream possible deadlock in ext4_xattr_set_handle (7) prio:high ext4 4 C unreliable 467 22m 198d 0/29 upstream: reported C repro on 2025/11/13 08:08
upstream possible deadlock in ext4_xattr_set_handle (4) ext4 4 5 861d 981d 0/29 auto-obsoleted due to no activity on 2024/04/29 16:11
upstream possible deadlock in ext4_xattr_set_handle ext4 4 1 1685d 1681d 0/29 auto-closed as invalid on 2022/02/15 19:59
upstream possible deadlock in ext4_xattr_set_handle (6) ext4 4 50 584d 605d 0/29 auto-obsoleted due to no activity on 2025/01/01 12:48
upstream possible deadlock in ext4_xattr_set_handle (2) ext4 4 1 1419d 1418d 0/29 auto-obsoleted due to no activity on 2022/11/08 16:24
linux-5.15 possible deadlock in ext4_xattr_set_handle 4 C done 42 1087d 1180d 3/3 fixed on 2023/07/17 13:09
linux-4.19 possible deadlock in ext4_xattr_set_handle ext4 4 1 1212d 1212d 0/1 upstream: reported on 2023/02/03 16:43
linux-6.1 possible deadlock in ext4_xattr_set_handle 4 C done 15 1087d 1175d 3/3 fixed on 2023/07/17 13:09

Sample crash report:
======================================================
WARNING: possible circular locking dependency detected
syzkaller #0 Not tainted
------------------------------------------------------
syz.1.302/7463 is trying to acquire lock:
ffff88805d53d0c8 (&ei->xattr_sem){++++}-{3:3}, at: ext4_write_lock_xattr fs/ext4/xattr.h:158 [inline]
ffff88805d53d0c8 (&ei->xattr_sem){++++}-{3:3}, at: ext4_xattr_set_handle+0x19d/0x14c0 fs/ext4/xattr.c:2369

but task is already holding lock:
ffff88807e4d8c58 (&sbi->s_writepages_rwsem){++++}-{0:0}, at: ext4_writepages_down_write fs/ext4/ext4.h:1780 [inline]
ffff88807e4d8c58 (&sbi->s_writepages_rwsem){++++}-{0:0}, at: ext4_ext_migrate+0x321/0x1080 fs/ext4/migrate.c:438

which lock already depends on the new lock.


the existing dependency chain (in reverse order) is:

-> #1 (&sbi->s_writepages_rwsem){++++}-{0:0}:
       percpu_down_read+0x44/0x1a0 include/linux/percpu-rwsem.h:51
       ext4_writepages_down_read fs/ext4/ext4.h:1768 [inline]
       ext4_writepages+0x1a4/0x350 fs/ext4/inode.c:2808
       do_writepages+0x3b3/0x630 mm/page-writeback.c:2575
       __writeback_single_inode+0x153/0xec0 fs/fs-writeback.c:1635
       writeback_single_inode+0x21f/0x760 fs/fs-writeback.c:1756
       write_inode_now+0x183/0x210 fs/fs-writeback.c:2808
       iput_final fs/inode.c:1807 [inline]
       iput+0x5ae/0x920 fs/inode.c:1846
       ext4_xattr_block_set+0x249e/0x32b0 fs/ext4/xattr.c:2148
       ext4_xattr_move_to_block fs/ext4/xattr.c:2666 [inline]
       ext4_xattr_make_inode_space fs/ext4/xattr.c:2741 [inline]
       ext4_expand_extra_isize_ea+0x12c5/0x1e80 fs/ext4/xattr.c:2829
       __ext4_expand_extra_isize+0x306/0x400 fs/ext4/inode.c:5990
       ext4_try_to_expand_extra_isize fs/ext4/inode.c:6033 [inline]
       __ext4_mark_inode_dirty+0x45d/0x6e0 fs/ext4/inode.c:6111
       ext4_evict_inode+0x7f3/0xea0 fs/ext4/inode.c:254
       evict+0x4ca/0x8d0 fs/inode.c:705
       ext4_orphan_cleanup+0xbec/0x1420 fs/ext4/orphan.c:472
       __ext4_fill_super fs/ext4/super.c:5621 [inline]
       ext4_fill_super+0x5eea/0x67b0 fs/ext4/super.c:5744
       get_tree_bdev+0x3f3/0x520 fs/super.c:1591
       vfs_get_tree+0x8c/0x280 fs/super.c:1764
       do_new_mount+0x24b/0xa40 fs/namespace.c:3386
       do_mount fs/namespace.c:3726 [inline]
       __do_sys_mount fs/namespace.c:3935 [inline]
       __se_sys_mount+0x2e7/0x3d0 fs/namespace.c:3912
       do_syscall_x64 arch/x86/entry/common.c:46 [inline]
       do_syscall_64+0x55/0xb0 arch/x86/entry/common.c:76
       entry_SYSCALL_64_after_hwframe+0x68/0xd2

-> #0 (&ei->xattr_sem){++++}-{3:3}:
       check_prev_add kernel/locking/lockdep.c:3134 [inline]
       check_prevs_add kernel/locking/lockdep.c:3253 [inline]
       validate_chain kernel/locking/lockdep.c:3869 [inline]
       __lock_acquire+0x2df1/0x7d40 kernel/locking/lockdep.c:5137
       lock_acquire+0x19e/0x420 kernel/locking/lockdep.c:5754
       down_write+0x97/0x200 kernel/locking/rwsem.c:1573
       ext4_write_lock_xattr fs/ext4/xattr.h:158 [inline]
       ext4_xattr_set_handle+0x19d/0x14c0 fs/ext4/xattr.c:2369
       __ext4_set_acl+0x56f/0x650 fs/ext4/acl.c:217
       ext4_init_acl+0x24d/0x330 fs/ext4/acl.c:297
       __ext4_new_inode+0x2f27/0x3ac0 fs/ext4/ialloc.c:1332
       ext4_ext_migrate+0x6f0/0x1080 fs/ext4/migrate.c:456
       __ext4_ioctl fs/ext4/ioctl.c:1412 [inline]
       ext4_ioctl+0x1ee3/0x3b80 fs/ext4/ioctl.c:1630
       vfs_ioctl fs/ioctl.c:51 [inline]
       __do_sys_ioctl fs/ioctl.c:871 [inline]
       __se_sys_ioctl+0xfd/0x170 fs/ioctl.c:857
       do_syscall_x64 arch/x86/entry/common.c:46 [inline]
       do_syscall_64+0x55/0xb0 arch/x86/entry/common.c:76
       entry_SYSCALL_64_after_hwframe+0x68/0xd2

other info that might help us debug this:

 Possible unsafe locking scenario:

       CPU0                    CPU1
       ----                    ----
  lock(&sbi->s_writepages_rwsem);
                               lock(&ei->xattr_sem);
                               lock(&sbi->s_writepages_rwsem);
  lock(&ei->xattr_sem);

 *** DEADLOCK ***

3 locks held by syz.1.302/7463:
 #0: ffff88802f4a2418 (sb_writers#4){.+.+}-{0:0}, at: mnt_want_write_file+0x63/0x200 fs/namespace.c:456
 #1: ffff88805d539810 (&sb->s_type->i_mutex_key#9){++++}-{3:3}, at: inode_lock include/linux/fs.h:804 [inline]
 #1: ffff88805d539810 (&sb->s_type->i_mutex_key#9){++++}-{3:3}, at: __ext4_ioctl fs/ext4/ioctl.c:1411 [inline]
 #1: ffff88805d539810 (&sb->s_type->i_mutex_key#9){++++}-{3:3}, at: ext4_ioctl+0x1edb/0x3b80 fs/ext4/ioctl.c:1630
 #2: ffff88807e4d8c58 (&sbi->s_writepages_rwsem){++++}-{0:0}, at: ext4_writepages_down_write fs/ext4/ext4.h:1780 [inline]
 #2: ffff88807e4d8c58 (&sbi->s_writepages_rwsem){++++}-{0:0}, at: ext4_ext_migrate+0x321/0x1080 fs/ext4/migrate.c:438

stack backtrace:
CPU: 1 PID: 7463 Comm: syz.1.302 Not tainted syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 04/18/2026
Call Trace:
 <TASK>
 dump_stack_lvl+0x18c/0x250 lib/dump_stack.c:106
 check_noncircular+0x2fc/0x400 kernel/locking/lockdep.c:2187
 check_prev_add kernel/locking/lockdep.c:3134 [inline]
 check_prevs_add kernel/locking/lockdep.c:3253 [inline]
 validate_chain kernel/locking/lockdep.c:3869 [inline]
 __lock_acquire+0x2df1/0x7d40 kernel/locking/lockdep.c:5137
 lock_acquire+0x19e/0x420 kernel/locking/lockdep.c:5754
 down_write+0x97/0x200 kernel/locking/rwsem.c:1573
 ext4_write_lock_xattr fs/ext4/xattr.h:158 [inline]
 ext4_xattr_set_handle+0x19d/0x14c0 fs/ext4/xattr.c:2369
 __ext4_set_acl+0x56f/0x650 fs/ext4/acl.c:217
 ext4_init_acl+0x24d/0x330 fs/ext4/acl.c:297
 __ext4_new_inode+0x2f27/0x3ac0 fs/ext4/ialloc.c:1332
 ext4_ext_migrate+0x6f0/0x1080 fs/ext4/migrate.c:456
 __ext4_ioctl fs/ext4/ioctl.c:1412 [inline]
 ext4_ioctl+0x1ee3/0x3b80 fs/ext4/ioctl.c:1630
 vfs_ioctl fs/ioctl.c:51 [inline]
 __do_sys_ioctl fs/ioctl.c:871 [inline]
 __se_sys_ioctl+0xfd/0x170 fs/ioctl.c:857
 do_syscall_x64 arch/x86/entry/common.c:46 [inline]
 do_syscall_64+0x55/0xb0 arch/x86/entry/common.c:76
 entry_SYSCALL_64_after_hwframe+0x68/0xd2
RIP: 0033:0x7fb11b59ce59
Code: ff c3 66 2e 0f 1f 84 00 00 00 00 00 0f 1f 44 00 00 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 e8 ff ff ff f7 d8 64 89 01 48
RSP: 002b:00007fb11c4f8028 EFLAGS: 00000246 ORIG_RAX: 0000000000000010
RAX: ffffffffffffffda RBX: 00007fb11b816090 RCX: 00007fb11b59ce59
RDX: 0000000000000000 RSI: 0000000000006609 RDI: 0000000000000007
RBP: 00007fb11b632d6f R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000
R13: 00007fb11b816128 R14: 00007fb11b816090 R15: 00007ffef8dbc238
 </TASK>
BUG: unable to handle page fault for address: ffffffffffffffec
#PF: supervisor read access in kernel mode
#PF: error_code(0x0000) - not-present page
PGD cf35067 P4D cf35067 PUD cf37067 PMD 0 
Oops: 0000 [#1] PREEMPT SMP KASAN
CPU: 0 PID: 7463 Comm: syz.1.302 Not tainted syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 04/18/2026
RIP: 0010:ext4_ext_drop_refs fs/ext4/extents.c:119 [inline]
RIP: 0010:ext4_free_ext_path+0x45/0x110 fs/ext4/extents.c:128
Code: 85 db 0f 84 b0 00 00 00 49 bf 00 00 00 00 00 fc ff df 48 8d 7b 08 48 89 f8 48 c1 e8 03 42 0f b6 04 38 84 c0 0f 85 a9 00 00 00 <0f> b7 43 08 c1 e0 04 48 8d 04 40 48 89 44 24 08 48 8d 43 28 48 89
RSP: 0018:ffffc9000bd77638 EFLAGS: 00010246
RAX: 0000000000000000 RBX: ffffffffffffffe4 RCX: 0000000000080000
RDX: ffffc9000e1be000 RSI: 000000000007ffff RDI: ffffffffffffffec
RBP: ffffc9000bd77758 R08: ffff88805d53d21f R09: 1ffff1100baa7a43
R10: dffffc0000000000 R11: ffffed100baa7a44 R12: ffff88805d53d2b0
R13: ffffffffffffffe4 R14: dffffc0000000000 R15: dffffc0000000000
FS:  00007fb11c4f86c0(0000) GS:ffff8880b8e00000(0000) knlGS:0000000000000000
CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: ffffffffffffffec CR3: 000000005c229000 CR4: 00000000003526f0
Call Trace:
 <TASK>
 finish_range+0x234/0x340 fs/ext4/migrate.c:60
 update_extent_range fs/ext4/migrate.c:83 [inline]
 update_ind_extent_range+0x2e3/0x520 fs/ext4/migrate.c:106
 ext4_ext_migrate+0xb07/0x1080 fs/ext4/migrate.c:522
 __ext4_ioctl fs/ext4/ioctl.c:1412 [inline]
 ext4_ioctl+0x1ee3/0x3b80 fs/ext4/ioctl.c:1630
 vfs_ioctl fs/ioctl.c:51 [inline]
 __do_sys_ioctl fs/ioctl.c:871 [inline]
 __se_sys_ioctl+0xfd/0x170 fs/ioctl.c:857
 do_syscall_x64 arch/x86/entry/common.c:46 [inline]
 do_syscall_64+0x55/0xb0 arch/x86/entry/common.c:76
 entry_SYSCALL_64_after_hwframe+0x68/0xd2
RIP: 0033:0x7fb11b59ce59
Code: ff c3 66 2e 0f 1f 84 00 00 00 00 00 0f 1f 44 00 00 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 e8 ff ff ff f7 d8 64 89 01 48
RSP: 002b:00007fb11c4f8028 EFLAGS: 00000246 ORIG_RAX: 0000000000000010
RAX: ffffffffffffffda RBX: 00007fb11b816090 RCX: 00007fb11b59ce59
RDX: 0000000000000000 RSI: 0000000000006609 RDI: 0000000000000007
RBP: 00007fb11b632d6f R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000
R13: 00007fb11b816128 R14: 00007fb11b816090 R15: 00007ffef8dbc238
 </TASK>
Modules linked in:
CR2: ffffffffffffffec
---[ end trace 0000000000000000 ]---
RIP: 0010:ext4_ext_drop_refs fs/ext4/extents.c:119 [inline]
RIP: 0010:ext4_free_ext_path+0x45/0x110 fs/ext4/extents.c:128
Code: 85 db 0f 84 b0 00 00 00 49 bf 00 00 00 00 00 fc ff df 48 8d 7b 08 48 89 f8 48 c1 e8 03 42 0f b6 04 38 84 c0 0f 85 a9 00 00 00 <0f> b7 43 08 c1 e0 04 48 8d 04 40 48 89 44 24 08 48 8d 43 28 48 89
RSP: 0018:ffffc9000bd77638 EFLAGS: 00010246
RAX: 0000000000000000 RBX: ffffffffffffffe4 RCX: 0000000000080000
RDX: ffffc9000e1be000 RSI: 000000000007ffff RDI: ffffffffffffffec
RBP: ffffc9000bd77758 R08: ffff88805d53d21f R09: 1ffff1100baa7a43
R10: dffffc0000000000 R11: ffffed100baa7a44 R12: ffff88805d53d2b0
R13: ffffffffffffffe4 R14: dffffc0000000000 R15: dffffc0000000000
FS:  00007fb11c4f86c0(0000) GS:ffff8880b8e00000(0000) knlGS:0000000000000000
CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: ffffffffffffffec CR3: 000000005c229000 CR4: 00000000003526f0
----------------
Code disassembly (best guess):
   0:	85 db                	test   %ebx,%ebx
   2:	0f 84 b0 00 00 00    	je     0xb8
   8:	49 bf 00 00 00 00 00 	movabs $0xdffffc0000000000,%r15
   f:	fc ff df
  12:	48 8d 7b 08          	lea    0x8(%rbx),%rdi
  16:	48 89 f8             	mov    %rdi,%rax
  19:	48 c1 e8 03          	shr    $0x3,%rax
  1d:	42 0f b6 04 38       	movzbl (%rax,%r15,1),%eax
  22:	84 c0                	test   %al,%al
  24:	0f 85 a9 00 00 00    	jne    0xd3
* 2a:	0f b7 43 08          	movzwl 0x8(%rbx),%eax <-- trapping instruction
  2e:	c1 e0 04             	shl    $0x4,%eax
  31:	48 8d 04 40          	lea    (%rax,%rax,2),%rax
  35:	48 89 44 24 08       	mov    %rax,0x8(%rsp)
  3a:	48 8d 43 28          	lea    0x28(%rbx),%rax
  3e:	48                   	rex.W
  3f:	89                   	.byte 0x89

Crashes (2):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2026/05/20 20:55 linux-6.6.y eac8889a3a1c 62fb93a2 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-6-kasan possible deadlock in ext4_xattr_set_handle
2026/05/12 19:16 linux-6.6.y 3b9f64db0496 07aeade5 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-6-kasan possible deadlock in ext4_xattr_set_handle
* Struck through repros no longer work on HEAD.