[v5.15] possible deadlock in add_transaction_credits

0 views
Skip to first unread message

syzbot

unread,
Jul 28, 2026, 9:17:41 AMJul 28
to syzkaller...@googlegroups.com
Hello,

syzbot found the following issue on:

HEAD commit: 674f684f7c61 Linux 5.15.212
git tree: linux-5.15.y
console output: https://syzkaller.appspot.com/x/log.txt?x=1755249e580000
kernel config: https://syzkaller.appspot.com/x/.config?x=f161cbc9aef65db0
dashboard link: https://syzkaller.appspot.com/bug?extid=b754fb31c4b14ae5eda5
compiler: Debian clang version 22.1.8 (++20260613092233+e80beda6e255-1~exp1~20260613092250.77), Debian LLD 22.1.8

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

Downloadable assets:
disk image: https://storage.googleapis.com/syzbot-assets/f55be2937b89/disk-674f684f.raw.xz
vmlinux: https://storage.googleapis.com/syzbot-assets/a19fb0ffc049/vmlinux-674f684f.xz
kernel image: https://storage.googleapis.com/syzbot-assets/365d4529a007/bzImage-674f684f.xz

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

======================================================
WARNING: possible circular locking dependency detected
syzkaller #0 Not tainted
------------------------------------------------------
kworker/u4:6/4452 is trying to acquire lock:
ffff88802c72a990 (jbd2_handle){++++}-{0:0}, at: add_transaction_credits+0x6fb/0xcb0 fs/jbd2/transaction.c:315

but task is already holding lock:
ffff88802c728c58 (&sbi->s_writepages_rwsem){.+.+}-{0:0}, at: ext4_writepages+0x213/0x2d40 fs/ext4/inode.c:2691

which lock already depends on the new lock.


the existing dependency chain (in reverse order) is:

-> #2 (&sbi->s_writepages_rwsem){.+.+}-{0:0}:
percpu_down_read+0x46/0x1b0 include/linux/percpu-rwsem.h:51
ext4_writepages+0x213/0x2d40 fs/ext4/inode.c:2691
do_writepages+0x493/0x700 mm/page-writeback.c:2386
__writeback_single_inode+0x153/0xda0 fs/fs-writeback.c:1657
writeback_single_inode+0x3d2/0x8e0 fs/fs-writeback.c:1770
write_inode_now+0x23b/0x2c0 fs/fs-writeback.c:2817
iput_final fs/inode.c:1756 [inline]
iput+0x599/0x880 fs/inode.c:1795
ext4_xattr_set_entry+0x1d76/0x3f70 fs/ext4/xattr.c:1827
ext4_xattr_block_set+0x8a7/0x2ce0 fs/ext4/xattr.c:1995
ext4_xattr_move_to_block fs/ext4/xattr.c:2620 [inline]
ext4_xattr_make_inode_space fs/ext4/xattr.c:2695 [inline]
ext4_expand_extra_isize_ea+0xebe/0x18e0 fs/ext4/xattr.c:2783
__ext4_expand_extra_isize+0x301/0x3e0 fs/ext4/inode.c:5924
ext4_try_to_expand_extra_isize fs/ext4/inode.c:5967 [inline]
__ext4_mark_inode_dirty+0x444/0x6c0 fs/ext4/inode.c:6045
ext4_evict_inode+0xa55/0x1050 fs/ext4/inode.c:284
evict+0x4b6/0x8b0 fs/inode.c:647
ext4_orphan_cleanup+0xad8/0x1320 fs/ext4/orphan.c:472
ext4_fill_super+0x8c65/0x93f0 fs/ext4/super.c:5006
mount_bdev+0x28a/0x3c0 fs/super.c:1400
legacy_get_tree+0xe6/0x180 fs/fs_context.c:611
vfs_get_tree+0x88/0x270 fs/super.c:1530
do_new_mount+0x247/0xa40 fs/namespace.c:3034
do_mount fs/namespace.c:3377 [inline]
__do_sys_mount fs/namespace.c:3585 [inline]
__se_sys_mount+0x2e3/0x3d0 fs/namespace.c:3562
do_syscall_x64 arch/x86/entry/common.c:50 [inline]
do_syscall_64+0x4c/0xa0 arch/x86/entry/common.c:80
entry_SYSCALL_64_after_hwframe+0x66/0xd0

-> #1 (&ei->xattr_sem){++++}-{3:3}:
down_read+0x44/0x2e0 kernel/locking/rwsem.c:1498
ext4_setattr+0x736/0x1b70 fs/ext4/inode.c:5476
notify_change+0xbc6/0xee0 fs/attr.c:505
chown_common+0x4cc/0x680 fs/open.c:680
do_fchownat+0x147/0x240 fs/open.c:711
__do_sys_chown fs/open.c:731 [inline]
__se_sys_chown fs/open.c:729 [inline]
__x64_sys_chown+0x7e/0x90 fs/open.c:729
do_syscall_x64 arch/x86/entry/common.c:50 [inline]
do_syscall_64+0x4c/0xa0 arch/x86/entry/common.c:80
entry_SYSCALL_64_after_hwframe+0x66/0xd0

