[reiserfs?] possible deadlock in open_xa_dir

5 views
Skip to first unread message

syzbot

unread,
Dec 29, 2022, 10:01:50 AM12/29/22
to syzkaller...@googlegroups.com
Hello,

syzbot found the following issue on:

HEAD commit: 3f8a27f9e27b Linux 4.19.211
git tree: linux-4.19.y
console output: https://syzkaller.appspot.com/x/log.txt?x=1732dc54480000
kernel config: https://syzkaller.appspot.com/x/.config?x=9b9277b418617afe
dashboard link: https://syzkaller.appspot.com/bug?extid=131c496feb33821a856b
compiler: gcc version 10.2.1 20210110 (Debian 10.2.1-6)

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

Downloadable assets:
disk image: https://storage.googleapis.com/syzbot-assets/98c0bdb4abb3/disk-3f8a27f9.raw.xz
vmlinux: https://storage.googleapis.com/syzbot-assets/ea228ff02669/vmlinux-3f8a27f9.xz

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

REISERFS (device loop2): Using r5 hash to sort names
REISERFS (device loop2): Created .reiserfs_priv - reserved for xattr storage.
REISERFS (device loop4): Using r5 hash to sort names
REISERFS (device loop4): Created .reiserfs_priv - reserved for xattr storage.
======================================================
WARNING: possible circular locking dependency detected
4.19.211-syzkaller #0 Not tainted
------------------------------------------------------
syz-executor.1/2082 is trying to acquire lock:
00000000628c7737 (&type->i_mutex_dir_key#16/3){+.+.}, at: inode_lock_nested include/linux/fs.h:783 [inline]
00000000628c7737 (&type->i_mutex_dir_key#16/3){+.+.}, at: open_xa_root fs/reiserfs/xattr.c:127 [inline]
00000000628c7737 (&type->i_mutex_dir_key#16/3){+.+.}, at: open_xa_dir+0x127/0x690 fs/reiserfs/xattr.c:152

but task is already holding lock:
000000002f7f34e3 (&sbi->lock){+.+.}, at: reiserfs_write_lock_nested+0x65/0xe0 fs/reiserfs/lock.c:78

which lock already depends on the new lock.


the existing dependency chain (in reverse order) is:

-> #1 (&sbi->lock){+.+.}:
reiserfs_write_lock+0x75/0xf0 fs/reiserfs/lock.c:27
reiserfs_mkdir+0x311/0x980 fs/reiserfs/namei.c:827
open_xa_root fs/reiserfs/xattr.c:136 [inline]
open_xa_dir+0x555/0x690 fs/reiserfs/xattr.c:152
xattr_lookup+0x21/0x3c0 fs/reiserfs/xattr.c:395
reiserfs_xattr_set_handle+0xfd/0xb40 fs/reiserfs/xattr.c:531
reiserfs_xattr_set+0x411/0x570 fs/reiserfs/xattr.c:631
security_set+0x84/0xb0 fs/reiserfs/xattr_security.c:31
__vfs_setxattr+0x10e/0x170 fs/xattr.c:149
__vfs_setxattr_noperm+0x11a/0x420 fs/xattr.c:180
__vfs_setxattr_locked+0x176/0x250 fs/xattr.c:238
vfs_setxattr+0xe5/0x270 fs/xattr.c:255
setxattr+0x23d/0x330 fs/xattr.c:520
path_setxattr+0x170/0x190 fs/xattr.c:539
__do_sys_setxattr fs/xattr.c:554 [inline]
__se_sys_setxattr fs/xattr.c:550 [inline]
__x64_sys_setxattr+0xc0/0x160 fs/xattr.c:550
do_syscall_64+0xf9/0x620 arch/x86/entry/common.c:293
entry_SYSCALL_64_after_hwframe+0x49/0xbe

-> #0 (&type->i_mutex_dir_key#16/3){+.+.}:
down_write_nested+0x36/0x90 kernel/locking/rwsem.c:192
inode_lock_nested include/linux/fs.h:783 [inline]
open_xa_root fs/reiserfs/xattr.c:127 [inline]
open_xa_dir+0x127/0x690 fs/reiserfs/xattr.c:152
reiserfs_for_each_xattr+0x1ab/0x920 fs/reiserfs/xattr.c:252
reiserfs_delete_xattrs+0x1c/0x90 fs/reiserfs/xattr.c:364
reiserfs_evict_inode+0x2e3/0x540 fs/reiserfs/inode.c:53
evict+0x2ed/0x760 fs/inode.c:559
iput_final fs/inode.c:1555 [inline]
iput+0x4f1/0x860 fs/inode.c:1581
reiserfs_create+0x645/0x720 fs/reiserfs/namei.c:687
lookup_open+0x893/0x1a20 fs/namei.c:3235
do_last fs/namei.c:3327 [inline]
path_openat+0x1094/0x2df0 fs/namei.c:3537
do_filp_open+0x18c/0x3f0 fs/namei.c:3567
do_sys_open+0x3b3/0x520 fs/open.c:1085
do_syscall_64+0xf9/0x620 arch/x86/entry/common.c:293
entry_SYSCALL_64_after_hwframe+0x49/0xbe

other info that might help us debug this:

Possible unsafe locking scenario:

CPU0 CPU1
---- ----
lock(&sbi->lock);
lock(&type->i_mutex_dir_key#16/3);
lock(&sbi->lock);
lock(&type->i_mutex_dir_key#16/3);

*** DEADLOCK ***

3 locks held by syz-executor.1/2082:
#0: 00000000d88aceb5 (sb_writers#31){.+.+}, at: sb_start_write include/linux/fs.h:1579 [inline]
#0: 00000000d88aceb5 (sb_writers#31){.+.+}, at: mnt_want_write+0x3a/0xb0 fs/namespace.c:360
#1: 00000000935f7404 (&type->i_mutex_dir_key#16){++++}, at: inode_lock include/linux/fs.h:748 [inline]
#1: 00000000935f7404 (&type->i_mutex_dir_key#16){++++}, at: do_last fs/namei.c:3324 [inline]
#1: 00000000935f7404 (&type->i_mutex_dir_key#16){++++}, at: path_openat+0x1071/0x2df0 fs/namei.c:3537
#2: 000000002f7f34e3 (&sbi->lock){+.+.}, at: reiserfs_write_lock_nested+0x65/0xe0 fs/reiserfs/lock.c:78

stack backtrace:
CPU: 1 PID: 2082 Comm: syz-executor.1 Not tainted 4.19.211-syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 10/26/2022
Call Trace:
__dump_stack lib/dump_stack.c:77 [inline]
dump_stack+0x1fc/0x2ef lib/dump_stack.c:118
print_circular_bug.constprop.0.cold+0x2d7/0x41e kernel/locking/lockdep.c:1222
check_prev_add kernel/locking/lockdep.c:1866 [inline]
check_prevs_add kernel/locking/lockdep.c:1979 [inline]
validate_chain kernel/locking/lockdep.c:2420 [inline]
__lock_acquire+0x30c9/0x3ff0 kernel/locking/lockdep.c:3416
lock_acquire+0x170/0x3c0 kernel/locking/lockdep.c:3908
down_write_nested+0x36/0x90 kernel/locking/rwsem.c:192
inode_lock_nested include/linux/fs.h:783 [inline]
open_xa_root fs/reiserfs/xattr.c:127 [inline]
open_xa_dir+0x127/0x690 fs/reiserfs/xattr.c:152
reiserfs_for_each_xattr+0x1ab/0x920 fs/reiserfs/xattr.c:252
reiserfs_delete_xattrs+0x1c/0x90 fs/reiserfs/xattr.c:364
reiserfs_evict_inode+0x2e3/0x540 fs/reiserfs/inode.c:53
evict+0x2ed/0x760 fs/inode.c:559
iput_final fs/inode.c:1555 [inline]
iput+0x4f1/0x860 fs/inode.c:1581
reiserfs_create+0x645/0x720 fs/reiserfs/namei.c:687
lookup_open+0x893/0x1a20 fs/namei.c:3235
do_last fs/namei.c:3327 [inline]
path_openat+0x1094/0x2df0 fs/namei.c:3537
do_filp_open+0x18c/0x3f0 fs/namei.c:3567
do_sys_open+0x3b3/0x520 fs/open.c:1085
do_syscall_64+0xf9/0x620 arch/x86/entry/common.c:293
entry_SYSCALL_64_after_hwframe+0x49/0xbe
RIP: 0033:0x7f9aae9170a9
Code: 28 00 00 00 75 05 48 83 c4 28 c3 e8 f1 19 00 00 90 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 b8 ff ff ff f7 d8 64 89 01 48
RSP: 002b:00007f9aace89168 EFLAGS: 00000246 ORIG_RAX: 0000000000000055
RAX: ffffffffffffffda RBX: 00007f9aaea36f80 RCX: 00007f9aae9170a9
RDX: 0000000000000000 RSI: 0000000000000000 RDI: 0000000020000000
RBP: 00007f9aae972ae9 R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000
R13: 00007ffeb17c535f R14: 00007f9aace89300 R15: 0000000000022000
EXT4-fs (loop0): mounting ext2 file system using the ext4 subsystem
REISERFS (device loop5): found reiserfs format "3.6" with non-standard journal
EXT4-fs (loop0): orphan cleanup on readonly fs
REISERFS (device loop5): using ordered data mode
reiserfs: using flush barriers
EXT4-fs warning (device loop0): ext4_update_dynamic_rev:860: updating to rev 1 because of new feature flag, running e2fsck is recommended
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
EXT4-fs (loop0): 2 truncates cleaned up
REISERFS (device loop2): found reiserfs format "3.6" with non-standard journal
REISERFS (device loop2): using ordered data mode
EXT4-fs (loop0): mounted filesystem without journal. Opts: ,errors=continue
reiserfs: using flush barriers
REISERFS (device loop5): checking transaction log (loop5)
REISERFS warning (device loop4): super-6502 reiserfs_getopt: unknown mount option "security.capability"
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 loop1): found reiserfs format "3.6" with non-standard journal
REISERFS (device loop2): checking transaction log (loop2)
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 loop5): Using r5 hash to sort names
audit: type=1800 audit(1672326046.697:1002): pid=2249 uid=0 auid=4294967295 ses=4294967295 subj==unconfined op=collect_data cause=failed(directio) comm="syz-executor.4" name="bus" dev="sda1" ino=15750 res=0
REISERFS (device loop5): Created .reiserfs_priv - reserved for xattr storage.
REISERFS (device loop1): checking transaction log (loop1)
REISERFS (device loop2): Using r5 hash to sort names
REISERFS (device loop2): Created .reiserfs_priv - reserved for xattr storage.
audit: type=1800 audit(1672326046.767:1003): pid=2249 uid=0 auid=4294967295 ses=4294967295 subj==unconfined op=collect_data cause=failed(directio) comm="syz-executor.4" name="bus" dev="sda1" ino=15750 res=0
EXT4-fs (loop0): mounting ext2 file system using the ext4 subsystem
EXT4-fs (loop0): orphan cleanup on readonly fs
EXT4-fs warning (device loop0): ext4_update_dynamic_rev:860: updating to rev 1 because of new feature flag, running e2fsck is recommended
REISERFS (device loop1): Using r5 hash to sort names
REISERFS (device loop1): Created .reiserfs_priv - reserved for xattr storage.
EXT4-fs (loop0): 2 truncates cleaned up
EXT4-fs (loop0): mounted filesystem without journal. Opts: ,errors=continue
EXT4-fs (loop0): mounting ext2 file system using the ext4 subsystem
audit: type=1800 audit(1672326047.657:1004): pid=2305 uid=0 auid=4294967295 ses=4294967295 subj==unconfined op=collect_data cause=failed(directio) comm="syz-executor.4" name="bus" dev="sda1" ino=16199 res=0
EXT4-fs (loop0): orphan cleanup on readonly fs
EXT4-fs warning (device loop0): ext4_update_dynamic_rev:860: updating to rev 1 because of new feature flag, running e2fsck is recommended
audit: type=1800 audit(1672326047.677:1005): pid=2305 uid=0 auid=4294967295 ses=4294967295 subj==unconfined op=collect_data cause=failed(directio) comm="syz-executor.4" name="bus" dev="sda1" ino=16199 res=0
EXT4-fs (loop0): 2 truncates cleaned up
REISERFS (device loop2): found reiserfs format "3.6" with non-standard journal
REISERFS warning (device loop5): super-6502 reiserfs_getopt: unknown mount option "security.capability"
EXT4-fs (loop0): mounted filesystem without journal. Opts: ,errors=continue
audit: type=1800 audit(1672326047.767:1006): pid=2305 uid=0 auid=4294967295 ses=4294967295 subj==unconfined op=collect_data cause=failed(directio) comm="syz-executor.4" name="bus" dev="sda1" ino=16199 res=0
REISERFS (device loop2): using ordered data mode
reiserfs: using flush barriers
audit: type=1800 audit(1672326047.807:1007): pid=2320 uid=0 auid=4294967295 ses=4294967295 subj==unconfined op=collect_data cause=failed(directio) comm="syz-executor.1" name="bus" dev="sda1" ino=16189 res=0
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
EXT4-fs (loop0): mounting ext2 file system using the ext4 subsystem
audit: type=1800 audit(1672326047.917:1008): pid=2320 uid=0 auid=4294967295 ses=4294967295 subj==unconfined op=collect_data cause=failed(directio) comm="syz-executor.1" name="bus" dev="sda1" ino=16189 res=0
REISERFS (device loop2): checking transaction log (loop2)
EXT4-fs (loop0): orphan cleanup on readonly fs
EXT4-fs warning (device loop0): ext4_update_dynamic_rev:860: updating to rev 1 because of new feature flag, running e2fsck is recommended
REISERFS (device loop5): found reiserfs format "3.6" with non-standard journal
EXT4-fs (loop0): 2 truncates cleaned up
EXT4-fs (loop0): mounted filesystem without journal. Opts: ,errors=continue
REISERFS (device loop5): using ordered data mode
reiserfs: using flush barriers
REISERFS (device loop2): Using r5 hash to sort names
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 loop2): Created .reiserfs_priv - reserved for xattr storage.
REISERFS (device loop5): checking transaction log (loop5)
ieee802154 phy0 wpan0: encryption failed: -22
ieee802154 phy1 wpan1: encryption failed: -22
REISERFS (device loop5): Using r5 hash to sort names
REISERFS (device loop5): Created .reiserfs_priv - reserved for xattr storage.
REISERFS (device loop1): found reiserfs format "3.6" with non-standard journal
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 r5 hash to sort names
REISERFS (device loop1): Created .reiserfs_priv - reserved for xattr storage.
EXT4-fs (loop0): mounting ext2 file system using the ext4 subsystem
EXT4-fs (loop0): orphan cleanup on readonly fs
EXT4-fs warning (device loop0): ext4_update_dynamic_rev:860: updating to rev 1 because of new feature flag, running e2fsck is recommended
REISERFS (device loop2): found reiserfs format "3.6" with non-standard journal
REISERFS (device loop2): using ordered data mode
reiserfs: using flush barriers
EXT4-fs (loop0): 2 truncates cleaned up
EXT4-fs (loop0): mounted filesystem without journal. Opts: ,errors=continue
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 loop1): found reiserfs format "3.6" with non-standard journal
REISERFS (device loop1): using ordered data mode
reiserfs: using flush barriers
REISERFS (device loop2): checking transaction log (loop2)
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 loop2): Using r5 hash to sort names
REISERFS (device loop2): Created .reiserfs_priv - reserved for xattr storage.
REISERFS (device loop1): Using r5 hash to sort names
REISERFS (device loop1): Created .reiserfs_priv - reserved for xattr storage.
audit: type=1800 audit(1672326050.587:1009): pid=2323 uid=0 auid=4294967295 ses=4294967295 subj==unconfined op=collect_data cause=failed comm="syz-executor.4" name="bus" dev="sda1" ino=16199 res=0
audit: type=1800 audit(1672326050.607:1010): pid=2305 uid=0 auid=4294967295 ses=4294967295 subj==unconfined op=collect_data cause=failed(directio) comm="syz-executor.4" name="bus" dev="sda1" ino=16199 res=0
audit: type=1800 audit(1672326050.607:1011): pid=2331 uid=0 auid=4294967295 ses=4294967295 subj==unconfined op=collect_data cause=failed comm="syz-executor.4" name="bus" dev="sda1" ino=16199 res=0
EXT4-fs (loop1): mounting ext2 file system using the ext4 subsystem
EXT4-fs (loop0): mounting ext2 file system using the ext4 subsystem
EXT4-fs (loop1): orphan cleanup on readonly fs
EXT4-fs warning (device loop1): ext4_update_dynamic_rev:860: updating to rev 1 because of new feature flag, running e2fsck is recommended
EXT4-fs (loop0): orphan cleanup on readonly fs
REISERFS (device loop2): found reiserfs format "3.6" with non-standard journal
REISERFS (device loop2): using ordered data mode
reiserfs: using flush barriers
EXT4-fs warning (device loop0): ext4_update_dynamic_rev:860: updating to rev 1 because of new feature flag, running e2fsck is recommended
EXT4-fs (loop0): 2 truncates cleaned up
EXT4-fs (loop0): mounted filesystem without journal. Opts: ,errors=continue
EXT4-fs (loop1): 2 truncates cleaned up
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
EXT4-fs (loop1): mounted filesystem without journal. Opts: ,errors=continue
REISERFS (device loop5): found reiserfs format "3.6" with non-standard journal
REISERFS (device loop2): checking transaction log (loop2)
REISERFS (device loop5): using ordered data mode
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
EXT4-fs (loop0): mounting ext2 file system using the ext4 subsystem
REISERFS (device loop5): checking transaction log (loop5)
REISERFS (device loop2): Using r5 hash to sort names
EXT4-fs (loop0): orphan cleanup on readonly fs
REISERFS (device loop2): Created .reiserfs_priv - reserved for xattr storage.
EXT4-fs warning (device loop0): ext4_update_dynamic_rev:860: updating to rev 1 because of new feature flag, running e2fsck is recommended
REISERFS (device loop5): Using r5 hash to sort names
EXT4-fs (loop0): 2 truncates cleaned up
EXT4-fs (loop0): mounted filesystem without journal. Opts: ,errors=continue
REISERFS (device loop5): Created .reiserfs_priv - reserved for xattr storage.
REISERFS (device loop4): found reiserfs format "3.6" with non-standard journal
REISERFS (device loop4): using ordered data mode
reiserfs: using flush barriers
REISERFS (device loop4): journal params: device loop4, size 512, journal first block 18, max trans len 256, max batch 225, max commit age 30, max trans age 30
REISERFS (device loop4): checking transaction log (loop4)
REISERFS (device loop4): Using r5 hash to sort names
REISERFS (device loop4): Created .reiserfs_priv - reserved for xattr storage.
EXT4-fs (loop0): mounting ext2 file system using the ext4 subsystem
EXT4-fs (loop1): mounting ext2 file system using the ext4 subsystem
EXT4-fs (loop0): orphan cleanup on readonly fs
EXT4-fs warning (device loop0): ext4_update_dynamic_rev:860: updating to rev 1 because of new feature flag, running e2fsck is recommended
EXT4-fs (loop1): orphan cleanup on readonly fs
REISERFS (device loop4): found reiserfs format "3.6" with non-standard journal
EXT4-fs warning (device loop1): ext4_update_dynamic_rev:860: updating to rev 1 because of new feature flag, running e2fsck is recommended
REISERFS (device loop4): using ordered data mode
REISERFS (device loop2): found reiserfs format "3.6" with non-standard journal
EXT4-fs (loop1): 2 truncates cleaned up
EXT4-fs (loop0): 2 truncates cleaned up
EXT4-fs (loop1): mounted filesystem without journal. Opts: ,errors=continue
REISERFS (device loop2): using ordered data mode
EXT4-fs (loop0): mounted filesystem without journal. Opts: ,errors=continue
reiserfs: using flush barriers
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 loop4): journal params: device loop4, 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 loop4): checking transaction log (loop4)
REISERFS (device loop2): Using r5 hash to sort names
REISERFS (device loop2): Created .reiserfs_priv - reserved for xattr storage.
REISERFS (device loop5): found reiserfs format "3.6" with non-standard journal
EXT4-fs (loop0): mounting ext2 file system using the ext4 subsystem
REISERFS (device loop4): Using r5 hash to sort names
REISERFS (device loop5): using ordered data mode
REISERFS (device loop4): Created .reiserfs_priv - reserved for xattr storage.
reiserfs: using flush barriers
EXT4-fs (loop0): orphan cleanup on readonly fs
EXT4-fs warning (device loop0): ext4_update_dynamic_rev:860: updating to rev 1 because of new feature flag, running e2fsck is recommended
EXT4-fs (loop0): 2 truncates cleaned up
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
EXT4-fs (loop0): mounted filesystem without journal. Opts: ,errors=continue
REISERFS (device loop5): checking transaction log (loop5)
REISERFS (device loop1): found reiserfs format "3.6" with non-standard journal
REISERFS (device loop1): using ordered data mode
reiserfs: using flush barriers
REISERFS (device loop5): Using r5 hash to sort names
REISERFS (device loop5): Created .reiserfs_priv - reserved for xattr storage.
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)
EXT4-fs (loop0): mounting ext2 file system using the ext4 subsystem
EXT4-fs (loop0): orphan cleanup on readonly fs
EXT4-fs warning (device loop0): ext4_update_dynamic_rev:860: updating to rev 1 because of new feature flag, running e2fsck is recommended
REISERFS (device loop1): Using r5 hash to sort names
EXT4-fs (loop0): 2 truncates cleaned up
REISERFS (device loop1): Created .reiserfs_priv - reserved for xattr storage.
REISERFS (device loop4): found reiserfs format "3.6" with non-standard journal
REISERFS (device loop4): using ordered data mode
EXT4-fs (loop0): mounted filesystem without journal. Opts: ,errors=continue
reiserfs: using flush barriers
REISERFS (device loop4): journal params: device loop4, size 512, journal first block 18, max trans len 256, max batch 225, max commit age 30, max trans age 30
REISERFS (device loop2): found reiserfs format "3.6" with non-standard journal
REISERFS (device loop2): using ordered data mode
REISERFS (device loop4): checking transaction log (loop4)
reiserfs: using flush barriers
EXT4-fs (loop0): mounting ext2 file system using the ext4 subsystem
EXT4-fs (loop0): orphan cleanup on readonly fs
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): found reiserfs format "3.6" with non-standard journal
EXT4-fs warning (device loop0): ext4_update_dynamic_rev:860: updating to rev 1 because of new feature flag, running e2fsck is recommended
REISERFS (device loop5): using ordered data mode
EXT4-fs (loop0): 2 truncates cleaned up
EXT4-fs (loop0): mounted filesystem without journal. Opts: ,errors=continue
reiserfs: using flush barriers
REISERFS (device loop4): Using r5 hash to sort names
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 loop2): checking transaction log (loop2)
REISERFS (device loop4): Created .reiserfs_priv - reserved for xattr storage.
REISERFS (device loop5): checking transaction log (loop5)
REISERFS (device loop2): Using r5 hash to sort names
REISERFS (device loop2): Created .reiserfs_priv - reserved for xattr storage.
REISERFS (device loop5): Using r5 hash to sort names
REISERFS (device loop5): Created .reiserfs_priv - reserved for xattr storage.
EXT4-fs (loop0): mounting ext2 file system using the ext4 subsystem
EXT4-fs (loop0): orphan cleanup on readonly fs
EXT4-fs warning (device loop0): ext4_update_dynamic_rev:860: updating to rev 1 because of new feature flag, running e2fsck is recommended
EXT4-fs (loop0): 2 truncates cleaned up
EXT4-fs (loop0): mounted filesystem without journal. Opts: ,errors=continue
REISERFS (device loop4): found reiserfs format "3.6" with non-standard journal
REISERFS (device loop4): using ordered data mode
EXT4-fs (loop0): mounting ext2 file system using the ext4 subsystem
reiserfs: using flush barriers
REISERFS (device loop2): found reiserfs format "3.6" with non-standard journal
REISERFS (device loop2): using ordered data mode
EXT4-fs (loop0): orphan cleanup on readonly fs
REISERFS (device loop4): journal params: device loop4, 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): found reiserfs format "3.6" with non-standard journal
EXT4-fs warning (device loop0): ext4_update_dynamic_rev:860: updating to rev 1 because of new feature flag, running e2fsck is recommended
REISERFS (device loop5): using ordered data mode
REISERFS (device loop1): found reiserfs format "3.6" with non-standard journal
REISERFS (device loop4): checking transaction log (loop4)
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 loop1): using ordered data mode
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
REISERFS (device loop2): checking transaction log (loop2)
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
EXT4-fs (loop0): 2 truncates cleaned up
EXT4-fs (loop0): mounted filesystem without journal. Opts: ,errors=continue
REISERFS (device loop4): Using r5 hash to sort names
REISERFS (device loop4): Created .reiserfs_priv - reserved for xattr storage.
REISERFS (device loop5): checking transaction log (loop5)
REISERFS (device loop1): checking transaction log (loop1)
REISERFS (device loop1): Using r5 hash to sort names
REISERFS (device loop1): Created .reiserfs_priv - reserved for xattr storage.
REISERFS (device loop2): Using r5 hash to sort names
REISERFS (device loop2): Created .reiserfs_priv - reserved for xattr storage.
REISERFS (device loop5): Using r5 hash to sort names
REISERFS (device loop5): Created .reiserfs_priv - reserved for xattr storage.
EXT4-fs (loop0): mounting ext2 file system using the ext4 subsystem
EXT4-fs (loop0): orphan cleanup on readonly fs
REISERFS warning (device loop4): super-6502 reiserfs_getopt: unknown mount option "security.capability"
EXT4-fs warning (device loop0): ext4_update_dynamic_rev:860: updating to rev 1 because of new feature flag, running e2fsck is recommended
REISERFS (device loop5): found reiserfs format "3.6" with non-standard journal
REISERFS (device loop2): found reiserfs format "3.6" with non-standard journal
EXT4-fs (loop0): 2 truncates cleaned up
REISERFS (device loop5): using ordered data mode
EXT4-fs (loop0): mounted filesystem without journal. Opts: ,errors=continue
REISERFS (device loop2): using ordered data mode
reiserfs: using flush barriers
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): 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): found reiserfs format "3.6" with non-standard journal
REISERFS (device loop1): using ordered data mode
REISERFS (device loop5): checking transaction log (loop5)
reiserfs: using flush barriers
REISERFS (device loop4): found reiserfs format "3.6" with non-standard journal
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 loop2): Using r5 hash to sort names
REISERFS (device loop4): using ordered data mode
EXT4-fs (loop0): mounting ext2 file system using the ext4 subsystem
REISERFS (device loop2): Created .reiserfs_priv - reserved for xattr storage.
REISERFS (device loop1): checking transaction log (loop1)
EXT4-fs (loop0): orphan cleanup on readonly fs
reiserfs: using flush barriers
EXT4-fs warning (device loop0): ext4_update_dynamic_rev:860: updating to rev 1 because of new feature flag, running e2fsck is recommended
REISERFS (device loop4): journal params: device loop4, size 512, journal first block 18, max trans len 256, max batch 225, max commit age 30, max trans age 30
EXT4-fs (loop0): 2 truncates cleaned up
EXT4-fs (loop0): mounted filesystem without journal. Opts: ,errors=continue
REISERFS (device loop5): Using r5 hash to sort names
REISERFS (device loop4): checking transaction log (loop4)
REISERFS (device loop5): Created .reiserfs_priv - reserved for xattr storage.
REISERFS (device loop1): Using r5 hash to sort names
REISERFS (device loop1): Created .reiserfs_priv - reserved for xattr storage.
REISERFS (device loop4): Using r5 hash to sort names
REISERFS (device loop4): Created .reiserfs_priv - reserved for xattr storage.
EXT4-fs (loop0): mounting ext2 file system using the ext4 subsystem
EXT4-fs (loop0): orphan cleanup on readonly fs
EXT4-fs warning (device loop0): ext4_update_dynamic_rev:860: updating to rev 1 because of new feature flag, running e2fsck is recommended
REISERFS (device loop2): found reiserfs format "3.6" with non-standard journal
REISERFS (device loop2): using ordered data mode
EXT4-fs (loop0): 2 truncates cleaned up
reiserfs: using flush barriers
EXT4-fs (loop0): mounted filesystem without journal. Opts: ,errors=continue
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


