From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.sourceforge.net (lists.sourceforge.net [216.105.38.7]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id A9E9CEE4997 for ; Fri, 18 Aug 2023 21:15:13 +0000 (UTC) Received: from [127.0.0.1] (helo=sfs-ml-2.v29.lw.sourceforge.com) by sfs-ml-2.v29.lw.sourceforge.com with esmtp (Exim 4.95) (envelope-from ) id 1qX6oK-0001UM-Io; Fri, 18 Aug 2023 21:15:11 +0000 Received: from [172.30.20.202] (helo=mx.sourceforge.net) by sfs-ml-2.v29.lw.sourceforge.com with esmtps (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.95) (envelope-from ) id 1qX6oI-0001UF-UV for linux-f2fs-devel@lists.sourceforge.net; Fri, 18 Aug 2023 21:15:09 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=sourceforge.net; s=x; h=In-Reply-To:Content-Type:MIME-Version:References: Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To:Content-Transfer-Encoding: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=4R82enmm48RQGcIbUUkRtJqwyzw980lgM68pnVkzfcg=; b=Vg3wq1obLT22Sbt0Ck54kXEZih 8weEVQ7xIDIfY0Z1c41E1lgUdSs5JJuY21kzm1WwdZ9YrS2bu4fziHLt6KyRAvKSmpt4eMjy7D1Hw E4BJ+o8N7YkHcM9hpLTkbBBzptkb6Hvx1LWPDx1bqH6iKN639PCqqfi99zDoZ1RDGKa4=; DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=sf.net; s=x ; h=In-Reply-To:Content-Type:MIME-Version:References:Message-ID:Subject:Cc:To :From:Date:Sender:Reply-To:Content-Transfer-Encoding:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Id:List-Help:List-Unsubscribe:List-Subscribe: List-Post:List-Owner:List-Archive; bh=4R82enmm48RQGcIbUUkRtJqwyzw980lgM68pnVkzfcg=; b=kCJW4xWqTYN/YUL2JzX7/Wu4s/ 8FMIUdHMzlWqSH/iFmB1+enKdVKXP5lvOZ14jdBK7/sb5WhFzNMUzOwo6cQWtn3qyeKpXxDtA54zc EhZNFMj/Ma4DMc89z6jj9JGvrfjUiVaPkTw/DMXCRyw2KkDQJM+FjLdDknpMxgB3VD7w=; Received: from dfw.source.kernel.org ([139.178.84.217]) by sfi-mx-2.v28.lw.sourceforge.com with esmtps (TLS1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.95) id 1qX6oG-0005v3-NH for linux-f2fs-devel@lists.sourceforge.net; Fri, 18 Aug 2023 21:15:09 +0000 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 23A47640D8; Fri, 18 Aug 2023 21:15:03 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 42BCEC433C8; Fri, 18 Aug 2023 21:15:02 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1692393302; bh=j+lAEJjDI2/rB/RsQG4nRInH5Lj8Rgk5bfuhJLz+TOg=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=k6mSV1mw0cWpSuBJrHNjLy4PxD+yKMEaeVe4euLDeQkJ0GxB0+JD2UCntA4TyLIqu Jt6pr+vTXoRRRbmfhb+/ouMESgm93hcJSePXHh3AuiGsKqzgiL/cyg5sZf3TCMSf/I Pr4VVu8YT4UujgxyNrOj0txteFqXLkzyZNlTXS1hp499kfomwJHEwekOCSlk/XEqHC vwb8ArGBKtFmGRnJIS1lcRsfRmF/qW2aGx5Wzlb5+A33n1jrKbtrVGTC3/1ychiafB /9jshCgt2s5OMJe3ei6FhoR1Zo0MMmS9XkQuMvvTDH0QDsMqPUtPWWJd7dfMu0hWTG zteRCrmR8KVIQ== Date: Fri, 18 Aug 2023 14:15:00 -0700 From: Jaegeuk Kim To: syzbot Message-ID: References: <0000000000005921ef05ffddc3b7@google.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <0000000000005921ef05ffddc3b7@google.com> X-Headers-End: 1qX6oG-0005v3-NH Subject: Re: [f2fs-dev] [syzbot] [f2fs?] possible deadlock in f2fs_getxattr X-BeenThere: linux-f2fs-devel@lists.sourceforge.net X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: linux-fsdevel@vger.kernel.org, syzkaller-bugs@googlegroups.com, linux-kernel@vger.kernel.org, linux-f2fs-devel@lists.sourceforge.net Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: linux-f2fs-devel-bounces@lists.sourceforge.net #syz test: https://github.com/jaegeuk/f2fs.git g-dev-test On 07/06, syzbot wrote: > Hello, > > syzbot found the following issue on: > > HEAD commit: a452483508d7 Merge tag 's390-6.5-2' of git://git.kernel.or.. > git tree: upstream > console output: https://syzkaller.appspot.com/x/log.txt?x=161917a0a80000 > kernel config: https://syzkaller.appspot.com/x/.config?x=15873d91ff37a949 > dashboard link: https://syzkaller.appspot.com/bug?extid=e5600587fa9cbf8e3826 > compiler: Debian clang version 15.0.7, GNU ld (GNU Binutils for Debian) 2.35.2 > > Unfortunately, I don't have any reproducer for this issue yet. > > Downloadable assets: > disk image: https://storage.googleapis.com/syzbot-assets/5a4997524374/disk-a4524835.raw.xz > vmlinux: https://storage.googleapis.com/syzbot-assets/a0d32791e67c/vmlinux-a4524835.xz > kernel image: https://storage.googleapis.com/syzbot-assets/ff545ba23349/bzImage-a4524835.xz > > IMPORTANT: if you fix the issue, please add the following tag to the commit: > Reported-by: syzbot+e5600587fa9cbf8e3826@syzkaller.appspotmail.com > > F2FS-fs (loop0): Can't find valid F2FS filesystem in 1th superblock > F2FS-fs (loop0): Found nat_bits in checkpoint > F2FS-fs (loop0): Try to recover 1th superblock, ret: 0 > F2FS-fs (loop0): Mounted with checkpoint version = 48b305e5 > ====================================================== > WARNING: possible circular locking dependency detected > 6.4.0-syzkaller-12155-ga452483508d7 #0 Not tainted > ------------------------------------------------------ > syz-executor.0/5180 is trying to acquire lock: > ffff88803c1b90a0 (&fi->i_xattr_sem){.+.+}-{3:3}, at: f2fs_down_read fs/f2fs/f2fs.h:2108 [inline] > ffff88803c1b90a0 (&fi->i_xattr_sem){.+.+}-{3:3}, at: f2fs_getxattr+0xb8/0x1460 fs/f2fs/xattr.c:532 > > but task is already holding lock: > ffff88803c0196d8 (&fi->i_sem){+.+.}-{3:3}, at: f2fs_down_write fs/f2fs/f2fs.h:2133 [inline] > ffff88803c0196d8 (&fi->i_sem){+.+.}-{3:3}, at: f2fs_do_tmpfile+0x25/0x170 fs/f2fs/dir.c:838 > > which lock already depends on the new lock. > > > the existing dependency chain (in reverse order) is: > > -> #1 (&fi->i_sem){+.+.}-{3:3}: > down_write+0x3a/0x50 kernel/locking/rwsem.c:1573 > f2fs_down_write fs/f2fs/f2fs.h:2133 [inline] > f2fs_add_inline_entry+0x3a8/0x760 fs/f2fs/inline.c:644 > f2fs_add_dentry+0xba/0x1e0 fs/f2fs/dir.c:784 > f2fs_do_add_link+0x21e/0x340 fs/f2fs/dir.c:827 > f2fs_add_link fs/f2fs/f2fs.h:3554 [inline] > f2fs_create+0x32c/0x530 fs/f2fs/namei.c:377 > lookup_open fs/namei.c:3492 [inline] > open_last_lookups fs/namei.c:3560 [inline] > path_openat+0x13e7/0x3180 fs/namei.c:3790 > do_filp_open+0x234/0x490 fs/namei.c:3820 > do_sys_openat2+0x13e/0x1d0 fs/open.c:1407 > do_sys_open fs/open.c:1422 [inline] > __do_sys_open fs/open.c:1430 [inline] > __se_sys_open fs/open.c:1426 [inline] > __x64_sys_open+0x225/0x270 fs/open.c:1426 > do_syscall_x64 arch/x86/entry/common.c:50 [inline] > do_syscall_64+0x41/0xc0 arch/x86/entry/common.c:80 > entry_SYSCALL_64_after_hwframe+0x63/0xcd > > -> #0 (&fi->i_xattr_sem){.+.+}-{3:3}: > check_prev_add kernel/locking/lockdep.c:3142 [inline] > check_prevs_add kernel/locking/lockdep.c:3261 [inline] > validate_chain kernel/locking/lockdep.c:3876 [inline] > __lock_acquire+0x39ff/0x7f70 kernel/locking/lockdep.c:5144 > lock_acquire+0x1e3/0x520 kernel/locking/lockdep.c:5761 > down_read+0x47/0x2f0 kernel/locking/rwsem.c:1520 > f2fs_down_read fs/f2fs/f2fs.h:2108 [inline] > f2fs_getxattr+0xb8/0x1460 fs/f2fs/xattr.c:532 > __f2fs_get_acl+0x52/0x8e0 fs/f2fs/acl.c:179 > f2fs_acl_create fs/f2fs/acl.c:377 [inline] > f2fs_init_acl+0xd7/0x9a0 fs/f2fs/acl.c:420 > f2fs_init_inode_metadata+0x824/0x1190 fs/f2fs/dir.c:558 > f2fs_do_tmpfile+0x34/0x170 fs/f2fs/dir.c:839 > __f2fs_tmpfile+0x1f9/0x380 fs/f2fs/namei.c:884 > f2fs_ioc_start_atomic_write+0x4a3/0x9e0 fs/f2fs/file.c:2099 > __f2fs_ioctl+0x1b5c/0xb770 > vfs_ioctl fs/ioctl.c:51 [inline] > __do_sys_ioctl fs/ioctl.c:870 [inline] > __se_sys_ioctl+0xf8/0x170 fs/ioctl.c:856 > do_syscall_x64 arch/x86/entry/common.c:50 [inline] > do_syscall_64+0x41/0xc0 arch/x86/entry/common.c:80 > entry_SYSCALL_64_after_hwframe+0x63/0xcd > > other info that might help us debug this: > > Possible unsafe locking scenario: > > CPU0 CPU1 > ---- ---- > lock(&fi->i_sem); > lock(&fi->i_xattr_sem); > lock(&fi->i_sem); > rlock(&fi->i_xattr_sem); > > *** DEADLOCK *** > > 5 locks held by syz-executor.0/5180: > #0: ffff888078fb2410 (sb_writers#16){.+.+}-{0:0}, at: mnt_want_write_file+0x61/0x200 fs/namespace.c:447 > #1: ffff88803c018a28 (&sb->s_type->i_mutex_key#23){+.+.}-{3:3}, at: inode_lock include/linux/fs.h:771 [inline] > #1: ffff88803c018a28 (&sb->s_type->i_mutex_key#23){+.+.}-{3:3}, at: f2fs_ioc_start_atomic_write+0x1b2/0x9e0 fs/f2fs/file.c:2060 > #2: ffff88803c019008 (&fi->i_gc_rwsem[WRITE]){+.+.}-{3:3}, at: f2fs_down_write fs/f2fs/f2fs.h:2133 [inline] > #2: ffff88803c019008 (&fi->i_gc_rwsem[WRITE]){+.+.}-{3:3}, at: f2fs_ioc_start_atomic_write+0x276/0x9e0 fs/f2fs/file.c:2074 > #3: ffff88802b7e03b0 (&sbi->cp_rwsem){.+.+}-{3:3}, at: f2fs_down_read fs/f2fs/f2fs.h:2108 [inline] > #3: ffff88802b7e03b0 (&sbi->cp_rwsem){.+.+}-{3:3}, at: f2fs_lock_op fs/f2fs/f2fs.h:2151 [inline] > #3: ffff88802b7e03b0 (&sbi->cp_rwsem){.+.+}-{3:3}, at: __f2fs_tmpfile+0x1ce/0x380 fs/f2fs/namei.c:879 > #4: ffff88803c0196d8 (&fi->i_sem){+.+.}-{3:3}, at: f2fs_down_write fs/f2fs/f2fs.h:2133 [inline] > #4: ffff88803c0196d8 (&fi->i_sem){+.+.}-{3:3}, at: f2fs_do_tmpfile+0x25/0x170 fs/f2fs/dir.c:838 > > stack backtrace: > CPU: 1 PID: 5180 Comm: syz-executor.0 Not tainted 6.4.0-syzkaller-12155-ga452483508d7 #0 > Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 05/27/2023 > Call Trace: > > __dump_stack lib/dump_stack.c:88 [inline] > dump_stack_lvl+0x1e7/0x2d0 lib/dump_stack.c:106 > check_noncircular+0x375/0x4a0 kernel/locking/lockdep.c:2195 > check_prev_add kernel/locking/lockdep.c:3142 [inline] > check_prevs_add kernel/locking/lockdep.c:3261 [inline] > validate_chain kernel/locking/lockdep.c:3876 [inline] > __lock_acquire+0x39ff/0x7f70 kernel/locking/lockdep.c:5144 > lock_acquire+0x1e3/0x520 kernel/locking/lockdep.c:5761 > down_read+0x47/0x2f0 kernel/locking/rwsem.c:1520 > f2fs_down_read fs/f2fs/f2fs.h:2108 [inline] > f2fs_getxattr+0xb8/0x1460 fs/f2fs/xattr.c:532 > __f2fs_get_acl+0x52/0x8e0 fs/f2fs/acl.c:179 > f2fs_acl_create fs/f2fs/acl.c:377 [inline] > f2fs_init_acl+0xd7/0x9a0 fs/f2fs/acl.c:420 > f2fs_init_inode_metadata+0x824/0x1190 fs/f2fs/dir.c:558 > f2fs_do_tmpfile+0x34/0x170 fs/f2fs/dir.c:839 > __f2fs_tmpfile+0x1f9/0x380 fs/f2fs/namei.c:884 > f2fs_ioc_start_atomic_write+0x4a3/0x9e0 fs/f2fs/file.c:2099 > __f2fs_ioctl+0x1b5c/0xb770 > vfs_ioctl fs/ioctl.c:51 [inline] > __do_sys_ioctl fs/ioctl.c:870 [inline] > __se_sys_ioctl+0xf8/0x170 fs/ioctl.c:856 > do_syscall_x64 arch/x86/entry/common.c:50 [inline] > do_syscall_64+0x41/0xc0 arch/x86/entry/common.c:80 > entry_SYSCALL_64_after_hwframe+0x63/0xcd > RIP: 0033:0x7fc9e168c389 > 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:00007fc9e2476168 EFLAGS: 00000246 ORIG_RAX: 0000000000000010 > RAX: ffffffffffffffda RBX: 00007fc9e17abf80 RCX: 00007fc9e168c389 > RDX: 0000000000000000 RSI: 000000000000f501 RDI: 0000000000000005 > RBP: 00007fc9e16d7493 R08: 0000000000000000 R09: 0000000000000000 > R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000 > R13: 00007fffcc104f8f R14: 00007fc9e2476300 R15: 0000000000022000 > > > > --- > 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@googlegroups.com. > > syzbot will keep track of this issue. See: > https://goo.gl/tpsmEJ#status for how to communicate with syzbot. > > If the bug is already fixed, let syzbot know by replying with: > #syz fix: exact-commit-title > > If you want to change bug's subsystems, reply with: > #syz set subsystems: new-subsystem > (See the list of subsystem names on the web dashboard) > > If the bug is a duplicate of another bug, reply with: > #syz dup: exact-subject-of-another-report > > If you want to undo deduplication, reply with: > #syz undup _______________________________________________ Linux-f2fs-devel mailing list Linux-f2fs-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel