lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <67963a9d.050a0220.2eae65.0038.GAE@google.com>
Date: Sun, 26 Jan 2025 05:37:33 -0800
From: syzbot <syzbot+4a65c3228a624fc51bbd@...kaller.appspotmail.com>
To: kent.overstreet@...ux.dev, linux-bcachefs@...r.kernel.org, 
	linux-kernel@...r.kernel.org, syzkaller-bugs@...glegroups.com
Subject: [syzbot] [bcachefs?] possible deadlock in bch2_journal_halt

Hello,

syzbot found the following issue on:

HEAD commit:    c4b9570cfb63 Merge tag 'audit-pr-20250121' of git://git.ke..
git tree:       upstream
console output: https://syzkaller.appspot.com/x/log.txt?x=17bac9f8580000
kernel config:  https://syzkaller.appspot.com/x/.config?x=5d46425e33fe266e
dashboard link: https://syzkaller.appspot.com/bug?extid=4a65c3228a624fc51bbd
compiler:       Debian clang version 15.0.6, GNU ld (GNU Binutils for Debian) 2.40
syz repro:      https://syzkaller.appspot.com/x/repro.syz?x=159225df980000
C reproducer:   https://syzkaller.appspot.com/x/repro.c?x=13671824580000

Downloadable assets:
disk image (non-bootable): https://storage.googleapis.com/syzbot-assets/7feb34a89c2a/non_bootable_disk-c4b9570c.raw.xz
vmlinux: https://storage.googleapis.com/syzbot-assets/731d6adef14e/vmlinux-c4b9570c.xz
kernel image: https://storage.googleapis.com/syzbot-assets/fba145e47ede/bzImage-c4b9570c.xz
mounted in repro: https://storage.googleapis.com/syzbot-assets/67a3a74f7d49/mount_1.gz

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

bcachefs (loop0): journal_entry_open(): fatal error cannot start: journal seq overflow
============================================
WARNING: possible recursive locking detected
6.13.0-syzkaller-02526-gc4b9570cfb63 #0 Not tainted
--------------------------------------------
kworker/u4:7/1036 is trying to acquire lock:
ffff888044cca980 (&j->lock){+.+.}-{3:3}, at: spin_lock include/linux/spinlock.h:351 [inline]
ffff888044cca980 (&j->lock){+.+.}-{3:3}, at: bch2_journal_halt+0x2f/0x110 fs/bcachefs/journal.c:315

but task is already holding lock:
ffff888044cca980 (&j->lock){+.+.}-{3:3}, at: spin_lock include/linux/spinlock.h:351 [inline]
ffff888044cca980 (&j->lock){+.+.}-{3:3}, at: __journal_res_get+0x497/0x26b0 fs/bcachefs/journal.c:533

other info that might help us debug this:
 Possible unsafe locking scenario:

       CPU0
       ----
  lock(&j->lock);
  lock(&j->lock);

 *** DEADLOCK ***

 May be due to missing lock nesting notation

5 locks held by kworker/u4:7/1036:
 #0: ffff888043693948 ((wq_completion)btree_update){+.+.}-{0:0}, at: process_one_work kernel/workqueue.c:3211 [inline]
 #0: ffff888043693948 ((wq_completion)btree_update){+.+.}-{0:0}, at: process_scheduled_works+0x93b/0x1840 kernel/workqueue.c:3317
 #1: ffffc9000269fc60 ((work_completion)(&c->btree_interior_update_work)){+.+.}-{0:0}, at: process_one_work kernel/workqueue.c:3212 [inline]
 #1: ffffc9000269fc60 ((work_completion)(&c->btree_interior_update_work)){+.+.}-{0:0}, at: process_scheduled_works+0x976/0x1840 kernel/workqueue.c:3317
 #2: ffff888044c84378 (&c->btree_trans_barrier){.+.+}-{0:0}, at: srcu_lock_acquire include/linux/srcu.h:164 [inline]
 #2: ffff888044c84378 (&c->btree_trans_barrier){.+.+}-{0:0}, at: srcu_read_lock include/linux/srcu.h:256 [inline]
 #2: ffff888044c84378 (&c->btree_trans_barrier){.+.+}-{0:0}, at: __bch2_trans_get+0x7e4/0xd30 fs/bcachefs/btree_iter.c:3378
 #3: ffff88804430c140 (bcachefs_btree){+.+.}-{0:0}, at: trans_set_locked fs/bcachefs/btree_locking.h:198 [inline]
 #3: ffff88804430c140 (bcachefs_btree){+.+.}-{0:0}, at: bch2_trans_begin+0x9ca/0x1d90 fs/bcachefs/btree_iter.c:3275
 #4: ffff888044cca980 (&j->lock){+.+.}-{3:3}, at: spin_lock include/linux/spinlock.h:351 [inline]
 #4: ffff888044cca980 (&j->lock){+.+.}-{3:3}, at: __journal_res_get+0x497/0x26b0 fs/bcachefs/journal.c:533