---
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.

syzbot

unread,
Dec 29, 2022, 10:36:38 AM12/29/22
to syzkaller...@googlegroups.com
syzbot has found a reproducer for the following issue on:

HEAD commit: 3f8a27f9e27b Linux 4.19.211
git tree: linux-4.19.y
console output: https://syzkaller.appspot.com/x/log.txt?x=107e4f02480000
kernel config: https://syzkaller.appspot.com/x/.config?x=9b9277b418617afe
dashboard link: https://syzkaller.appspot.com/bug?extid=131c496feb33821a856b
compiler: gcc version 10.2.1 20210110 (Debian 10.2.1-6)
syz repro: https://syzkaller.appspot.com/x/repro.syz?x=112aeba8480000
C reproducer: https://syzkaller.appspot.com/x/repro.c?x=1303a1e4480000
mounted in repro: https://storage.googleapis.com/syzbot-assets/cc8710689b85/mount_0.gz

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

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)
======================================================
WARNING: possible circular locking dependency detected
4.19.211-syzkaller #0 Not tainted
------------------------------------------------------
syz-executor421/9859 is trying to acquire lock:
00000000e6c0d845 (&type->i_mutex_dir_key#7/3){+.+.}, at: inode_lock_nested include/linux/fs.h:783 [inline]
00000000e6c0d845 (&type->i_mutex_dir_key#7/3){+.+.}, at: open_xa_root fs/reiserfs/xattr.c:127 [inline]
00000000e6c0d845 (&type->i_mutex_dir_key#7/3){+.+.}, at: open_xa_dir+0x127/0x690 fs/reiserfs/xattr.c:152

but task is already holding lock:
000000008ebafb15 (&sbi->lock){+.+.}, at: reiserfs_write_lock_nested+0x65/0xe0 fs/reiserfs/lock.c:78

which lock already depends on the new lock.


the existing dependency chain (in reverse order) is:

-> #1 (&sbi->lock){+.+.}:
reiserfs_write_lock+0x75/0xf0 fs/reiserfs/lock.c:27
reiserfs_mkdir+0x311/0x980 fs/reiserfs/namei.c:827
open_xa_root fs/reiserfs/xattr.c:136 [inline]
open_xa_dir+0x555/0x690 fs/reiserfs/xattr.c:152
xattr_lookup+0x21/0x3c0 fs/reiserfs/xattr.c:395
reiserfs_xattr_set_handle+0xfd/0xb40 fs/reiserfs/xattr.c:531
reiserfs_xattr_set+0x411/0x570 fs/reiserfs/xattr.c:631
security_set+0x84/0xb0 fs/reiserfs/xattr_security.c:31
__vfs_setxattr+0x10e/0x170 fs/xattr.c:149
REISERFS (device loop1): Using r5 hash to sort names
__vfs_setxattr_noperm+0x11a/0x420 fs/xattr.c:180
__vfs_setxattr_locked+0x176/0x250 fs/xattr.c:238
REISERFS (device loop1): Created .reiserfs_priv - reserved for xattr storage.
vfs_setxattr+0xe5/0x270 fs/xattr.c:255
setxattr+0x23d/0x330 fs/xattr.c:520
path_setxattr+0x170/0x190 fs/xattr.c:539
__do_sys_setxattr fs/xattr.c:554 [inline]
__se_sys_setxattr fs/xattr.c:550 [inline]
__x64_sys_setxattr+0xc0/0x160 fs/xattr.c:550
do_syscall_64+0xf9/0x620 arch/x86/entry/common.c:293
entry_SYSCALL_64_after_hwframe+0x49/0xbe

-> #0 (&type->i_mutex_dir_key#7/3){+.+.}:
down_write_nested+0x36/0x90 kernel/locking/rwsem.c:192
inode_lock_nested include/linux/fs.h:783 [inline]
open_xa_root fs/reiserfs/xattr.c:127 [inline]
open_xa_dir+0x127/0x690 fs/reiserfs/xattr.c:152
reiserfs_for_each_xattr+0x1ab/0x920 fs/reiserfs/xattr.c:252
reiserfs_delete_xattrs+0x1c/0x90 fs/reiserfs/xattr.c:364
reiserfs_evict_inode+0x2e3/0x540 fs/reiserfs/inode.c:53
evict+0x2ed/0x760 fs/inode.c:559
iput_final fs/inode.c:1555 [inline]
iput+0x4f1/0x860 fs/inode.c:1581
reiserfs_create+0x645/0x720 fs/reiserfs/namei.c:687
lookup_open+0x893/0x1a20 fs/namei.c:3235
do_last fs/namei.c:3327 [inline]
path_openat+0x1094/0x2df0 fs/namei.c:3537
do_filp_open+0x18c/0x3f0 fs/namei.c:3567
do_sys_open+0x3b3/0x520 fs/open.c:1085
do_syscall_64+0xf9/0x620 arch/x86/entry/common.c:293
entry_SYSCALL_64_after_hwframe+0x49/0xbe

other info that might help us debug this:

Possible unsafe locking scenario:

CPU0 CPU1
---- ----
lock(&sbi->lock);
lock(&type->i_mutex_dir_key#7/3);
lock(&sbi->lock);
lock(&type->i_mutex_dir_key#7/3);

*** DEADLOCK ***

3 locks held by syz-executor421/9859:
#0: 00000000462c3316 (sb_writers#12){.+.+}, at: sb_start_write include/linux/fs.h:1579 [inline]
#0: 00000000462c3316 (sb_writers#12){.+.+}, at: mnt_want_write+0x3a/0xb0 fs/namespace.c:360
#1: 000000004b973f5e (&type->i_mutex_dir_key#7){+.+.}, at: inode_lock include/linux/fs.h:748 [inline]
#1: 000000004b973f5e (&type->i_mutex_dir_key#7){+.+.}, at: do_last fs/namei.c:3324 [inline]
#1: 000000004b973f5e (&type->i_mutex_dir_key#7){+.+.}, at: path_openat+0x1071/0x2df0 fs/namei.c:3537
#2: 000000008ebafb15 (&sbi->lock){+.+.}, at: reiserfs_write_lock_nested+0x65/0xe0 fs/reiserfs/lock.c:78

stack backtrace:
CPU: 0 PID: 9859 Comm: syz-executor421 Not tainted 4.19.211-syzkaller #0
RIP: 0033:0x7fce174ff6b9
Code: 28 00 00 00 75 05 48 83 c4 28 c3 e8 c1 18 00 00 90 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 b8 ff ff ff f7 d8 64 89 01 48
RSP: 002b:00007fce0f45e2f8 EFLAGS: 00000246 ORIG_RAX: 0000000000000055
RAX: ffffffffffffffda RBX: 00007fce1757e7e0 RCX: 00007fce174ff6b9
RDX: 00007fce174ff6b9 RSI: 0000000000000000 RDI: 0000000020000000
RBP: 00007fce1754a6c4 R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000246 R12: 7366726573696572
R13: 6d69762f7665642f R14: 0031656c69662f2e R15: 00007fce1757e7e8
REISERFS (device loop2): found reiserfs format "3.6" with non-standard journal
REISERFS (device loop4): found reiserfs format "3.6" with non-standard journal
REISERFS (device loop2): using ordered data mode
REISERFS (device loop4): using ordered data mode
reiserfs: using flush barriers
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 loop4): journal params: device loop4, size 512, journal first block 18, max trans len 256, max batch 225, max commit age 30, max trans age 30
REISERFS (device loop0): found reiserfs format "3.6" with non-standard journal
REISERFS (device loop4): checking transaction log (loop4)
REISERFS (device loop0): using ordered data mode
REISERFS (device loop2): checking transaction log (loop2)
REISERFS (device loop5): found reiserfs format "3.6" with non-standard journal
REISERFS (device loop5): using ordered data mode
reiserfs: using flush barriers
REISERFS (device loop0): journal params: device loop0, 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
REISERFS (device loop4): Using r5 hash to sort names
REISERFS (device loop0): checking transaction log (loop0)
REISERFS (device loop5): checking transaction log (loop5)
REISERFS (device loop4): Created .reiserfs_priv - reserved for xattr storage.
REISERFS (device loop2): Using r5 hash to sort names
REISERFS (device loop2): Created .reiserfs_priv - reserved for xattr storage.
REISERFS (device loop0): Using r5 hash to sort names
REISERFS (device loop0): Created .reiserfs_priv - reserved for xattr storage.
REISERFS (device loop5): Using r5 hash to sort names
REISERFS (device loop5): Created .reiserfs_priv - reserved for xattr storage.
REISERFS (device loop1): found reiserfs format "3.6" with non-standard journal
REISERFS (device loop3): found reiserfs format "3.6" with non-standard journal
REISERFS (device loop1): using ordered data mode
REISERFS (device loop3): 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: using flush barriers
REISERFS (device loop3): journal params: device loop3, 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 loop3): checking transaction log (loop3)
REISERFS (device loop3): Using r5 hash to sort names
REISERFS (device loop3): Created .reiserfs_priv - reserved for xattr storage.
Reply all
Reply to author
Forward
0 new messages