xt_ipvs: protocol family 7 not supported block2mtd: Using custom MTD label '&' for dev #! ./mnt/module/block2mtd/parameters/block2mtd --+*!.V[)#-‰%#!$([)^)} ====================================================== WARNING: possible circular locking dependency detected syzkaller #0 Tainted: G L ------------------------------------------------------ syz.0.664/8254 is trying to acquire lock: ffff88803a0cc300 (&ovl_i_mutex_dir_key[depth]){++++}-{4:4}, at: inode_lock_shared include/linux/fs.h:1042 [inline] ffff88803a0cc300 (&ovl_i_mutex_dir_key[depth]){++++}-{4:4}, at: lookup_slow+0x41/0x80 fs/namei.c:1941 but task is already holding lock: ffffffff8fe9d1c0 (param_lock){+.+.}-{4:4}, at: kernel_param_lock kernel/params.c:604 [inline] ffffffff8fe9d1c0 (param_lock){+.+.}-{4:4}, at: param_attr_store+0xec/0x300 kernel/params.c:589 which lock already depends on the new lock. the existing dependency chain (in reverse order) is: -> #4 (param_lock){+.+.}-{4:4}: lock_acquire kernel/locking/lockdep.c:5942 [inline] lock_acquire+0x1d1/0x380 kernel/locking/lockdep.c:5899 __mutex_lock_common kernel/locking/mutex.c:646 [inline] __mutex_lock+0x19f/0x1c10 kernel/locking/mutex.c:821 kernel_param_lock kernel/params.c:604 [inline] param_attr_show+0xe7/0x230 kernel/params.c:572 module_attr_show+0x50/0x80 kernel/params.c:887 sysfs_kf_seq_show+0x217/0x3f0 fs/sysfs/file.c:65 seq_read_iter+0x32f/0x1270 fs/seq_file.c:231 kernfs_fop_read_iter+0x46c/0x610 fs/kernfs/file.c:290 new_sync_read fs/read_write.c:473 [inline] vfs_read+0x825/0xb30 fs/read_write.c:554 ksys_read+0x12a/0x250 fs/read_write.c:696 do_syscall_x64 arch/x86/entry/syscall_64.c:61 [inline] do_syscall_64+0x123/0x7b0 arch/x86/entry/syscall_64.c:89 entry_SYSCALL_64_after_hwframe+0x77/0x7f -> #3 (&of->mutex#2){+.+.}-{4:4}: lock_acquire kernel/locking/lockdep.c:5942 [inline] lock_acquire+0x1d1/0x380 kernel/locking/lockdep.c:5899 __mutex_lock_common kernel/locking/mutex.c:646 [inline] __mutex_lock+0x19f/0x1c10 kernel/locking/mutex.c:821 kernfs_file_read_iter fs/kernfs/file.c:251 [inline] kernfs_fop_read_iter+0x188/0x610 fs/kernfs/file.c:291 __kernel_read+0x397/0xac0 fs/read_write.c:512 integrity_kernel_read+0x7e/0xb0 security/integrity/iint.c:28 ima_calc_file_hash_tfm+0x25e/0x350 security/integrity/ima/ima_crypto.c:222 ima_calc_file_hash+0x1e3/0x380 security/integrity/ima/ima_crypto.c:280 ima_collect_measurement+0x952/0xb30 security/integrity/ima/ima_api.c:300 process_measurement+0xe04/0x2360 security/integrity/ima/ima_main.c:425 ima_file_check+0xbf/0x110 security/integrity/ima/ima_main.c:686 security_file_post_open+0xc4/0x210 security/security.c:2777 do_open fs/namei.c:4853 [inline] path_openat+0x5d0/0x23f0 fs/namei.c:5016 do_file_open+0x20e/0x430 fs/namei.c:5045 do_sys_openat2+0x163/0x1d0 fs/open.c:1443 do_sys_open fs/open.c:1449 [inline] __do_sys_openat fs/open.c:1465 [inline] __se_sys_openat fs/open.c:1460 [inline] __x64_sys_openat+0x12d/0x210 fs/open.c:1460 do_syscall_x64 arch/x86/entry/syscall_64.c:61 [inline] do_syscall_64+0x123/0x7b0 arch/x86/entry/syscall_64.c:89 entry_SYSCALL_64_after_hwframe+0x77/0x7f -> #2 (&ima_iint_mutex_key[depth]){+.+.}-{4:4}: lock_acquire kernel/locking/lockdep.c:5942 [inline] lock_acquire+0x1d1/0x380 kernel/locking/lockdep.c:5899 __mutex_lock_common kernel/locking/mutex.c:646 [inline] __mutex_lock+0x19f/0x1c10 kernel/locking/mutex.c:821 process_measurement+0x5ab/0x2360 security/integrity/ima/ima_main.c:319 ima_file_check+0xbf/0x110 security/integrity/ima/ima_main.c:686 security_file_post_open+0xc4/0x210 security/security.c:2777 do_open fs/namei.c:4853 [inline] path_openat+0x5d0/0x23f0 fs/namei.c:5016 do_file_open+0x20e/0x430 fs/namei.c:5045 do_sys_openat2+0x163/0x1d0 fs/open.c:1443 do_sys_open fs/open.c:1449 [inline] __do_sys_openat fs/open.c:1465 [inline] __se_sys_openat fs/open.c:1460 [inline] __x64_sys_openat+0x12d/0x210 fs/open.c:1460 do_syscall_x64 arch/x86/entry/syscall_64.c:61 [inline] do_syscall_64+0x123/0x7b0 arch/x86/entry/syscall_64.c:89 entry_SYSCALL_64_after_hwframe+0x77/0x7f -> #1 (sb_writers#6){.+.+}-{0:0}: lock_acquire kernel/locking/lockdep.c:5942 [inline] lock_acquire+0x1d1/0x380 kernel/locking/lockdep.c:5899 percpu_down_read_internal include/linux/percpu-rwsem.h:53 [inline] percpu_down_read_freezable include/linux/percpu-rwsem.h:83 [inline] __sb_start_write include/linux/fs/super.h:19 [inline] sb_start_write include/linux/fs/super.h:125 [inline] mnt_want_write+0x6a/0x420 fs/namespace.c:531 ovl_set_or_remove_acl fs/overlayfs/inode.c:521 [inline] ovl_set_acl+0x6b9/0xac0 fs/overlayfs/inode.c:570 set_posix_acl+0x263/0x320 fs/posix_acl.c:960 vfs_set_acl+0x449/0xa80 fs/posix_acl.c:1139 do_set_acl+0xd4/0x190 fs/posix_acl.c:1284 do_setxattr+0xeb/0x180 fs/xattr.c:659 file_setxattr fs/xattr.c:672 [inline] file_setxattr+0x139/0x1b0 fs/xattr.c:666 path_setxattrat+0x335/0x3b0 fs/xattr.c:732 __do_sys_fsetxattr fs/xattr.c:782 [inline] __se_sys_fsetxattr fs/xattr.c:779 [inline] __x64_sys_fsetxattr+0xc5/0x140 fs/xattr.c:779 do_syscall_x64 arch/x86/entry/syscall_64.c:61 [inline] do_syscall_64+0x123/0x7b0 arch/x86/entry/syscall_64.c:89 entry_SYSCALL_64_after_hwframe+0x77/0x7f -> #0 (&ovl_i_mutex_dir_key[depth]){++++}-{4:4}: check_prev_add+0xeb/0xe60 kernel/locking/lockdep.c:3209 check_prevs_add kernel/locking/lockdep.c:3328 [inline] validate_chain kernel/locking/lockdep.c:3952 [inline] __lock_acquire+0x1528/0x1f40 kernel/locking/lockdep.c:5288 lock_acquire kernel/locking/lockdep.c:5942 [inline] lock_acquire+0x1d1/0x380 kernel/locking/lockdep.c:5899 down_read+0x94/0x4c0 kernel/locking/rwsem.c:1574 inode_lock_shared include/linux/fs.h:1042 [inline] lookup_slow+0x41/0x80 fs/namei.c:1941 walk_component fs/namei.c:2288 [inline] link_path_walk+0x1449/0x1bd0 fs/namei.c:2662 path_lookupat+0x74/0xc40 fs/namei.c:2818 filename_lookup+0x202/0x590 fs/namei.c:2848 kern_path+0x37/0x50 fs/namei.c:3042 lookup_bdev+0xd8/0x2a0 block/bdev.c:1268 bdev_file_open_by_path+0x82/0x330 block/bdev.c:1123 add_device drivers/mtd/devices/block2mtd.c:279 [inline] block2mtd_setup2.isra.0+0x2f8/0xc60 drivers/mtd/devices/block2mtd.c:459 block2mtd_setup+0xbd/0xd0 drivers/mtd/devices/block2mtd.c:476 param_attr_store+0x199/0x300 kernel/params.c:591 module_attr_store+0x58/0x80 kernel/params.c:906 sysfs_kf_write+0xf2/0x150 fs/sysfs/file.c:145 kernfs_fop_write_iter+0x3e0/0x5f0 fs/kernfs/file.c:345 new_sync_write fs/read_write.c:575 [inline] vfs_write+0x6af/0x1040 fs/read_write.c:667 ksys_write+0x12a/0x250 fs/read_write.c:719 do_syscall_x64 arch/x86/entry/syscall_64.c:61 [inline] do_syscall_64+0x123/0x7b0 arch/x86/entry/syscall_64.c:89 entry_SYSCALL_64_after_hwframe+0x77/0x7f other info that might help us debug this: Chain exists of: &ovl_i_mutex_dir_key[depth] --> &of->mutex#2 --> param_lock Possible unsafe locking scenario: CPU0 CPU1 ---- ---- lock(param_lock); lock(&of->mutex#2); lock(param_lock); rlock(&ovl_i_mutex_dir_key[depth]); *** DEADLOCK *** locks held by syz.0.664/8254: 5, on CPU#2: #0: ffff88804e3be630 (&f->f_pos_lock){+.+.}-{4:4}, at: fdget_pos+0x2aa/0x380 fs/file.c:1413 #1: ffff88805cb4c478 (sb_writers#8){.+.+}-{0:0}, at: ksys_write+0x12a/0x250 fs/read_write.c:719 #2: ffff88805ca0f880 (&of->mutex){+.+.}-{4:4}, at: kernfs_fop_write_iter+0x2c2/0x5f0 fs/kernfs/file.c:336 #3: ffff88803802ea58 (kn->active#4){.+.+}-{0:0}, at: kernfs_get_active_of fs/kernfs/file.c:73 [inline] #3: ffff88803802ea58 (kn->active#4){.+.+}-{0:0}, at: kernfs_fop_write_iter+0x332/0x5f0 fs/kernfs/file.c:337 #4: ffffffff8fe9d1c0 (param_lock){+.+.}-{4:4}, at: kernel_param_lock kernel/params.c:604 [inline] #4: ffffffff8fe9d1c0 (param_lock){+.+.}-{4:4}, at: param_attr_store+0xec/0x300 kernel/params.c:589 stack backtrace: CPU: 2 UID: 0 PID: 8254 Comm: syz.0.664 Tainted: G L syzkaller #0 PREEMPT(full) Tainted: [L]=SOFTLOCKUP Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.3-debian-1.16.3-2 04/01/2014 Call Trace: __dump_stack lib/dump_stack.c:94 [inline] dump_stack_lvl+0x100/0x190 lib/dump_stack.c:120 print_circular_bug.cold+0x178/0x1be kernel/locking/lockdep.c:2087 check_noncircular+0x146/0x160 kernel/locking/lockdep.c:2219 check_prev_add+0xeb/0xe60 kernel/locking/lockdep.c:3209 check_prevs_add kernel/locking/lockdep.c:3328 [inline] validate_chain kernel/locking/lockdep.c:3952 [inline] __lock_acquire+0x1528/0x1f40 kernel/locking/lockdep.c:5288 lock_acquire kernel/locking/lockdep.c:5942 [inline] lock_acquire+0x1d1/0x380 kernel/locking/lockdep.c:5899 down_read+0x94/0x4c0 kernel/locking/rwsem.c:1574 inode_lock_shared include/linux/fs.h:1042 [inline] lookup_slow+0x41/0x80 fs/namei.c:1941 walk_component fs/namei.c:2288 [inline] link_path_walk+0x1449/0x1bd0 fs/namei.c:2662 path_lookupat+0x74/0xc40 fs/namei.c:2818 filename_lookup+0x202/0x590 fs/namei.c:2848 kern_path+0x37/0x50 fs/namei.c:3042 lookup_bdev+0xd8/0x2a0 block/bdev.c:1268 bdev_file_open_by_path+0x82/0x330 block/bdev.c:1123 add_device drivers/mtd/devices/block2mtd.c:279 [inline] block2mtd_setup2.isra.0+0x2f8/0xc60 drivers/mtd/devices/block2mtd.c:459 block2mtd_setup+0xbd/0xd0 drivers/mtd/devices/block2mtd.c:476 param_attr_store+0x199/0x300 kernel/params.c:591 module_attr_store+0x58/0x80 kernel/params.c:906 sysfs_kf_write+0xf2/0x150 fs/sysfs/file.c:145 kernfs_fop_write_iter+0x3e0/0x5f0 fs/kernfs/file.c:345 new_sync_write fs/read_write.c:575 [inline] vfs_write+0x6af/0x1040 fs/read_write.c:667 ksys_write+0x12a/0x250 fs/read_write.c:719 do_syscall_x64 arch/x86/entry/syscall_64.c:61 [inline] do_syscall_64+0x123/0x7b0 arch/x86/entry/syscall_64.c:89 entry_SYSCALL_64_after_hwframe+0x77/0x7f RIP: 0033:0x7f2f72da94d9 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:00007f2f73d32028 EFLAGS: 00000246 ORIG_RAX: 0000000000000001 RAX: ffffffffffffffda RBX: 00007f2f73025fa0 RCX: 00007f2f72da94d9 RDX: 0000000000000049 RSI: 0000200000000440 RDI: 000000000000000b RBP: 00007f2f72e3804e R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000 R13: 00007f2f73026038 R14: 00007f2f73025fa0 R15: 00007ffebb7c4868 block2mtd: error: cannot open device #! ./mnt/module/block2mtd/parameters/block2mtd --+*!.V[)#-‰%#!$([)^)}