====================================================== WARNING: possible circular locking dependency detected 4.19.108-syzkaller #0 Not tainted ------------------------------------------------------ syz-executor.1/6371 is trying to acquire lock: 00000000679b384f (&ovl_i_mutex_key[depth]){+.+.}, at: inode_lock include/linux/fs.h:747 [inline] 00000000679b384f (&ovl_i_mutex_key[depth]){+.+.}, at: ovl_write_iter+0x148/0xc20 fs/overlayfs/file.c:268 but task is already holding lock: 00000000fccfb483 (&pipe->mutex/1){+.+.}, at: pipe_lock_nested fs/pipe.c:62 [inline] 00000000fccfb483 (&pipe->mutex/1){+.+.}, at: pipe_lock+0x63/0x80 fs/pipe.c:70 which lock already depends on the new lock. the existing dependency chain (in reverse order) is: -> #2 (&pipe->mutex/1){+.+.}: pipe_lock_nested fs/pipe.c:62 [inline] pipe_lock+0x63/0x80 fs/pipe.c:70 iter_file_splice_write+0x183/0xb30 fs/splice.c:700 do_splice_from fs/splice.c:852 [inline] do_splice+0x5ea/0x1250 fs/splice.c:1154 __do_sys_splice fs/splice.c:1428 [inline] __se_sys_splice fs/splice.c:1408 [inline] __x64_sys_splice+0x2b5/0x320 fs/splice.c:1408 do_syscall_64+0xf9/0x620 arch/x86/entry/common.c:293 entry_SYSCALL_64_after_hwframe+0x49/0xbe -> #1 (sb_writers#4){.+.+}: sb_start_write include/linux/fs.h:1578 [inline] mnt_want_write+0x3a/0xb0 fs/namespace.c:360 ovl_link+0x73/0x2a5 fs/overlayfs/dir.c:674 vfs_link+0x79f/0xb50 fs/namei.c:4243 do_linkat+0x4ed/0x700 fs/namei.c:4311 __do_sys_link fs/namei.c:4340 [inline] __se_sys_link fs/namei.c:4338 [inline] __x64_sys_link+0x5d/0x80 fs/namei.c:4338 do_syscall_64+0xf9/0x620 arch/x86/entry/common.c:293 entry_SYSCALL_64_after_hwframe+0x49/0xbe -> #0 (&ovl_i_mutex_key[depth]){+.+.}: down_write+0x34/0x90 kernel/locking/rwsem.c:70 inode_lock include/linux/fs.h:747 [inline] ovl_write_iter+0x148/0xc20 fs/overlayfs/file.c:268 call_write_iter include/linux/fs.h:1820 [inline] new_sync_write fs/read_write.c:474 [inline] __vfs_write+0x512/0x760 fs/read_write.c:487 __kernel_write+0x109/0x370 fs/read_write.c:506 write_pipe_buf+0x153/0x1e0 fs/splice.c:798 splice_from_pipe_feed fs/splice.c:503 [inline] __splice_from_pipe+0x38f/0x7a0 fs/splice.c:627 splice_from_pipe+0xd9/0x140 fs/splice.c:662 default_file_splice_write+0x37/0x90 fs/splice.c:810 do_splice_from fs/splice.c:852 [inline] do_splice+0x5ea/0x1250 fs/splice.c:1154 __do_sys_splice fs/splice.c:1428 [inline] __se_sys_splice fs/splice.c:1408 [inline] __x64_sys_splice+0x2b5/0x320 fs/splice.c:1408 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: Chain exists of: &ovl_i_mutex_key[depth] --> sb_writers#4 --> &pipe->mutex/1 Possible unsafe locking scenario: CPU0 CPU1 ---- ---- lock(&pipe->mutex/1); lock(sb_writers#4); lock(&pipe->mutex/1); lock(&ovl_i_mutex_key[depth]); *** DEADLOCK *** 2 locks held by syz-executor.1/6371: #0: 00000000f77451bd (sb_writers#16){.+.+}, at: file_start_write include/linux/fs.h:2775 [inline] #0: 00000000f77451bd (sb_writers#16){.+.+}, at: do_splice+0xc91/0x1250 fs/splice.c:1153 #1: 00000000fccfb483 (&pipe->mutex/1){+.+.}, at: pipe_lock_nested fs/pipe.c:62 [inline] #1: 00000000fccfb483 (&pipe->mutex/1){+.+.}, at: pipe_lock+0x63/0x80 fs/pipe.c:70 stack backtrace: CPU: 1 PID: 6371 Comm: syz-executor.1 Not tainted 4.19.108-syzkaller #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 Call Trace: __dump_stack lib/dump_stack.c:77 [inline] dump_stack+0x188/0x20d lib/dump_stack.c:118 print_circular_bug.isra.0.cold+0x1c4/0x282 kernel/locking/lockdep.c:1221 check_prev_add kernel/locking/lockdep.c:1861 [inline] check_prevs_add kernel/locking/lockdep.c:1974 [inline] validate_chain kernel/locking/lockdep.c:2415 [inline] __lock_acquire+0x2e19/0x49c0 kernel/locking/lockdep.c:3411 lock_acquire+0x170/0x400 kernel/locking/lockdep.c:3903 down_write+0x34/0x90 kernel/locking/rwsem.c:70 inode_lock include/linux/fs.h:747 [inline] ovl_write_iter+0x148/0xc20 fs/overlayfs/file.c:268 call_write_iter include/linux/fs.h:1820 [inline] new_sync_write fs/read_write.c:474 [inline] __vfs_write+0x512/0x760 fs/read_write.c:487 __kernel_write+0x109/0x370 fs/read_write.c:506 write_pipe_buf+0x153/0x1e0 fs/splice.c:798 splice_from_pipe_feed fs/splice.c:503 [inline] __splice_from_pipe+0x38f/0x7a0 fs/splice.c:627 splice_from_pipe+0xd9/0x140 fs/splice.c:662 default_file_splice_write+0x37/0x90 fs/splice.c:810 do_splice_from fs/splice.c:852 [inline] do_splice+0x5ea/0x1250 fs/splice.c:1154 __do_sys_splice fs/splice.c:1428 [inline] __se_sys_splice fs/splice.c:1408 [inline] __x64_sys_splice+0x2b5/0x320 fs/splice.c:1408 do_syscall_64+0xf9/0x620 arch/x86/entry/common.c:293 entry_SYSCALL_64_after_hwframe+0x49/0xbe RIP: 0033:0x45c4a9 Code: ad b6 fb ff c3 66 2e 0f 1f 84 00 00 00 00 00 66 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 0f 83 7b b6 fb ff c3 66 2e 0f 1f 84 00 00 00 00 RSP: 002b:00007f1151992c78 EFLAGS: 00000246 ORIG_RAX: 0000000000000113 RAX: ffffffffffffffda RBX: 00007f11519936d4 RCX: 000000000045c4a9 RDX: 0000000000000005 RSI: 0000000000000000 RDI: 0000000000000003 RBP: 000000000076bfc0 R08: 000000000004ffe0 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 00000000ffffffff R13: 0000000000000b9f R14: 00000000004ce2bc R15: 000000000076bfcc EXT4-fs (loop2): bad geometry: first data block 167772160 is beyond end of filesystem (1080) selinux_nlmsg_perm: 228 callbacks suppressed SELinux: unrecognized netlink message: protocol=0 nlmsg_type=0 sclass=netlink_route_socket pig=6419 comm=syz-executor.1 SELinux: unrecognized netlink message: protocol=0 nlmsg_type=0 sclass=netlink_route_socket pig=6419 comm=syz-executor.1 SELinux: unrecognized netlink message: protocol=0 nlmsg_type=0 sclass=netlink_route_socket pig=6419 comm=syz-executor.1 SELinux: unrecognized netlink message: protocol=0 nlmsg_type=0 sclass=netlink_route_socket pig=6419 comm=syz-executor.1 SELinux: unrecognized netlink message: protocol=0 nlmsg_type=0 sclass=netlink_route_socket pig=6419 comm=syz-executor.1 SELinux: unrecognized netlink message: protocol=0 nlmsg_type=0 sclass=netlink_route_socket pig=6419 comm=syz-executor.1 EXT4-fs (loop2): bad geometry: first data block 268697600 is beyond end of filesystem (1080) SELinux: unrecognized netlink message: protocol=0 nlmsg_type=0 sclass=netlink_route_socket pig=6419 comm=syz-executor.1 SELinux: unrecognized netlink message: protocol=0 nlmsg_type=0 sclass=netlink_route_socket pig=6419 comm=syz-executor.1 SELinux: unrecognized netlink message: protocol=0 nlmsg_type=0 sclass=netlink_route_socket pig=6419 comm=syz-executor.1 SELinux: unrecognized netlink message: protocol=0 nlmsg_type=0 sclass=netlink_route_socket pig=6419 comm=syz-executor.1 EXT4-fs (loop2): bad geometry: first data block 304480256 is beyond end of filesystem (1080) EXT4-fs (loop2): bad geometry: first data block 335544320 is beyond end of filesystem (1080) EXT4-fs (loop2): bad geometry: first data block 405143552 is beyond end of filesystem (1080) EXT4-fs (loop2): bad geometry: first data block 536870912 is beyond end of filesystem (1080) EXT4-fs (loop2): bad geometry: first data block 570425344 is beyond end of filesystem (1080) netlink: 400 bytes leftover after parsing attributes in process `syz-executor.5'. EXT4-fs (loop2): bad geometry: first data block 587202560 is beyond end of filesystem (1080) NOHZ: local_softirq_pending 08 netlink: 2212 bytes leftover after parsing attributes in process `syz-executor.1'. EXT4-fs (loop2): bad geometry: first data block 671350784 is beyond end of filesystem (1080) EXT4-fs (loop2): bad geometry: first data block 688128000 is beyond end of filesystem (1080) EXT4-fs (loop2): bad geometry: first data block 704905216 is beyond end of filesystem (1080) EXT4-fs (loop2): bad geometry: first data block 738197504 is beyond end of filesystem (1080) selinux_nlmsg_perm: 394 callbacks suppressed SELinux: unrecognized netlink message: protocol=0 nlmsg_type=0 sclass=netlink_route_socket pig=6842 comm=syz-executor.1 EXT4-fs (loop2): bad geometry: first data block 754974720 is beyond end of filesystem (1080) netlink: 2212 bytes leftover after parsing attributes in process `syz-executor.1'. SELinux: unrecognized netlink message: protocol=0 nlmsg_type=0 sclass=netlink_route_socket pig=6842 comm=syz-executor.1 SELinux: unrecognized netlink message: protocol=0 nlmsg_type=0 sclass=netlink_route_socket pig=6842 comm=syz-executor.1 SELinux: unrecognized netlink message: protocol=0 nlmsg_type=0 sclass=netlink_route_socket pig=6842 comm=syz-executor.1 SELinux: unrecognized netlink message: protocol=0 nlmsg_type=0 sclass=netlink_route_socket pig=6842 comm=syz-executor.1 SELinux: unrecognized netlink message: protocol=0 nlmsg_type=0 sclass=netlink_route_socket pig=6842 comm=syz-executor.1 SELinux: unrecognized netlink message: protocol=0 nlmsg_type=0 sclass=netlink_route_socket pig=6842 comm=syz-executor.1 SELinux: unrecognized netlink message: protocol=0 nlmsg_type=0 sclass=netlink_route_socket pig=6842 comm=syz-executor.1 SELinux: unrecognized netlink message: protocol=0 nlmsg_type=0 sclass=netlink_route_socket pig=6842 comm=syz-executor.1 SELinux: unrecognized netlink message: protocol=0 nlmsg_type=0 sclass=netlink_route_socket pig=6842 comm=syz-executor.1 EXT4-fs (loop2): bad geometry: first data block 917045248 is beyond end of filesystem (1080) netlink: 2212 bytes leftover after parsing attributes in process `syz-executor.1'. EXT4-fs (loop2): bad geometry: first data block 923009024 is beyond end of filesystem (1080) EXT4-fs (loop2): bad geometry: first data block 939786240 is beyond end of filesystem (1080) EXT4-fs (loop2): bad geometry: first data block 973275136 is beyond end of filesystem (1080) netlink: 2212 bytes leftover after parsing attributes in process `syz-executor.1'. EXT4-fs (loop2): bad geometry: first data block 1056964608 is beyond end of filesystem (1080) EXT4-fs (loop2): bad geometry: first data block 1073741824 is beyond end of filesystem (1080) EXT4-fs (loop2): bad geometry: first data block 1124139008 is beyond end of filesystem (1080)