Received: by 2002:a05:6358:9144:b0:117:f937:c515 with SMTP id r4csp1474154rwr; Fri, 5 May 2023 14:59:50 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ4fU88C/fpP0m0iM1xeq+ipEvRdH/ke0pY05v6FCq6CZP4rthzT7BrH1L1PsKhYjaVIPKDu X-Received: by 2002:a17:903:2656:b0:1ab:8f4:af2b with SMTP id je22-20020a170903265600b001ab08f4af2bmr2547755plb.38.1683323990517; Fri, 05 May 2023 14:59:50 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1683323990; cv=none; d=google.com; s=arc-20160816; b=Dqn+8U2w5Xq2hnd6x3Ni9Qh0WVwhWEi0zDs1mqU61t5nwtokjuxtfnmIOiiSaruVXm 30GwxEw9WoVxwFBNBI656cRKEtFB9dkBCcGMoTwpIxwt5A144+9zATaIH/3otd+FgScA m/ti5DzKhaEDJqENdjoaktkfMJ8ReWHM+YEDRVqPM3A/snS0gCOuMdaoAWSzHWYD6UJU lyc82EwMfOVZU5wH76nlNX6OVDwFJ4SCg2piMNR2WFa0u5PHgHa75e/vxUe5aiPne5mz QXPdiuS/DBsgAe8vNPZpBp2WWO604LCCQnSaMZAl+EdG4PzBkQVeQ36CxTmiieMVskUc FsTA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:to:from:subject:message-id:in-reply-to:date :mime-version; bh=E7jMC4Y/MwtJxVB+XvqmNFutBQ5y0DuObCQpShWAyDA=; b=Qwh2kFzJ8EFfbrZ1BNuouJGNkorxGmw4rLNmYP5choFCGF6IKd8Mgb63T56cZDMTTG XTOh28f3/xPotECR5k8iJpv5odBgNdryhcLnEE5zbYj71MW6kOeyNswDPoQvnNAtJ17z ssYxqkkpWfe/y/QFFyRVUi9TfbTd+6C07wpVWfzka1GW7dQm/8TMwP9asJd1rUyWyE5R VcHOyjyEosZqPs5O2eRD6hjLQIHfTpSpAplUWr1dfCbr+f/UL2CdK1gTzOcen5jxjoWD vUpniYBbITtRLg70yIUs5jdwqrsAi6KNycJBw+4ttPmRV0UxVG6MYle2K9AoO8YAqwyB hhvA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=appspotmail.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id x14-20020a1709027c0e00b001a637201992si2396283pll.488.2023.05.05.14.59.36; Fri, 05 May 2023 14:59:50 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=appspotmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232718AbjEEVtA (ORCPT + 99 others); Fri, 5 May 2023 17:49:00 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49070 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232290AbjEEVs5 (ORCPT ); Fri, 5 May 2023 17:48:57 -0400 Received: from mail-il1-f205.google.com (mail-il1-f205.google.com [209.85.166.205]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 640E6E8 for ; Fri, 5 May 2023 14:48:49 -0700 (PDT) Received: by mail-il1-f205.google.com with SMTP id e9e14a558f8ab-32f240747cdso124110705ab.1 for ; Fri, 05 May 2023 14:48:49 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1683323328; x=1685915328; h=to:from:subject:message-id:in-reply-to:date:mime-version :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=E7jMC4Y/MwtJxVB+XvqmNFutBQ5y0DuObCQpShWAyDA=; b=CkqeKAorWhoSLouRdAAQEdVJMI7qBRrr+KCv4eqCarj/E4ptrR6e7ZOVf9DuNhgxTP 7bXmK1LjudkYGmFZzAfG60FbieL20oOGJvMzYKnjWUxhl3Yb0h5BTNHgPYLRl9jJA7d9 h2gmfufzK72/bUakQWX6EwtGQGLPLCZ4TBVvNRM3jbxYaVwTLO4vqqZBriXmX+7QrrIu /ug14XU4rrfP/SkFBzbVv5Bk4ER2DGydjMpdSMI3hqtTnDKTQ4yetDPMyoDwPL44shtd v+IoPB4Poq4yKuxrOk/tVjcndy0VSEgFVPXQwMIa6DGTDLyYFM5FJmAftPRAn9sY5YkV SCgw== X-Gm-Message-State: AC+VfDyV0d6hJZe3wjfG+BIoEcz36Ec87enKUkJiXthT/H5Vb6wUBNcv RFXITUDeCMTgz8pZDadYzdio94a8y3WMuwS6fWRuHqJ1thLj MIME-Version: 1.0 X-Received: by 2002:a92:7c04:0:b0:32b:fc:52b1 with SMTP id x4-20020a927c04000000b0032b00fc52b1mr2179768ilc.0.1683323328678; Fri, 05 May 2023 14:48:48 -0700 (PDT) Date: Fri, 05 May 2023 14:48:48 -0700 In-Reply-To: <000000000000f6540d05f30bb23f@google.com> X-Google-Appengine-App-Id: s~syzkaller X-Google-Appengine-App-Id-Alias: syzkaller Message-ID: <0000000000000c53dd05faf94183@google.com> Subject: Re: [syzbot] [ext4?] possible deadlock in ext4_xattr_set_handle (3) From: syzbot To: adilger.kernel@dilger.ca, dvyukov@google.com, jack@suse.cz, 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" X-Spam-Status: No, score=0.8 required=5.0 tests=BAYES_00,FROM_LOCAL_HEX, HEADER_FROM_DIFFERENT_DOMAINS,RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2, SORTED_RECIPS,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org syzbot has found a reproducer for the following issue on: HEAD commit: 14f8db1c0f9a Merge branch 'for-next/core' into for-kernelci git tree: git://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux.git for-kernelci console output: https://syzkaller.appspot.com/x/log.txt?x=1663f338280000 kernel config: https://syzkaller.appspot.com/x/.config?x=a837a8ba7e88bb45 dashboard link: https://syzkaller.appspot.com/bug?extid=edce54daffee36421b4c compiler: Debian clang version 15.0.7, GNU ld (GNU Binutils for Debian) 2.35.2 userspace arch: arm64 syz repro: https://syzkaller.appspot.com/x/repro.syz?x=17595ed4280000 C reproducer: https://syzkaller.appspot.com/x/repro.c?x=16e85322280000 Downloadable assets: disk image: https://storage.googleapis.com/syzbot-assets/ad6ce516eed3/disk-14f8db1c.raw.xz vmlinux: https://storage.googleapis.com/syzbot-assets/1f38c2cc7667/vmlinux-14f8db1c.xz kernel image: https://storage.googleapis.com/syzbot-assets/d795115eee39/Image-14f8db1c.gz.xz mounted in repro: https://storage.googleapis.com/syzbot-assets/092c100a5922/mount_0.gz IMPORTANT: if you fix the issue, please add the following tag to the commit: Reported-by: syzbot+edce54daffee36421b4c@syzkaller.appspotmail.com loop0: detected capacity change from 0 to 512 EXT4-fs (loop0): mounted filesystem 00000000-0000-0000-0000-000000000000 without journal. Quota mode: writeback. ====================================================== WARNING: possible circular locking dependency detected 6.3.0-rc7-syzkaller-g14f8db1c0f9a #0 Not tainted ------------------------------------------------------ syz-executor392/5925 is trying to acquire lock: ffff0000e0dbb2f0 (&ei->xattr_sem){++++}-{3:3}, at: ext4_write_lock_xattr fs/ext4/xattr.h:155 [inline] ffff0000e0dbb2f0 (&ei->xattr_sem){++++}-{3:3}, at: ext4_xattr_set_handle+0x1e0/0x12d8 fs/ext4/xattr.c:2373 but task is already holding lock: ffff0000e0dbb628 (&ea_inode->i_rwsem#8/1){+.+.}-{3:3}, at: inode_lock include/linux/fs.h:758 [inline] ffff0000e0dbb628 (&ea_inode->i_rwsem#8/1){+.+.}-{3:3}, at: vfs_setxattr+0x17c/0x344 fs/xattr.c:323 which lock already depends on the new lock. the existing dependency chain (in reverse order) is: -> #1 (&ea_inode->i_rwsem#8/1){+.+.}-{3:3}: down_write+0x50/0xc0 kernel/locking/rwsem.c:1573 inode_lock include/linux/fs.h:758 [inline] ext4_xattr_inode_create fs/ext4/xattr.c:1525 [inline] ext4_xattr_inode_lookup_create fs/ext4/xattr.c:1608 [inline] ext4_xattr_set_entry+0x2394/0x2c3c fs/ext4/xattr.c:1737 ext4_xattr_block_set+0x8e0/0x2cc4 fs/ext4/xattr.c:2043 ext4_xattr_set_handle+0xb2c/0x12d8 fs/ext4/xattr.c:2458 ext4_xattr_set+0x1e0/0x354 fs/ext4/xattr.c:2560 ext4_xattr_trusted_set+0x4c/0x64 fs/ext4/xattr_trusted.c:38 __vfs_setxattr+0x3d8/0x400 fs/xattr.c:203 __vfs_setxattr_noperm+0x110/0x528 fs/xattr.c:237 __vfs_setxattr_locked+0x1ec/0x218 fs/xattr.c:298 vfs_setxattr+0x1a8/0x344 fs/xattr.c:324 do_setxattr fs/xattr.c:609 [inline] setxattr+0x208/0x29c fs/xattr.c:632 path_setxattr+0x17c/0x258 fs/xattr.c:651 __do_sys_setxattr fs/xattr.c:667 [inline] __se_sys_setxattr fs/xattr.c:663 [inline] __arm64_sys_setxattr+0xbc/0xd8 fs/xattr.c:663 __invoke_syscall arch/arm64/kernel/syscall.c:38 [inline] invoke_syscall+0x98/0x2c0 arch/arm64/kernel/syscall.c:52 el0_svc_common+0x138/0x258 arch/arm64/kernel/syscall.c:142 do_el0_svc+0x64/0x198 arch/arm64/kernel/syscall.c:193 el0_svc+0x4c/0x15c arch/arm64/kernel/entry-common.c:637 el0t_64_sync_handler+0x84/0xf0 arch/arm64/kernel/entry-common.c:655 el0t_64_sync+0x190/0x194 arch/arm64/kernel/entry.S:591 -> #0 (&ei->xattr_sem){++++}-{3:3}: check_prev_add kernel/locking/lockdep.c:3098 [inline] check_prevs_add kernel/locking/lockdep.c:3217 [inline] validate_chain kernel/locking/lockdep.c:3832 [inline] __lock_acquire+0x3338/0x764c kernel/locking/lockdep.c:5056 lock_acquire+0x238/0x718 kernel/locking/lockdep.c:5669 down_write+0x50/0xc0 kernel/locking/rwsem.c:1573 ext4_write_lock_xattr fs/ext4/xattr.h:155 [inline] ext4_xattr_set_handle+0x1e0/0x12d8 fs/ext4/xattr.c:2373 ext4_xattr_set+0x1e0/0x354 fs/ext4/xattr.c:2560 ext4_xattr_trusted_set+0x4c/0x64 fs/ext4/xattr_trusted.c:38 __vfs_setxattr+0x3d8/0x400 fs/xattr.c:203 __vfs_setxattr_noperm+0x110/0x528 fs/xattr.c:237 __vfs_setxattr_locked+0x1ec/0x218 fs/xattr.c:298 vfs_setxattr+0x1a8/0x344 fs/xattr.c:324 do_setxattr fs/xattr.c:609 [inline] setxattr+0x208/0x29c fs/xattr.c:632 path_setxattr+0x17c/0x258 fs/xattr.c:651 __do_sys_setxattr fs/xattr.c:667 [inline] __se_sys_setxattr fs/xattr.c:663 [inline] __arm64_sys_setxattr+0xbc/0xd8 fs/xattr.c:663 __invoke_syscall arch/arm64/kernel/syscall.c:38 [inline] invoke_syscall+0x98/0x2c0 arch/arm64/kernel/syscall.c:52 el0_svc_common+0x138/0x258 arch/arm64/kernel/syscall.c:142 do_el0_svc+0x64/0x198 arch/arm64/kernel/syscall.c:193 el0_svc+0x4c/0x15c arch/arm64/kernel/entry-common.c:637 el0t_64_sync_handler+0x84/0xf0 arch/arm64/kernel/entry-common.c:655 el0t_64_sync+0x190/0x194 arch/arm64/kernel/entry.S:591 other info that might help us debug this: Possible unsafe locking scenario: CPU0 CPU1 ---- ---- lock(&ea_inode->i_rwsem#8/1); lock(&ei->xattr_sem); lock(&ea_inode->i_rwsem#8/1); lock(&ei->xattr_sem); *** DEADLOCK *** 2 locks held by syz-executor392/5925: #0: ffff0000d80e6460 (sb_writers#3){.+.+}-{0:0}, at: mnt_want_write+0x44/0x9c fs/namespace.c:394 #1: ffff0000e0dbb628 (&ea_inode->i_rwsem#8/1){+.+.}-{3:3}, at: inode_lock include/linux/fs.h:758 [inline] #1: ffff0000e0dbb628 (&ea_inode->i_rwsem#8/1){+.+.}-{3:3}, at: vfs_setxattr+0x17c/0x344 fs/xattr.c:323 stack backtrace: CPU: 1 PID: 5925 Comm: syz-executor392 Not tainted 6.3.0-rc7-syzkaller-g14f8db1c0f9a #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 04/14/2023 Call trace: dump_backtrace+0x1b8/0x1e4 arch/arm64/kernel/stacktrace.c:233 show_stack+0x2c/0x44 arch/arm64/kernel/stacktrace.c:240 __dump_stack lib/dump_stack.c:88 [inline] dump_stack_lvl+0xd0/0x124 lib/dump_stack.c:106 dump_stack+0x1c/0x28 lib/dump_stack.c:113 print_circular_bug+0x150/0x1b8 kernel/locking/lockdep.c:2056 check_noncircular+0x2cc/0x378 kernel/locking/lockdep.c:2178 check_prev_add kernel/locking/lockdep.c:3098 [inline] check_prevs_add kernel/locking/lockdep.c:3217 [inline] validate_chain kernel/locking/lockdep.c:3832 [inline] __lock_acquire+0x3338/0x764c kernel/locking/lockdep.c:5056 lock_acquire+0x238/0x718 kernel/locking/lockdep.c:5669 down_write+0x50/0xc0 kernel/locking/rwsem.c:1573 ext4_write_lock_xattr fs/ext4/xattr.h:155 [inline] ext4_xattr_set_handle+0x1e0/0x12d8 fs/ext4/xattr.c:2373 ext4_xattr_set+0x1e0/0x354 fs/ext4/xattr.c:2560 ext4_xattr_trusted_set+0x4c/0x64 fs/ext4/xattr_trusted.c:38 __vfs_setxattr+0x3d8/0x400 fs/xattr.c:203 __vfs_setxattr_noperm+0x110/0x528 fs/xattr.c:237 __vfs_setxattr_locked+0x1ec/0x218 fs/xattr.c:298 vfs_setxattr+0x1a8/0x344 fs/xattr.c:324 do_setxattr fs/xattr.c:609 [inline] setxattr+0x208/0x29c fs/xattr.c:632 path_setxattr+0x17c/0x258 fs/xattr.c:651 __do_sys_setxattr fs/xattr.c:667 [inline] __se_sys_setxattr fs/xattr.c:663 [inline] __arm64_sys_setxattr+0xbc/0xd8 fs/xattr.c:663 __invoke_syscall arch/arm64/kernel/syscall.c:38 [inline] invoke_syscall+0x98/0x2c0 arch/arm64/kernel/syscall.c:52 el0_svc_common+0x138/0x258 arch/arm64/kernel/syscall.c:142 do_el0_svc+0x64/0x198 arch/arm64/kernel/syscall.c:193 el0_svc+0x4c/0x15c arch/arm64/kernel/entry-common.c:637 el0t_64_sync_handler+0x84/0xf0 arch/arm64/kernel/entry-common.c:655 el0t_64_sync+0x190/0x194 arch/arm64/kernel/entry.S:591 --- 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.