Received: by 2002:ab2:1149:0:b0:1f3:1f8c:d0c6 with SMTP id z9csp2546608lqz; Wed, 3 Apr 2024 00:46:56 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCUNKfF5OGrDoBaO/7W7B0W5F4TlNTYBxQOfOfVngwfHxSPo9tucf2Cxjd9q4cQZ7bxmaRbP+LhwVnNP/CtmuDpNd1zH5TvpjbChwlQ1cg== X-Google-Smtp-Source: AGHT+IEoLeoeoZE/4HWS2h9Vv2mZwPOk+MN0FmnoQs70Ubbf1pGMGJdGNE2EAXyE/AXek3qdY4yc X-Received: by 2002:a05:6402:2113:b0:568:a752:5fb3 with SMTP id bl19-20020a056402211300b00568a7525fb3mr3671255edb.15.1712130415977; Wed, 03 Apr 2024 00:46:55 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1712130415; cv=pass; d=google.com; s=arc-20160816; b=KLn+jkxj45fVyc9YORFKKByS8RAarcxCHceTdJtnlbR2pQDtJvwg65oVs3WlHvmwvu beTwJ39yxXIRuAwsw4VA4isDB2PuYHNldSN96Kzi2JaF34AM434lQ054kBr113AEQ3Wa cC8CL5Sfy4sN2SWXzaXE/IQa4ikjmF3MOwQ81ly/kA2B7r+jBtT5Xgww3RQvpG7HJmZ8 2qhSph6hqmxxkHZynUh55Ni3i6RgWUI2VeUqYT616/xAmh6Z57604ZacFIPw6HPmQPP7 a5dlcMyj+tqz1i8/MXJtO6A3YB4+KGJr3X12JyvKDs22iDmL9LwvqsLXF+bD7ck9ZaCk FKWw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=to:from:subject:message-id:date:mime-version:list-unsubscribe :list-subscribe:list-id:precedence; bh=l2M+8Zlt/7oWg+Ej7ANcfvSDt2vVUYRFfyU8+IioC+Q=; fh=en8FXpyzsJ4MW2lQJ0Hw+wPWqy4PG1ocBFdmSxl3+Kk=; b=l/Qy+AsCgzUTxTAuTVbTHKlO3dbO2LLF+dnU0yPmaoxCPK0obF49VOaSeGoLxI3gEy /bT7z4S9fKb6+2SrPje/R0pPg2pb4BnDMCf6bIRjJ91vlRGoUFo+EB5H29rZwdE8ysDm IwfHFkAEYD3SJ4fEilYcI1Qf6Ie5tCsAgWub72/B8uG+pWSKeJ7AjNqM6/Vlcyrk7CO2 a97FLpu/q0I/ZyBu7GQ5MeJPkYaK0MVuht09Dyb/2j5LBO1BoidZ2+UffJZK5iELsg+5 CEeIJKfkt1AuulwKGWZf5a0iqjgxNCtYyvGThmb2X5FnbZDSpVShfxIt3v9qoMiQY8l1 Yu3w==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; arc=pass (i=1 spf=pass spfdomain=m3kw2wvrgufz5godrsrytgd7.apphosting.bounces.google.com); spf=pass (google.com: domain of linux-ext4+bounces-1845-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-ext4+bounces-1845-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=appspotmail.com Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id k7-20020a508ac7000000b0056bf30ff6b4si6396739edk.122.2024.04.03.00.46.55 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 03 Apr 2024 00:46:55 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-ext4+bounces-1845-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) client-ip=147.75.80.249; Authentication-Results: mx.google.com; arc=pass (i=1 spf=pass spfdomain=m3kw2wvrgufz5godrsrytgd7.apphosting.bounces.google.com); spf=pass (google.com: domain of linux-ext4+bounces-1845-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-ext4+bounces-1845-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=appspotmail.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by am.mirrors.kernel.org (Postfix) with ESMTPS id B2D511F24F73 for ; Wed, 3 Apr 2024 07:45:54 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 1FD9867A14; Wed, 3 Apr 2024 07:45:32 +0000 (UTC) X-Original-To: linux-ext4@vger.kernel.org Received: from mail-io1-f71.google.com (mail-io1-f71.google.com [209.85.166.71]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 2C13B5D903 for ; Wed, 3 Apr 2024 07:45:29 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.166.71 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712130331; cv=none; b=ViKBDwUxvLpRWB/YwZj5Phmuv2C7hxIDP9Q7m61P9VofZh0g+PNKkG0sokq3STfGxgEgxzlbfBbMkMDE2XFyP+0WBKB7X6hK5eNkDllUiUMC2mQZ58ujqlud9HOMrDfPpexwp7daw5HG0czir0tuTQSZs4PDjziJfkqXnTZFeds= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712130331; c=relaxed/simple; bh=pWuz467CjJSWVxTNOZfQnY/x4aIclO9FZQFSkSMa9gA=; h=MIME-Version:Date:Message-ID:Subject:From:To:Content-Type; b=a8eCyiBr6hfWvq/LtiQ1j15BWcsaiEHg9TF0h1X5rCqEu4xVDeyw/RaCuvmErc8EcV8Ip2gZI8PlFA7WfE6fNyphJ2fe/8Ap4kQezNpnzns5ozRWzH64HJxkC5P6Qxx9EySxaOSMRn4TbSxyFBHOWbL/h41p0lCwMsz0yK+q3I8= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=fail (p=none dis=none) header.from=syzkaller.appspotmail.com; spf=pass smtp.mailfrom=M3KW2WVRGUFZ5GODRSRYTGD7.apphosting.bounces.google.com; arc=none smtp.client-ip=209.85.166.71 Authentication-Results: smtp.subspace.kernel.org; dmarc=fail (p=none dis=none) header.from=syzkaller.appspotmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=M3KW2WVRGUFZ5GODRSRYTGD7.apphosting.bounces.google.com Received: by mail-io1-f71.google.com with SMTP id ca18e2360f4ac-7c8a960bd9eso534660939f.0 for ; Wed, 03 Apr 2024 00:45:29 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1712130329; x=1712735129; h=to:from:subject:message-id:date:mime-version:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=l2M+8Zlt/7oWg+Ej7ANcfvSDt2vVUYRFfyU8+IioC+Q=; b=kLpnJ33MXrz01J/xGRJXcWgTUz5v5Q0C0QzLw7b9NfoZBFsq5MRAX2dvCHQ7MUleAx nq5cnfUIRgJcsDipjhd8RhTMQOrlOXPvu74sJpltUyfUkGoCoag7OC+CmiWQTM7qApDS i5bZ53uvaMWyBNJeisCM8HkZdJAUbSfDZmU56wOuYJC15YoqxjVU6OrGlujiW7Y3iyr6 b8TDJaJwieba/rwZL775ABvYX8HE+05uCA+XOL9jInFEHv9vvqFG/1/0pjtY+5BqdFjN /UqaNahXKWN3mzPlZb08HBrhz/5eG+uVjbZ7Z2CPJo3erzddl1qZbUaOZRnLE03b1QDa GATA== X-Forwarded-Encrypted: i=1; AJvYcCViMCwxQrTEQtiAV9NCxu3pMjY+wnXHOjxMAnaBqGqHUxN/pXPlDDbaGaNafC8k+M9FW+5a0AHj5064gBfo3/RqybpK57+1Bf8ARg== X-Gm-Message-State: AOJu0YxX8g+g1D6e/Nvni4d/uiJRNKGnHZd8FADZSgD/ccb4QpIE8cOt O0WsqawL91h1Xyvzss68tqiNsfXfINxqBEaV4ph6ypP0FNEasf6kMh1UMDafD/Yv2z3aXDAgAqx lnBpSQwIbb3f/4X7H/6uvW1A7S4pZF3kdanpGSuSAe2cxDQacqzeN9Yo= Precedence: bulk X-Mailing-List: linux-ext4@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Received: by 2002:a05:6e02:1785:b0:368:c9e2:b372 with SMTP id y5-20020a056e02178500b00368c9e2b372mr889614ilu.0.1712130329291; Wed, 03 Apr 2024 00:45:29 -0700 (PDT) Date: Wed, 03 Apr 2024 00:45:29 -0700 X-Google-Appengine-App-Id: s~syzkaller X-Google-Appengine-App-Id-Alias: syzkaller Message-ID: <000000000000163e1406152c6877@google.com> Subject: [syzbot] [ext4?] possible deadlock in ext4_xattr_inode_iget (3) From: syzbot To: adilger.kernel@dilger.ca, linux-ext4@vger.kernel.org, linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, syzkaller-bugs@googlegroups.com, tytso@mit.edu Content-Type: text/plain; charset="UTF-8" Hello, syzbot found the following issue on: HEAD commit: fe46a7dd189e Merge tag 'sound-6.9-rc1' of git://git.kernel.. git tree: upstream console+strace: https://syzkaller.appspot.com/x/log.txt?x=11a1e52d180000 kernel config: https://syzkaller.appspot.com/x/.config?x=1a07d5da4eb21586 dashboard link: https://syzkaller.appspot.com/bug?extid=ee72b9a7aad1e5a77c5c compiler: gcc (Debian 12.2.0-14) 12.2.0, GNU ld (GNU Binutils for Debian) 2.40 syz repro: https://syzkaller.appspot.com/x/repro.syz?x=12407f45180000 C reproducer: https://syzkaller.appspot.com/x/repro.c?x=140d9db1180000 Downloadable assets: disk image: https://storage.googleapis.com/syzbot-assets/b42ab0fd4947/disk-fe46a7dd.raw.xz vmlinux: https://storage.googleapis.com/syzbot-assets/b8a6e7231930/vmlinux-fe46a7dd.xz kernel image: https://storage.googleapis.com/syzbot-assets/4fbf3e4ce6f8/bzImage-fe46a7dd.xz mounted in repro: https://storage.googleapis.com/syzbot-assets/5d293cee060a/mount_0.gz IMPORTANT: if you fix the issue, please add the following tag to the commit: Reported-by: syzbot+ee72b9a7aad1e5a77c5c@syzkaller.appspotmail.com ====================================================== WARNING: possible circular locking dependency detected 6.8.0-syzkaller-08951-gfe46a7dd189e #0 Not tainted ------------------------------------------------------ syz-executor545/5275 is trying to acquire lock: ffff888077730400 (&ea_inode->i_rwsem#8/1){+.+.}-{3:3}, at: inode_lock include/linux/fs.h:793 [inline] ffff888077730400 (&ea_inode->i_rwsem#8/1){+.+.}-{3:3}, at: ext4_xattr_inode_iget+0x173/0x440 fs/ext4/xattr.c:461 but task is already holding lock: ffff888077730c88 (&ei->i_data_sem/3){++++}-{3:3}, at: ext4_setattr+0x1ba0/0x29d0 fs/ext4/inode.c:5417 which lock already depends on the new lock. the existing dependency chain (in reverse order) is: -> #1 (&ei->i_data_sem/3){++++}-{3:3}: down_write+0x3a/0x50 kernel/locking/rwsem.c:1579 ext4_update_i_disksize fs/ext4/ext4.h:3383 [inline] ext4_xattr_inode_write fs/ext4/xattr.c:1446 [inline] ext4_xattr_inode_lookup_create fs/ext4/xattr.c:1594 [inline] ext4_xattr_set_entry+0x3a14/0x3cf0 fs/ext4/xattr.c:1719 ext4_xattr_ibody_set+0x126/0x380 fs/ext4/xattr.c:2287 ext4_xattr_set_handle+0x98d/0x1480 fs/ext4/xattr.c:2444 ext4_xattr_set+0x149/0x380 fs/ext4/xattr.c:2558 __vfs_setxattr+0x176/0x1e0 fs/xattr.c:200 __vfs_setxattr_noperm+0x127/0x5e0 fs/xattr.c:234 __vfs_setxattr_locked+0x182/0x260 fs/xattr.c:295 vfs_setxattr+0x146/0x350 fs/xattr.c:321 do_setxattr+0x146/0x170 fs/xattr.c:629 setxattr+0x15d/0x180 fs/xattr.c:652 path_setxattr+0x179/0x1e0 fs/xattr.c:671 __do_sys_lsetxattr fs/xattr.c:694 [inline] __se_sys_lsetxattr fs/xattr.c:690 [inline] __x64_sys_lsetxattr+0xc1/0x160 fs/xattr.c:690 do_syscall_x64 arch/x86/entry/common.c:52 [inline] do_syscall_64+0xd5/0x260 arch/x86/entry/common.c:83 entry_SYSCALL_64_after_hwframe+0x6d/0x75 -> #0 (&ea_inode->i_rwsem#8/1){+.+.}-{3:3}: check_prev_add kernel/locking/lockdep.c:3134 [inline] check_prevs_add kernel/locking/lockdep.c:3253 [inline] validate_chain kernel/locking/lockdep.c:3869 [inline] __lock_acquire+0x2478/0x3b30 kernel/locking/lockdep.c:5137 lock_acquire kernel/locking/lockdep.c:5754 [inline] lock_acquire+0x1b1/0x540 kernel/locking/lockdep.c:5719 down_write+0x3a/0x50 kernel/locking/rwsem.c:1579 inode_lock include/linux/fs.h:793 [inline] ext4_xattr_inode_iget+0x173/0x440 fs/ext4/xattr.c:461 ext4_xattr_inode_get+0x16c/0x870 fs/ext4/xattr.c:535 ext4_xattr_move_to_block fs/ext4/xattr.c:2640 [inline] ext4_xattr_make_inode_space fs/ext4/xattr.c:2742 [inline] ext4_expand_extra_isize_ea+0x1367/0x1ae0 fs/ext4/xattr.c:2834 __ext4_expand_extra_isize+0x346/0x480 fs/ext4/inode.c:5789 ext4_try_to_expand_extra_isize fs/ext4/inode.c:5832 [inline] __ext4_mark_inode_dirty+0x55a/0x860 fs/ext4/inode.c:5910 ext4_setattr+0x1c14/0x29d0 fs/ext4/inode.c:5420 notify_change+0x745/0x11c0 fs/attr.c:497 do_truncate+0x15c/0x220 fs/open.c:65 handle_truncate fs/namei.c:3300 [inline] do_open fs/namei.c:3646 [inline] path_openat+0x24b9/0x2990 fs/namei.c:3799 do_filp_open+0x1dc/0x430 fs/namei.c:3826 do_sys_openat2+0x17a/0x1e0 fs/open.c:1406 do_sys_open fs/open.c:1421 [inline] __do_sys_openat fs/open.c:1437 [inline] __se_sys_openat fs/open.c:1432 [inline] __x64_sys_openat+0x175/0x210 fs/open.c:1432 do_syscall_x64 arch/x86/entry/common.c:52 [inline] do_syscall_64+0xd5/0x260 arch/x86/entry/common.c:83 entry_SYSCALL_64_after_hwframe+0x6d/0x75 other info that might help us debug this: Possible unsafe locking scenario: CPU0 CPU1 ---- ---- lock(&ei->i_data_sem/3); lock(&ea_inode->i_rwsem#8/1); lock(&ei->i_data_sem/3); lock(&ea_inode->i_rwsem#8/1); *** DEADLOCK *** 5 locks held by syz-executor545/5275: #0: ffff888022da6420 (sb_writers#4){.+.+}-{0:0}, at: do_open fs/namei.c:3635 [inline] #0: ffff888022da6420 (sb_writers#4){.+.+}-{0:0}, at: path_openat+0x1fba/0x2990 fs/namei.c:3799 #1: ffff888077730e00 (&sb->s_type->i_mutex_key#8){++++}-{3:3}, at: inode_lock include/linux/fs.h:793 [inline] #1: ffff888077730e00 (&sb->s_type->i_mutex_key#8){++++}-{3:3}, at: do_truncate+0x14b/0x220 fs/open.c:63 #2: ffff888077730fa0 (mapping.invalidate_lock){++++}-{3:3}, at: filemap_invalidate_lock include/linux/fs.h:838 [inline] #2: ffff888077730fa0 (mapping.invalidate_lock){++++}-{3:3}, at: ext4_setattr+0xdfd/0x29d0 fs/ext4/inode.c:5378 #3: ffff888077730c88 (&ei->i_data_sem/3){++++}-{3:3}, at: ext4_setattr+0x1ba0/0x29d0 fs/ext4/inode.c:5417 #4: ffff888077730ac8 (&ei->xattr_sem){++++}-{3:3}, at: ext4_write_trylock_xattr fs/ext4/xattr.h:162 [inline] #4: ffff888077730ac8 (&ei->xattr_sem){++++}-{3:3}, at: ext4_try_to_expand_extra_isize fs/ext4/inode.c:5829 [inline] #4: ffff888077730ac8 (&ei->xattr_sem){++++}-{3:3}, at: __ext4_mark_inode_dirty+0x4cf/0x860 fs/ext4/inode.c:5910 stack backtrace: CPU: 1 PID: 5275 Comm: syz-executor545 Not tainted 6.8.0-syzkaller-08951-gfe46a7dd189e #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 03/27/2024 Call Trace: __dump_stack lib/dump_stack.c:88 [inline] dump_stack_lvl+0x116/0x1f0 lib/dump_stack.c:114 check_noncircular+0x31a/0x400 kernel/locking/lockdep.c:2187 check_prev_add kernel/locking/lockdep.c:3134 [inline] check_prevs_add kernel/locking/lockdep.c:3253 [inline] validate_chain kernel/locking/lockdep.c:3869 [inline] __lock_acquire+0x2478/0x3b30 kernel/locking/lockdep.c:5137 lock_acquire kernel/locking/lockdep.c:5754 [inline] lock_acquire+0x1b1/0x540 kernel/locking/lockdep.c:5719 down_write+0x3a/0x50 kernel/locking/rwsem.c:1579 inode_lock include/linux/fs.h:793 [inline] ext4_xattr_inode_iget+0x173/0x440 fs/ext4/xattr.c:461 ext4_xattr_inode_get+0x16c/0x870 fs/ext4/xattr.c:535 ext4_xattr_move_to_block fs/ext4/xattr.c:2640 [inline] ext4_xattr_make_inode_space fs/ext4/xattr.c:2742 [inline] ext4_expand_extra_isize_ea+0x1367/0x1ae0 fs/ext4/xattr.c:2834 __ext4_expand_extra_isize+0x346/0x480 fs/ext4/inode.c:5789 ext4_try_to_expand_extra_isize fs/ext4/inode.c:5832 [inline] __ext4_mark_inode_dirty+0x55a/0x860 fs/ext4/inode.c:5910 ext4_setattr+0x1c14/0x29d0 fs/ext4/inode.c:5420 notify_change+0x745/0x11c0 fs/attr.c:497 do_truncate+0x15c/0x220 fs/open.c:65 handle_truncate fs/namei.c:3300 [inline] do_open fs/namei.c:3646 [inline] path_openat+0x24b9/0x2990 fs/namei.c:3799 do_filp_open+0x1dc/0x430 fs/namei.c:3826 do_sys_openat2+0x17a/0x1e0 fs/open.c:1406 do_sys_open fs/open.c:1421 [inline] __do_sys_openat fs/open.c:1437 [inline] __se_sys_openat fs/open.c:1432 [inline] __x64_sys_openat+0x175/0x210 fs/open.c:1432 do_syscall_x64 arch/x86/entry/common.c:52 [inline] do_syscall_64+0xd5/0x260 arch/x86/entry/common.c:83 entry_SYSCALL_64_after_hwframe+0x6d/0x75 RIP: 0033:0x7fc7c030b2e9 Code: 28 00 00 00 75 05 48 83 c4 28 c3 e8 21 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:00007ffc3c4a0608 EFLAGS: 00000246 ORIG_RAX: 0000000000000101 RAX: ffffffffffffffda RBX: 0031656c69662f2e RCX: 00007fc7c030b2e9 RDX: 0000000000143362 RSI: 00000000200000c0 RDI: 00000000ffffff9c RBP: 6c6c616c65646f6e R08: 00007ffc3c4a0640 R09: 00007ffc3c4a0640 R10: 000000000a000000 R11: 0000000000000246 R12: 00007ffc3c4a062c R13: 0000000000000040 R14: 431bde82d7b634db R15: 00007ffc3c4a0660 --- 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 syzbot to run the reproducer, reply with: #syz test: git://repo/address.git branch-or-commit-hash If you attach or paste a git patch, syzbot will apply it before testing. 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