-> #0 (jbd2_handle){++++}-{0:0}:
check_prev_add kernel/locking/lockdep.c:3053 [inline]
check_prevs_add kernel/locking/lockdep.c:3172 [inline]
validate_chain kernel/locking/lockdep.c:3788 [inline]
__lock_acquire+0x2c66/0x7b50 kernel/locking/lockdep.c:5012
lock_acquire+0x19e/0x400 kernel/locking/lockdep.c:5623
add_transaction_credits+0x717/0xcb0 fs/jbd2/transaction.c:315
start_this_handle+0x723/0x1560 fs/jbd2/transaction.c:423
jbd2__journal_start+0x2b7/0x5a0 fs/jbd2/transaction.c:521
__ext4_journal_start_sb+0x167/0x360 fs/ext4/ext4_jbd2.c:105
__ext4_journal_start fs/ext4/ext4_jbd2.h:326 [inline]
ext4_writepages+0xd7e/0x2d40 fs/ext4/inode.c:2814
do_writepages+0x493/0x700 mm/page-writeback.c:2386
__writeback_single_inode+0x153/0xda0 fs/fs-writeback.c:1657
writeback_sb_inodes+0xaaa/0x1750 fs/fs-writeback.c:1940
__writeback_inodes_wb+0x12a/0x3f0 fs/fs-writeback.c:2011
wb_writeback+0x45e/0xbc0 fs/fs-writeback.c:2116
wb_check_old_data_flush fs/fs-writeback.c:2216 [inline]
wb_do_writeback fs/fs-writeback.c:2269 [inline]
wb_workfn+0xb15/0xf20 fs/fs-writeback.c:2298
process_one_work+0x867/0xff0 kernel/workqueue.c:2310
worker_thread+0xad7/0x12a0 kernel/workqueue.c:2457
kthread+0x42e/0x520 kernel/kthread.c:334
ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:287

other info that might help us debug this:

Chain exists of:
jbd2_handle --> &ei->xattr_sem --> &sbi->s_writepages_rwsem

Possible unsafe locking scenario:

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

*** DEADLOCK ***

4 locks held by kworker/u4:6/4452:
#0: ffff8880197f0138 ((wq_completion)writeback){+.+.}-{0:0}, at: process_one_work+0x75c/0xff0 kernel/workqueue.c:-1
#1: ffffc9000324fd00 ((work_completion)(&(&wb->dwork)->work)){+.+.}-{0:0}, at: process_one_work+0x79e/0xff0 kernel/workqueue.c:2285
#2: ffff88802c7260e0 (&type->s_umount_key#32){++++}-{3:3}, at: trylock_super+0x1c/0xf0 fs/super.c:418
#3: ffff88802c728c58 (&sbi->s_writepages_rwsem){.+.+}-{0:0}, at: ext4_writepages+0x213/0x2d40 fs/ext4/inode.c:2691

stack backtrace:
CPU: 0 PID: 4452 Comm: kworker/u4:6 Not tainted syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 07/16/2026
Workqueue: writeback wb_workfn (flush-8:0)
Call Trace:
<TASK>
dump_stack_lvl+0x188/0x250 lib/dump_stack.c:106
check_noncircular+0x296/0x330 kernel/locking/lockdep.c:2133
check_prev_add kernel/locking/lockdep.c:3053 [inline]
check_prevs_add kernel/locking/lockdep.c:3172 [inline]
validate_chain kernel/locking/lockdep.c:3788 [inline]
__lock_acquire+0x2c66/0x7b50 kernel/locking/lockdep.c:5012
lock_acquire+0x19e/0x400 kernel/locking/lockdep.c:5623
add_transaction_credits+0x717/0xcb0 fs/jbd2/transaction.c:315
start_this_handle+0x723/0x1560 fs/jbd2/transaction.c:423
jbd2__journal_start+0x2b7/0x5a0 fs/jbd2/transaction.c:521
__ext4_journal_start_sb+0x167/0x360 fs/ext4/ext4_jbd2.c:105
__ext4_journal_start fs/ext4/ext4_jbd2.h:326 [inline]
ext4_writepages+0xd7e/0x2d40 fs/ext4/inode.c:2814
do_writepages+0x493/0x700 mm/page-writeback.c:2386
__writeback_single_inode+0x153/0xda0 fs/fs-writeback.c:1657
writeback_sb_inodes+0xaaa/0x1750 fs/fs-writeback.c:1940
__writeback_inodes_wb+0x12a/0x3f0 fs/fs-writeback.c:2011
wb_writeback+0x45e/0xbc0 fs/fs-writeback.c:2116
wb_check_old_data_flush fs/fs-writeback.c:2216 [inline]
wb_do_writeback fs/fs-writeback.c:2269 [inline]
wb_workfn+0xb15/0xf20 fs/fs-writeback.c:2298
process_one_work+0x867/0xff0 kernel/workqueue.c:2310
worker_thread+0xad7/0x12a0 kernel/workqueue.c:2457
kthread+0x42e/0x520 kernel/kthread.c:334
ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:287
</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 syzk...@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 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
Reply all
Reply to author
Forward
0 new messages