REISERFS (device loop1): journal params: device loop1, size 512, journal first block 18, max trans len 256, max batch 225, max commit age 30, max trans age 30
REISERFS (device loop1): checking transaction log (loop1)
REISERFS (device loop1): Using rupasov hash to sort names
REISERFS (device loop1): Created .reiserfs_priv - reserved for xattr storage.
======================================================
WARNING: possible circular locking dependency detected
4.14.295-syzkaller #0 Not tainted
------------------------------------------------------
syz-executor.1/9600 is trying to acquire lock:
 (&journal->j_mutex){+.+.}, at: [<ffffffff81b3272b>] reiserfs_mutex_lock_safe fs/reiserfs/reiserfs.h:816 [inline]
 (&journal->j_mutex){+.+.}, at: [<ffffffff81b3272b>] lock_journal fs/reiserfs/journal.c:537 [inline]
 (&journal->j_mutex){+.+.}, at: [<ffffffff81b3272b>] do_journal_begin_r+0x26b/0xde0 fs/reiserfs/journal.c:3054

but task is already holding lock:
 (sb_writers#13){.+.+}, at: [<ffffffff818e09ad>] sb_start_write include/linux/fs.h:1551 [inline]
 (sb_writers#13){.+.+}, at: [<ffffffff818e09ad>] mnt_want_write_file+0xfd/0x3b0 fs/namespace.c:497

which lock already depends on the new lock.


the existing dependency chain (in reverse order) is:

-> #2 (sb_writers#13){.+.+}:
       percpu_down_read_preempt_disable include/linux/percpu-rwsem.h:36 [inline]
       percpu_down_read include/linux/percpu-rwsem.h:59 [inline]
       __sb_start_write+0x64/0x260 fs/super.c:1342
       sb_start_write include/linux/fs.h:1551 [inline]
       mnt_want_write_file+0xfd/0x3b0 fs/namespace.c:497
       reiserfs_ioctl+0x18e/0x8b0 fs/reiserfs/ioctl.c:110
       vfs_ioctl fs/ioctl.c:46 [inline]
       file_ioctl fs/ioctl.c:500 [inline]
       do_vfs_ioctl+0x75a/0xff0 fs/ioctl.c:684
       SYSC_ioctl fs/ioctl.c:701 [inline]
       SyS_ioctl+0x7f/0xb0 fs/ioctl.c:692
       do_syscall_64+0x1d5/0x640 arch/x86/entry/common.c:292
       entry_SYSCALL_64_after_hwframe+0x46/0xbb

-> #1 (&sbi->lock){+.+.}:
       __mutex_lock_common kernel/locking/mutex.c:756 [inline]
       __mutex_lock+0xc4/0x1310 kernel/locking/mutex.c:893
       reiserfs_write_lock_nested+0x59/0xd0 fs/reiserfs/lock.c:78
       reiserfs_mutex_lock_safe fs/reiserfs/reiserfs.h:817 [inline]
       lock_journal fs/reiserfs/journal.c:537 [inline]
       do_journal_begin_r+0x276/0xde0 fs/reiserfs/journal.c:3054
       journal_begin+0x162/0x3d0 fs/reiserfs/journal.c:3262
       reiserfs_fill_super+0x18f4/0x2990 fs/reiserfs/super.c:2117
       mount_bdev+0x2b3/0x360 fs/super.c:1134
       mount_fs+0x92/0x2a0 fs/super.c:1237
       vfs_kern_mount.part.0+0x5b/0x470 fs/namespace.c:1046
       vfs_kern_mount fs/namespace.c:1036 [inline]
       do_new_mount fs/namespace.c:2572 [inline]
       do_mount+0xe65/0x2a30 fs/namespace.c:2905
       SYSC_mount fs/namespace.c:3121 [inline]
       SyS_mount+0xa8/0x120 fs/namespace.c:3098
       do_syscall_64+0x1d5/0x640 arch/x86/entry/common.c:292
       entry_SYSCALL_64_after_hwframe+0x46/0xbb

-> #0 (&journal->j_mutex){+.+.}:
       lock_acquire+0x170/0x3f0 kernel/locking/lockdep.c:3998
       __mutex_lock_common kernel/locking/mutex.c:756 [inline]
       __mutex_lock+0xc4/0x1310 kernel/locking/mutex.c:893
       reiserfs_mutex_lock_safe fs/reiserfs/reiserfs.h:816 [inline]
       lock_journal fs/reiserfs/journal.c:537 [inline]
       do_journal_begin_r+0x26b/0xde0 fs/reiserfs/journal.c:3054
       journal_begin+0x162/0x3d0 fs/reiserfs/journal.c:3262
       reiserfs_dirty_inode+0xd9/0x200 fs/reiserfs/super.c:716
       __mark_inode_dirty+0x11e/0xf40 fs/fs-writeback.c:2134
       mark_inode_dirty include/linux/fs.h:2026 [inline]
       reiserfs_ioctl+0x6f6/0x8b0 fs/reiserfs/ioctl.c:118
       vfs_ioctl fs/ioctl.c:46 [inline]
       file_ioctl fs/ioctl.c:500 [inline]
       do_vfs_ioctl+0x75a/0xff0 fs/ioctl.c:684
       SYSC_ioctl fs/ioctl.c:701 [inline]
       SyS_ioctl+0x7f/0xb0 fs/ioctl.c:692
       do_syscall_64+0x1d5/0x640 arch/x86/entry/common.c:292
       entry_SYSCALL_64_after_hwframe+0x46/0xbb

other info that might help us debug this:

Chain exists of:
  &journal->j_mutex --> &sbi->lock --> sb_writers#13

 Possible unsafe locking scenario:

       CPU0                    CPU1
       ----                    ----
  lock(sb_writers#13);
                               lock(&sbi->lock);
                               lock(sb_writers#13);
  lock(&journal->j_mutex);

 *** DEADLOCK ***

1 lock held by syz-executor.1/9600:
 #0:  (sb_writers#13){.+.+}, at: [<ffffffff818e09ad>] sb_start_write include/linux/fs.h:1551 [inline]
 #0:  (sb_writers#13){.+.+}, at: [<ffffffff818e09ad>] mnt_want_write_file+0xfd/0x3b0 fs/namespace.c:497

stack backtrace:
CPU: 0 PID: 9600 Comm: syz-executor.1 Not tainted 4.14.295-syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 10/11/2022
Call Trace:
 __dump_stack lib/dump_stack.c:17 [inline]
 dump_stack+0x1b2/0x281 lib/dump_stack.c:58
 print_circular_bug.constprop.0.cold+0x2d7/0x41e kernel/locking/lockdep.c:1258
 check_prev_add kernel/locking/lockdep.c:1905 [inline]
 check_prevs_add kernel/locking/lockdep.c:2022 [inline]
 validate_chain kernel/locking/lockdep.c:2464 [inline]
 __lock_acquire+0x2e0e/0x3f20 kernel/locking/lockdep.c:3491
 lock_acquire+0x170/0x3f0 kernel/locking/lockdep.c:3998
 __mutex_lock_common kernel/locking/mutex.c:756 [inline]
 __mutex_lock+0xc4/0x1310 kernel/locking/mutex.c:893
 reiserfs_mutex_lock_safe fs/reiserfs/reiserfs.h:816 [inline]
 lock_journal fs/reiserfs/journal.c:537 [inline]
 do_journal_begin_r+0x26b/0xde0 fs/reiserfs/journal.c:3054
 journal_begin+0x162/0x3d0 fs/reiserfs/journal.c:3262
 reiserfs_dirty_inode+0xd9/0x200 fs/reiserfs/super.c:716
 __mark_inode_dirty+0x11e/0xf40 fs/fs-writeback.c:2134
 mark_inode_dirty include/linux/fs.h:2026 [inline]
 reiserfs_ioctl+0x6f6/0x8b0 fs/reiserfs/ioctl.c:118
 vfs_ioctl fs/ioctl.c:46 [inline]
 file_ioctl fs/ioctl.c:500 [inline]
 do_vfs_ioctl+0x75a/0xff0 fs/ioctl.c:684
 SYSC_ioctl fs/ioctl.c:701 [inline]
 SyS_ioctl+0x7f/0xb0 fs/ioctl.c:692
 do_syscall_64+0x1d5/0x640 arch/x86/entry/common.c:292
 entry_SYSCALL_64_after_hwframe+0x46/0xbb
RIP: 0033:0x7f30603aa5f9
RSP: 002b:00007f305ed1d168 EFLAGS: 00000246 ORIG_RAX: 0000000000000010
RAX: ffffffffffffffda RBX: 00007f30604caf80 RCX: 00007f30603aa5f9
RDX: 0000000020000080 RSI: 0000000040087602 RDI: 0000000000000005
RBP: 00007f30604057b0 R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000
R13: 00007ffd7f92f6bf R14: 00007f305ed1d300 R15: 0000000000022000
ntfs: (device loop2): parse_options(): Unrecognized mount option appraise.
ntfs: (device loop2): parse_options(): Unrecognized mount option euid.
ntfs: (device loop2): parse_options(): Unrecognized mount option .
syz-executor.3 uses old SIOCAX25GETINFO
print_req_error: I/O error, dev loop4, sector 0
Buffer I/O error on dev loop4, logical block 0, async page read
print_req_error: I/O error, dev loop4, sector 4
Buffer I/O error on dev loop4, logical block 2, async page read
print_req_error: I/O error, dev loop4, sector 6
Buffer I/O error on dev loop4, logical block 3, async page read
ntfs: (device loop2): parse_options(): Unrecognized mount option appraise.
ntfs: (device loop2): parse_options(): Unrecognized mount option euid.
ntfs: (device loop2): parse_options(): Unrecognized mount option .
print_req_error: I/O error, dev loop4, sector 0
Buffer I/O error on dev loop4, logical block 0, async page read
print_req_error: I/O error, dev loop4, sector 4
Buffer I/O error on dev loop4, logical block 2, async page read
print_req_error: I/O error, dev loop4, sector 6
Buffer I/O error on dev loop4, logical block 3, async page read
REISERFS (device loop1): found reiserfs format "3.6" with non-standard journal
ntfs: (device loop5): parse_options(): Unrecognized mount option appraise.
ntfs: (device loop5): parse_options(): Unrecognized mount option euid.
ntfs: (device loop5): parse_options(): Unrecognized mount option .
REISERFS (device loop1): using ordered data mode
reiserfs: using flush barriers
REISERFS (device loop1): journal params: device loop1, size 512, journal first block 18, max trans len 256, max batch 225, max commit age 30, max trans age 30
REISERFS (device loop1): checking transaction log (loop1)
REISERFS (device loop1): Using rupasov hash to sort names
ntfs: (device loop4): parse_options(): Unrecognized mount option appraise.
REISERFS (device loop1): Created .reiserfs_priv - reserved for xattr storage.
print_req_error: I/O error, dev loop3, sector 0
print_req_error: I/O error, dev loop2, sector 0
print_req_error: I/O error, dev loop5, sector 0
REISERFS (device loop1): found reiserfs format "3.6" with non-standard journal
REISERFS (device loop1): using ordered data mode
print_req_error: I/O error, dev loop3, sector 0
reiserfs: using flush barriers
REISERFS (device loop1): journal params: device loop1, size 512, journal first block 18, max trans len 256, max batch 225, max commit age 30, max trans age 30
REISERFS (device loop1): checking transaction log (loop1)
REISERFS (device loop1): Using rupasov hash to sort names
REISERFS (device loop1): Created .reiserfs_priv - reserved for xattr storage.
REISERFS (device loop5): found reiserfs format "3.6" with non-standard journal
REISERFS (device loop5): using ordered data mode
REISERFS (device loop2): found reiserfs format "3.6" with non-standard journal
reiserfs: using flush barriers
REISERFS (device loop2): using ordered data mode
REISERFS (device loop5): journal params: device loop5, size 512, journal first block 18, max trans len 256, max batch 225, max commit age 30, max trans age 30
reiserfs: using flush barriers
REISERFS (device loop2): journal params: device loop2, size 512, journal first block 18, max trans len 256, max batch 225, max commit age 30, max trans age 30
REISERFS (device loop2): checking transaction log (loop2)
REISERFS (device loop5): checking transaction log (loop5)
REISERFS (device loop2): Using rupasov hash to sort names
REISERFS (device loop5): Using rupasov hash to sort names
REISERFS (device loop5): Created .reiserfs_priv - reserved for xattr storage.
REISERFS (device loop2): Created .reiserfs_priv - reserved for xattr storage.
REISERFS (device loop1): found reiserfs format "3.6" with non-standard journal
REISERFS (device loop2): found reiserfs format "3.6" with non-standard journal
REISERFS (device loop5): found reiserfs format "3.6" with non-standard journal
REISERFS (device loop5): using ordered data mode
REISERFS (device loop1): using ordered data mode
REISERFS (device loop2): using ordered data mode
reiserfs: using flush barriers
reiserfs: using flush barriers
reiserfs: using flush barriers
device lo entered promiscuous mode
REISERFS (device loop5): journal params: device loop5, size 512, journal first block 18, max trans len 256, max batch 225, max commit age 30, max trans age 30
REISERFS (device loop1): journal params: device loop1, size 512, journal first block 18, max trans len 256, max batch 225, max commit age 30, max trans age 30
Y�4��`Ҙ: renamed from lo
REISERFS (device loop2): journal params: device loop2, size 512, journal first block 18, max trans len 256, max batch 225, max commit age 30, max trans age 30
REISERFS (device loop5): checking transaction log (loop5)
REISERFS (device loop1): checking transaction log (loop1)
REISERFS (device loop2): checking transaction log (loop2)
REISERFS (device loop5): Using rupasov hash to sort names
REISERFS (device loop1): Using rupasov hash to sort names
REISERFS (device loop5): Created .reiserfs_priv - reserved for xattr storage.
REISERFS (device loop2): Using rupasov hash to sort names
REISERFS (device loop1): Created .reiserfs_priv - reserved for xattr storage.
REISERFS (device loop2): Created .reiserfs_priv - reserved for xattr storage.
device lo entered promiscuous mode
Y�4��`Ҙ: renamed from lo
REISERFS (device loop5): found reiserfs format "3.6" with non-standard journal
device lo entered promiscuous mode
REISERFS (device loop5): using ordered data mode
REISERFS (device loop2): found reiserfs format "3.6" with non-standard journal
Y�4��`Ҙ: renamed from lo
REISERFS (device loop2): using ordered data mode
reiserfs: using flush barriers
REISERFS (device loop2): journal params: device loop2, size 512, journal first block 18, max trans len 256, max batch 225, max commit age 30, max trans age 30
reiserfs: using flush barriers
REISERFS (device loop5): journal params: device loop5, size 512, journal first block 18, max trans len 256, max batch 225, max commit age 30, max trans age 30
device lo entered promiscuous mode
Y�4��`Ҙ: renamed from lo
REISERFS (device loop2): checking transaction log (loop2)
REISERFS (device loop5): checking transaction log (loop5)
REISERFS (device loop2): Using rupasov hash to sort names
REISERFS (device loop2): Created .reiserfs_priv - reserved for xattr storage.
REISERFS (device loop5): Using rupasov hash to sort names
REISERFS (device loop5): Created .reiserfs_priv - reserved for xattr storage.
input: syz0 as /devices/virtual/input/input5
device lo entered promiscuous mode
usb usb9: usbfs: process 10067 (syz-executor.4) did not claim interface 0 before use
input: syz0 as /devices/virtual/input/input6
�8!��}�Y�4��`: renamed from lo
hrtimer: interrupt took 20162 ns
usb usb9: usbfs: process 10102 (syz-executor.4) did not claim interface 0 before use
input: syz0 as /devices/virtual/input/input8
input: syz0 as /devices/virtual/input/input7
usb usb9: usbfs: process 10130 (syz-executor.4) did not claim interface 0 before use
input: syz0 as /devices/virtual/input/input9
input: syz0 as /devices/virtual/input/input10
usb usb9: usbfs: process 10142 (syz-executor.4) did not claim interface 0 before use
input: syz0 as /devices/virtual/input/input11
device lo entered promiscuous mode
�8!��}�Y�4��`: renamed from lo
Bluetooth: hci5 command 0x0405 tx timeout
netlink: 64 bytes leftover after parsing attributes in process `syz-executor.0'.
sd 0:0:1:0: tag#537 FAILED Result: hostbyte=DID_ERROR driverbyte=DRIVER_OK
sd 0:0:1:0: tag#537 CDB: Read(6) 08 00 00 00 00 00
netlink: 64 bytes leftover after parsing attributes in process `syz-executor.0'.
netlink: 64 bytes leftover after parsing attributes in process `syz-executor.1'.
sd 0:0:1:0: tag#545 FAILED Result: hostbyte=DID_ERROR driverbyte=DRIVER_OK
sd 0:0:1:0: tag#545 CDB: Read(6) 08 00 00 00 00 00
netlink: 64 bytes leftover after parsing attributes in process `syz-executor.2'.
netlink: 64 bytes leftover after parsing attributes in process `syz-executor.0'.
netlink: 64 bytes leftover after parsing attributes in process `syz-executor.1'.
sd 0:0:1:0: tag#551 FAILED Result: hostbyte=DID_ERROR driverbyte=DRIVER_OK
sd 0:0:1:0: tag#551 CDB: Read(6) 08 00 00 00 00 00
sd 0:0:1:0: tag#550 FAILED Result: hostbyte=DID_ERROR driverbyte=DRIVER_OK
sd 0:0:1:0: tag#550 CDB: Read(6) 08 00 00 00 00 00
netlink: 64 bytes leftover after parsing attributes in process `syz-executor.2'.
netlink: 64 bytes leftover after parsing attributes in process `syz-executor.0'.
netlink: 64 bytes leftover after parsing attributes in process `syz-executor.1'.
sd 0:0:1:0: tag#556 FAILED Result: hostbyte=DID_ERROR driverbyte=DRIVER_OK
sd 0:0:1:0: tag#556 CDB: Read(6) 08 00 00 00 00 00
sd 0:0:1:0: tag#558 FAILED Result: hostbyte=DID_ERROR driverbyte=DRIVER_OK
sd 0:0:1:0: tag#558 CDB: Read(6) 08 00 00 00 00 00
netlink: 64 bytes leftover after parsing attributes in process `syz-executor.2'.
sd 0:0:1:0: tag#559 FAILED Result: hostbyte=DID_ERROR driverbyte=DRIVER_OK
sd 0:0:1:0: tag#559 CDB: Read(6) 08 00 00 00 00 00
sd 0:0:1:0: tag#560 FAILED Result: hostbyte=DID_ERROR driverbyte=DRIVER_OK
sd 0:0:1:0: tag#560 CDB: Read(6) 08 00 00 00 00 00
sd 0:0:1:0: tag#566 FAILED Result: hostbyte=DID_ERROR driverbyte=DRIVER_OK
sd 0:0:1:0: tag#566 CDB: Read(6) 08 00 00 00 00 00
input: syz1 as /devices/virtual/input/input12
sd 0:0:1:0: tag#568 FAILED Result: hostbyte=DID_ERROR driverbyte=DRIVER_OK
sd 0:0:1:0: tag#568 CDB: Read(6) 08 00 00 00 00 00
kauditd_printk_skb: 29 callbacks suppressed
audit: type=1804 audit(1666526902.421:2): pid=10556 uid=0 auid=4294967295 ses=4294967295 op="invalid_pcr" cause="open_writers" comm="syz-executor.4" name="/root/syzkaller-testdir3227392173/syzkaller.HJfvac/36/bus" dev="sda1" ino=14048 res=1
audit: type=1804 audit(1666526902.571:3): pid=10565 uid=0 auid=4294967295 ses=4294967295 op="invalid_pcr" cause="ToMToU" comm="syz-executor.4" name="/root/syzkaller-testdir3227392173/syzkaller.HJfvac/36/bus" dev="sda1" ino=14048 res=1
input: syz1 as /devices/virtual/input/input13
audit: type=1804 audit(1666526903.631:4): pid=10641 uid=0 auid=4294967295 ses=4294967295 op="invalid_pcr" cause="open_writers" comm="syz-executor.4" name="/root/syzkaller-testdir3227392173/syzkaller.HJfvac/37/bus" dev="sda1" ino=14074 res=1
input: syz1 as /devices/virtual/input/input14
audit: type=1804 audit(1666526903.981:5): pid=10653 uid=0 auid=4294967295 ses=4294967295 op="invalid_pcr" cause="open_writers" comm="syz-executor.0" name="/root/syzkaller-testdir2080083527/syzkaller.rTJS1x/38/bus" dev="sda1" ino=14082 res=1
audit: type=1804 audit(1666526904.001:6): pid=10654 uid=0 auid=4294967295 ses=4294967295 op="invalid_pcr" cause="open_writers" comm="syz-executor.2" name="/root/syzkaller-testdir3967725428/syzkaller.KWTQl7/38/bus" dev="sda1" ino=14083 res=1