Received: by 2002:ab2:1149:0:b0:1f3:1f8c:d0c6 with SMTP id z9csp2717446lqz; Wed, 3 Apr 2024 06:46:47 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCVSCFPueXUKiKXDA8l2yqOY5Z2kn6QXfBArqHFNRtX7EYjTfI7uCWQYQ2qCxw80pHeqmIcRZkLrCoSi5v0NyhH3qMZ1BJyBtFxbDxSA/Q== X-Google-Smtp-Source: AGHT+IH+FlXLFdrfUDHbuNNTDVqs5+8Oe6R+plJ9D6yhIp3F2maYIPukthPV16FUBgphtQpjiBsR X-Received: by 2002:a05:6a21:394c:b0:1a5:7409:f2ce with SMTP id ac12-20020a056a21394c00b001a57409f2cemr3634741pzc.25.1712152006770; Wed, 03 Apr 2024 06:46:46 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1712152006; cv=pass; d=google.com; s=arc-20160816; b=sUbgPocyn3gaq2Bhg2SsxWVCJ/82Lp+bW4a2yLAcqCJykDKc9344YZMfPcv6gmobiS So4hqxsGAvJ4bmRE2CbCu7vroCqY4o+H5s84kA/3eCsK91Wn/3oW9xpszrip/A3DXhMz NBNe0o1g1tGRPjE8hLOS3PINyqCPH8Eu8+zWZyraGG4qCsK2gy+YAldQ0WAiH0qyP44j tdBVbhJ2vTTsyQJ6vQcxjg+j0yMgvzeQ39wqYmTTCFcYMP/HVZSh8wKWuBH2kJOjX3MZ RTU1vVPbl6oB7SUI9kyNjC7r6/Te/mwcNdn+iyy4gb27Aka0AAzX6r7hWwxMzbISyRLZ ytoQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:cc:to:from; bh=ae5RHvbES9rKs4+Mv/7MLBIkSf+9KnMvhI3WK6RpNrM=; fh=x8kyV/hAhTFrNkhEtOPdvvgofU5I2UqTTCfFQYeWKW0=; b=rAAwRghW1EpjUcRxNaN7d5vxV10hJLvSgFrPXE0s7ZV6zqLAw9gdIdWPD7aS23ZMVK 9bN1vz20P+MPEVrzm3G4vMNfvDYhGOjgUsiS+Y/7yvTJ4Eo2fb8KcukBeLRTBkHgpeNH q5Dx5MNhU13vGMkkztXFRr/uIFQUJX3m8yjvLpM4baCv9w1y6BSLkRMHp/7gqB7hhInU ggGDasEMGp7/vtjyIp+VDxP5uIZtAa7FiyvnsZYFuhLfmOIPp0TKpUwb/TzcKnom6hlY XOoIAjwP2AoS2DQ3PrFWriBTNGjs1U7hpqmkyQVB6ExpGDZqPsfjuLOqVMyMZ4aVN63b WyOA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; arc=pass (i=1 spf=pass spfdomain=sina.com); spf=pass (google.com: domain of linux-kernel+bounces-129869-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-129869-linux.lists.archive=gmail.com@vger.kernel.org" Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [139.178.88.99]) by mx.google.com with ESMTPS id p18-20020a63f452000000b005e42b580aadsi12975202pgk.393.2024.04.03.06.46.46 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 03 Apr 2024 06:46:46 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-129869-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) client-ip=139.178.88.99; Authentication-Results: mx.google.com; arc=pass (i=1 spf=pass spfdomain=sina.com); spf=pass (google.com: domain of linux-kernel+bounces-129869-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-129869-linux.lists.archive=gmail.com@vger.kernel.org" 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 sv.mirrors.kernel.org (Postfix) with ESMTPS id CF38428B209 for ; Wed, 3 Apr 2024 13:45:33 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 9A4C81487DD; Wed, 3 Apr 2024 13:45:23 +0000 (UTC) Received: from mail115-24.sinamail.sina.com.cn (mail115-24.sinamail.sina.com.cn [218.30.115.24]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 3DA5D14882F for ; Wed, 3 Apr 2024 13:45:17 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=218.30.115.24 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712151923; cv=none; b=E33b/uEaI4LcJhLQbCzbXZiP3vLufWZcZZaqN7v2IN4+XOf3z8GVpQlCsX0XHA0g1ACr0DHs2QL07bgbJtncV5pFPbARHVZZOA3Sr9IXuBFyAQOnVk6/pQiNF0RUyOSbyXbuZaggxS7BG6viaolA3uzN1El4YWPydNRqQ4RWKq0= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712151923; c=relaxed/simple; bh=O07xnjRsa7k7EJrY+kYBTnDqh8XuCQVYPFppMb3MoMI=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=uUbGk9butQEHLhwAOOKylbuVFRX8Z9Dpux4ebw2XkdAb3RhVejqCGAyl7arsSjFdF7JYDi22li/169g+5vWmuuIsIxxnEcKrsIu50y4DFFUoOo6xAbtJPscgFy2NqhEG2B6U5QBAGbXAFPpdx7lKyEs0qKTMaLfJKbNXZYAZ7U8= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=sina.com; spf=pass smtp.mailfrom=sina.com; arc=none smtp.client-ip=218.30.115.24 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=sina.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=sina.com X-SMAIL-HELO: localhost.localdomain Received: from unknown (HELO localhost.localdomain)([113.118.65.100]) by sina.com (10.75.12.45) with ESMTP id 660D5D5F000015E2; Wed, 3 Apr 2024 21:45:09 +0800 (CST) X-Sender: hdanton@sina.com X-Auth-ID: hdanton@sina.com Authentication-Results: sina.com; spf=none smtp.mailfrom=hdanton@sina.com; dkim=none header.i=none; dmarc=none action=none header.from=hdanton@sina.com X-SMAIL-MID: 89214631458053 X-SMAIL-UIID: 77D3CE8F15604429B8820C1A6E712938-20240403-214509-1 From: Hillf Danton To: syzbot Cc: linux-kernel@vger.kernel.org, syzkaller-bugs@googlegroups.com Subject: Re: [syzbot] [ext4?] possible deadlock in ext4_xattr_inode_iget (3) Date: Wed, 3 Apr 2024 21:44:54 +0800 Message-Id: <20240403134454.3792-1-hdanton@sina.com> In-Reply-To: <000000000000163e1406152c6877@google.com> References: Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit On Wed, 03 Apr 2024 00:45:29 -0700 > syzbot found the following issue on: > > HEAD commit: fe46a7dd189e Merge tag 'sound-6.9-rc1' of git://git.kernel.. > git tree: upstream > C reproducer: https://syzkaller.appspot.com/x/repro.c?x=140d9db1180000 #syz test https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git fe46a7dd189e --- x/fs/ext4/inode.c +++ y/fs/ext4/inode.c @@ -5414,6 +5414,7 @@ int ext4_setattr(struct mnt_idmap *idmap (attr->ia_size > 0 ? attr->ia_size - 1 : 0) >> inode->i_sb->s_blocksize_bits); + down_read(&EXT4_I(inode)->xattr_sem); down_write(&EXT4_I(inode)->i_data_sem); old_disksize = EXT4_I(inode)->i_disksize; EXT4_I(inode)->i_disksize = attr->ia_size; @@ -5430,6 +5431,7 @@ int ext4_setattr(struct mnt_idmap *idmap else EXT4_I(inode)->i_disksize = old_disksize; up_write(&EXT4_I(inode)->i_data_sem); + up_read(&EXT4_I(inode)->xattr_sem); ext4_journal_stop(handle); if (error) goto out_mmap_sem; --