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 078CBC3DA4A for ; Fri, 16 Aug 2024 09:16:36 +0000 (UTC) Received: from [127.0.0.1] (helo=sfs-ml-4.v29.lw.sourceforge.com) by sfs-ml-4.v29.lw.sourceforge.com with esmtp (Exim 4.95) (envelope-from ) id 1set4V-0006Wk-JR; Fri, 16 Aug 2024 09:16:35 +0000 Received: from [172.30.29.66] (helo=mx.sourceforge.net) by sfs-ml-4.v29.lw.sourceforge.com with esmtps (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.95) (envelope-from <36xi_ZgkbAFYGMN8y992FyDD61.4CC492IG2F0CBH2BH.0CA@M3KW2WVRGUFZ5GODRSRYTGD7.apphosting.bounces.google.com>) id 1set4T-0006Wc-SX for linux-f2fs-devel@lists.sourceforge.net; Fri, 16 Aug 2024 09:16:33 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=sourceforge.net; s=x; h=Content-Type:To:From:Subject:Message-ID:Date: MIME-Version:Sender:Reply-To:Cc:Content-Transfer-Encoding:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:In-Reply-To:References:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=6swvxELE9u/ROCNrGiOGtPOS2/V8W+8x5poLYagfG/U=; b=Q0iaAqtPcwDi3O0la7O7/wBXyh CPv0UGSM2ds0G+E0sr3M3dtGzsu8cKK3yl8yc3KF7v8RQfhaC314bxeMEATUgTYVnw5tKM/QXEXFT XAu2j4BeApQIJa/yZkjyVnSnEh43R3hHDAr1xf8/tQUYpVKnxOuwF9JMwdcAMkRlt8tg=; DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=sf.net; s=x ; h=Content-Type:To:From:Subject:Message-ID:Date:MIME-Version:Sender:Reply-To :Cc:Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To: References:List-Id:List-Help:List-Unsubscribe:List-Subscribe:List-Post: List-Owner:List-Archive; bh=6swvxELE9u/ROCNrGiOGtPOS2/V8W+8x5poLYagfG/U=; b=c f65snl3zOJRcI8qYHZi5D9M22Kj+jRIOb6VbI+EEZNTGXJDkUtrFfbHqtCqn5yh/ozqJ15OBU/Acb NC7Me2Et26k3ofM8KYDdvH8kE853A+Uqh1J9QVGH8L05ruojHcYTlneNxdb/Hj8smur97K1I3LDaT jcp9gMwVWhsKp6DI=; Received: from mail-il1-f199.google.com ([209.85.166.199]) by sfi-mx-2.v28.lw.sourceforge.com with esmtps (TLS1.2:ECDHE-RSA-AES128-GCM-SHA256:128) (Exim 4.95) id 1set4S-0007VL-UX for linux-f2fs-devel@lists.sourceforge.net; Fri, 16 Aug 2024 09:16:33 +0000 Received: by mail-il1-f199.google.com with SMTP id e9e14a558f8ab-39b331c43deso19210445ab.1 for ; Fri, 16 Aug 2024 02:16:32 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1723799787; x=1724404587; h=to:from:subject:message-id:date:mime-version:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=6swvxELE9u/ROCNrGiOGtPOS2/V8W+8x5poLYagfG/U=; b=RMDhg8IwDzl3VDsv3Dm810Ke9PaPmzHWl2jQ2caNkmf2Q2aDwarGGZNzDM0iA4z7Y6 Wc1yJbBP+FaP5CaKwjLCqq504pnCYvzTtADA7Qm7ApvVf+g0vuYz8VAX0S988Sfy4UX3 2sg9uahvbE5nLCM7ITpzAkMR3XaKGmdy7m31IwNMkFG0LYH4fk34x37Rv9k+r9zdsPls YZ449hyply8qP2BJntfnK/3quNnYnIlFSVKGxfxE4BXjhvGJ5jHDBGOTrpFktqzaev1r hq3Wv+d/QYJYYO+Sn4cZq74axv1+CO3aloA/YsCphmed5Al4CkHC/IVO95qYkyT2CO7D RNhw== X-Forwarded-Encrypted: i=1; AJvYcCXqm1q/DW0dqHK5INrI/IJuMPnPIkpbIdIeu/oDU83BhmXFVb6kUX1zNd7lF20+jnDncA3L+ePGFmTHqpHJj0hHkn7gsrwsZbdSMf0o99PWaHtofcw1rQ== X-Gm-Message-State: AOJu0YxUbHBkQKffXEsW9KdMdtIX7Nxk9B5jMdsSjTz1DEPGr3o1NiRg uaBF9UkIQl+rNkAKxhwwVxf9k5RdibNplevPecIYxy+O2lSUEX9Hq5yiDrtwGldJ9itbBc0GZ5p RwuRiUzut1DbC0TV2voOmfKusVGlJ/9StMle/l531dR/tWRd+2TZ6gt4= X-Google-Smtp-Source: AGHT+IE7nxGoospNfrrmGFS4Yo1bV3G5STW9uGeQHjxGcZVaotYpQNeztay2IhdijG+Xp0E9GsAsgUKkMOX0RKJpIqqEwCnWjXvX MIME-Version: 1.0 X-Received: by 2002:a05:6e02:12c7:b0:397:35d4:3811 with SMTP id e9e14a558f8ab-39d26d7aa3dmr1413475ab.3.1723799787099; Fri, 16 Aug 2024 02:16:27 -0700 (PDT) Date: Fri, 16 Aug 2024 02:16:27 -0700 X-Google-Appengine-App-Id: s~syzkaller X-Google-Appengine-App-Id-Alias: syzkaller Message-ID: <000000000000f963fc061fc96998@google.com> From: syzbot To: chao@kernel.org, jaegeuk@kernel.org, linux-f2fs-devel@lists.sourceforge.net, linux-kernel@vger.kernel.org, syzkaller-bugs@googlegroups.com X-Headers-End: 1set4S-0007VL-UX Subject: [f2fs-dev] [syzbot] [f2fs?] possible deadlock in f2fs_release_file (2) 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: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: linux-f2fs-devel-bounces@lists.sourceforge.net Hello, syzbot found the following issue on: HEAD commit: 9e6869691724 Add linux-next specific files for 20240812 git tree: linux-next console output: https://syzkaller.appspot.com/x/log.txt?x=1203caf3980000 kernel config: https://syzkaller.appspot.com/x/.config?x=61ba6f3b22ee5467 dashboard link: https://syzkaller.appspot.com/bug?extid=9aff3b6811f0a00daffa compiler: Debian clang version 15.0.6, GNU ld (GNU Binutils for Debian) 2.40 Unfortunately, I don't have any reproducer for this issue yet. Downloadable assets: disk image: https://storage.googleapis.com/syzbot-assets/f1b086192f50/disk-9e686969.raw.xz vmlinux: https://storage.googleapis.com/syzbot-assets/b457920fb52e/vmlinux-9e686969.xz kernel image: https://storage.googleapis.com/syzbot-assets/e63ba9cce98a/bzImage-9e686969.xz IMPORTANT: if you fix the issue, please add the following tag to the commit: Reported-by: syzbot+9aff3b6811f0a00daffa@syzkaller.appspotmail.com F2FS-fs (loop0): Try to recover 1th superblock, ret: 0 F2FS-fs (loop0): Mounted with checkpoint version = 48b305e5 syz.0.98: attempt to access beyond end of device loop0: rw=2049, sector=45096, nr_sectors = 8 limit=40427 ====================================================== WARNING: possible circular locking dependency detected 6.11.0-rc3-next-20240812-syzkaller #0 Not tainted ------------------------------------------------------ syz.0.98/5917 is trying to acquire lock: ffff88807896ad30 (&sb->s_type->i_mutex_key#26){++++}-{3:3}, at: inode_lock include/linux/fs.h:799 [inline] ffff88807896ad30 (&sb->s_type->i_mutex_key#26){++++}-{3:3}, at: f2fs_release_file+0x9b/0x100 fs/f2fs/file.c:1940 but task is already holding lock: ffff88807896b308 (&fi->i_gc_rwsem[WRITE]){++++}-{3:3}, at: f2fs_down_write fs/f2fs/f2fs.h:2196 [inline] ffff88807896b308 (&fi->i_gc_rwsem[WRITE]){++++}-{3:3}, at: f2fs_commit_atomic_write+0x105/0x1510 fs/f2fs/segment.c:388 which lock already depends on the new lock. the existing dependency chain (in reverse order) is: -> #1 (&fi->i_gc_rwsem[WRITE]){++++}-{3:3}: lock_acquire+0x1ed/0x550 kernel/locking/lockdep.c:5762 down_write+0x99/0x220 kernel/locking/rwsem.c:1579 f2fs_down_write fs/f2fs/f2fs.h:2196 [inline] f2fs_setattr+0xb80/0x12d0 fs/f2fs/file.c:1060 notify_change+0xb9d/0xe70 fs/attr.c:535 do_truncate+0x220/0x310 fs/open.c:65 handle_truncate fs/namei.c:3395 [inline] do_open fs/namei.c:3745 [inline] path_openat+0x2ced/0x3470 fs/namei.c:3900 do_filp_open+0x235/0x490 fs/namei.c:3927 do_sys_openat2+0x13e/0x1d0 fs/open.c:1416 do_sys_open fs/open.c:1431 [inline] __do_sys_creat fs/open.c:1507 [inline] __se_sys_creat fs/open.c:1501 [inline] __x64_sys_creat+0x123/0x170 fs/open.c:1501 do_syscall_x64 arch/x86/entry/common.c:52 [inline] do_syscall_64+0xf3/0x230 arch/x86/entry/common.c:83 entry_SYSCALL_64_after_hwframe+0x77/0x7f -> #0 (&sb->s_type->i_mutex_key#26){++++}-{3:3}: check_prev_add kernel/locking/lockdep.c:3136 [inline] check_prevs_add kernel/locking/lockdep.c:3255 [inline] validate_chain+0x18e0/0x5900 kernel/locking/lockdep.c:3871 __lock_acquire+0x137a/0x2040 kernel/locking/lockdep.c:5145 lock_acquire+0x1ed/0x550 kernel/locking/lockdep.c:5762 down_write+0x99/0x220 kernel/locking/rwsem.c:1579 inode_lock include/linux/fs.h:799 [inline] f2fs_release_file+0x9b/0x100 fs/f2fs/file.c:1940 __fput+0x24a/0x8a0 fs/file_table.c:425 task_work_run+0x24f/0x310 kernel/task_work.c:228 get_signal+0x16ad/0x1810 kernel/signal.c:2690 arch_do_signal_or_restart+0x96/0x830 arch/x86/kernel/signal.c:337 exit_to_user_mode_loop kernel/entry/common.c:111 [inline] exit_to_user_mode_prepare include/linux/entry-common.h:328 [inline] __syscall_exit_to_user_mode_work kernel/entry/common.c:207 [inline] syscall_exit_to_user_mode+0xc9/0x370 kernel/entry/common.c:218 do_syscall_64+0x100/0x230 arch/x86/entry/common.c:89 entry_SYSCALL_64_after_hwframe+0x77/0x7f other info that might help us debug this: Possible unsafe locking scenario: CPU0 CPU1 ---- ---- lock(&fi->i_gc_rwsem[WRITE]); lock(&sb->s_type->i_mutex_key#26); lock(&fi->i_gc_rwsem[WRITE]); lock(&sb->s_type->i_mutex_key#26); *** DEADLOCK *** 1 lock held by syz.0.98/5917: #0: ffff88807896b308 (&fi->i_gc_rwsem[WRITE]){++++}-{3:3}, at: f2fs_down_write fs/f2fs/f2fs.h:2196 [inline] #0: ffff88807896b308 (&fi->i_gc_rwsem[WRITE]){++++}-{3:3}, at: f2fs_commit_atomic_write+0x105/0x1510 fs/f2fs/segment.c:388 stack backtrace: CPU: 0 UID: 0 PID: 5917 Comm: syz.0.98 Not tainted 6.11.0-rc3-next-20240812-syzkaller #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 06/27/2024 Call Trace: __dump_stack lib/dump_stack.c:94 [inline] dump_stack_lvl+0x241/0x360 lib/dump_stack.c:120 check_noncircular+0x36a/0x4a0 kernel/locking/lockdep.c:2189 check_prev_add kernel/locking/lockdep.c:3136 [inline] check_prevs_add kernel/locking/lockdep.c:3255 [inline] validate_chain+0x18e0/0x5900 kernel/locking/lockdep.c:3871 __lock_acquire+0x137a/0x2040 kernel/locking/lockdep.c:5145 lock_acquire+0x1ed/0x550 kernel/locking/lockdep.c:5762 down_write+0x99/0x220 kernel/locking/rwsem.c:1579 inode_lock include/linux/fs.h:799 [inline] f2fs_release_file+0x9b/0x100 fs/f2fs/file.c:1940 __fput+0x24a/0x8a0 fs/file_table.c:425 task_work_run+0x24f/0x310 kernel/task_work.c:228 get_signal+0x16ad/0x1810 kernel/signal.c:2690 arch_do_signal_or_restart+0x96/0x830 arch/x86/kernel/signal.c:337 exit_to_user_mode_loop kernel/entry/common.c:111 [inline] exit_to_user_mode_prepare include/linux/entry-common.h:328 [inline] __syscall_exit_to_user_mode_work kernel/entry/common.c:207 [inline] syscall_exit_to_user_mode+0xc9/0x370 kernel/entry/common.c:218 do_syscall_64+0x100/0x230 arch/x86/entry/common.c:89 entry_SYSCALL_64_after_hwframe+0x77/0x7f RIP: 0033:0x7f1c8c1779f9 Code: ff ff c3 66 2e 0f 1f 84 00 00 00 00 00 0f 1f 40 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 a8 ff ff ff f7 d8 64 89 01 48 RSP: 002b:00007f1c8d01f038 EFLAGS: 00000246 ORIG_RAX: 0000000000000010 RAX: fffffffffffffffb RBX: 00007f1c8c305f80 RCX: 00007f1c8c1779f9 RDX: 0000000000000000 RSI: 000000000000f502 RDI: 0000000000000004 RBP: 00007f1c8c1e58ee R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000 R13: 0000000000000000 R14: 00007f1c8c305f80 R15: 00007ffdbf6238f8 --- 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 report is already addressed, let syzbot know by replying with: #syz fix: exact-commit-title If you want to overwrite report's subsystems, reply with: #syz set subsystems: new-subsystem (See the list of subsystem names on the web dashboard) If the report is a duplicate of another one, 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