stack backtrace:
CPU: 0 UID: 0 PID: 1036 Comm: kworker/u4:7 Not tainted 6.13.0-syzkaller-02526-gc4b9570cfb63 #0
Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.3-debian-1.16.3-2~bpo12+1 04/01/2014
Workqueue: btree_update btree_interior_update_work
Call Trace:
 <TASK>
 __dump_stack lib/dump_stack.c:94 [inline]
 dump_stack_lvl+0x241/0x360 lib/dump_stack.c:120
 print_deadlock_bug+0x483/0x620 kernel/locking/lockdep.c:3039
 check_deadlock kernel/locking/lockdep.c:3091 [inline]
 validate_chain+0x15e2/0x5920 kernel/locking/lockdep.c:3893
 __lock_acquire+0x1397/0x2100 kernel/locking/lockdep.c:5228
 lock_acquire+0x1ed/0x550 kernel/locking/lockdep.c:5851
 __raw_spin_lock include/linux/spinlock_api_smp.h:133 [inline]
 _raw_spin_lock+0x2e/0x40 kernel/locking/spinlock.c:154
 spin_lock include/linux/spinlock.h:351 [inline]
 bch2_journal_halt+0x2f/0x110 fs/bcachefs/journal.c:315
 bch2_fs_emergency_read_only+0x50/0xc0 fs/bcachefs/super.c:407
 bch2_fatal_error+0x15/0x40 fs/bcachefs/error.c:49
 journal_entry_open fs/bcachefs/journal.c:385 [inline]
 __journal_res_get+0xbef/0x26b0 fs/bcachefs/journal.c:557
 bch2_journal_res_get_slowpath+0xe6/0x710 fs/bcachefs/journal.c:619
 bch2_journal_res_get fs/bcachefs/journal.h:383 [inline]
 bch2_trans_journal_res_get fs/bcachefs/btree_trans_commit.c:350 [inline]
 bch2_trans_commit_write_locked fs/bcachefs/btree_trans_commit.c:652 [inline]
 do_bch2_trans_commit fs/bcachefs/btree_trans_commit.c:866 [inline]
 __bch2_trans_commit+0x353c/0x97a0 fs/bcachefs/btree_trans_commit.c:1066
 bch2_trans_commit fs/bcachefs/btree_update.h:183 [inline]
 btree_update_nodes_written fs/bcachefs/btree_update_interior.c:706 [inline]
 btree_interior_update_work+0x1449/0x2a70 fs/bcachefs/btree_update_interior.c:844
 process_one_work kernel/workqueue.c:3236 [inline]
 process_scheduled_works+0xa66/0x1840 kernel/workqueue.c:3317
 worker_thread+0x870/0xd30 kernel/workqueue.c:3398
 kthread+0x7a9/0x920 kernel/kthread.c:464
 ret_from_fork+0x4b/0x80 arch/x86/kernel/process.c:148
 ret_from_fork_asm+0x1a/0x30 arch/x86/entry/entry_64.S:244
 </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@...glegroups.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

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