Received: by 2002:ab2:2441:0:b0:1f3:1f8c:d0c6 with SMTP id k1csp160477lqe; Thu, 4 Apr 2024 02:57:22 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCU018+uQindC8PoIibaV0ETJUfqbgqIVN3lGtphsYla0QF/ibSpGLiMFVS4pOtCINlCVadt+IUuH3SnKCVxgN2mK6ej74VxPuse9Np3Cw== X-Google-Smtp-Source: AGHT+IFLc+3ZZ4vjth4Sm9MADzaulGWOvLF6XhdxsFrssCm6E03LEqyjpRowQT01ApnYbZzJPtsx X-Received: by 2002:a17:907:c0d:b0:a4e:68bc:a46e with SMTP id ga13-20020a1709070c0d00b00a4e68bca46emr1453224ejc.43.1712224642367; Thu, 04 Apr 2024 02:57:22 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1712224642; cv=pass; d=google.com; s=arc-20160816; b=I11oy1tsXJ02/fsMRh3gHgbPaM++tHAJTLQrY7G/BREZfi04YFTxqyDxHuR5O/E/N3 Qt/Yu7Wlx6vJldw+d/fR9NGgrpc+ijWDM1HKHIQXDD0O/j4KUO0S7N+cd+JP+Z9QBltD lXyDG/77+nXCeaO81JqyQ8TeoErvSLWVieDHzMJtN9BrT7GENdVekVW6fyoefVA7ivru UsK4G7L/xZg7s0syRWl3DZPb7H+NzzuarsxSsjw2FFXnK2TQu6DVvKyycwktvk1NlWhv j7Qn38TlsU95VfEV8YfbvyrlJjEkJG6vulS3ODlqFi3dC1U0M0PbKOTPY0JtvEgSATur m1cw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:in-reply-to:content-disposition:mime-version :list-unsubscribe:list-subscribe:list-id:precedence:references :message-id:subject:cc:to:from:date:dkim-signature; bh=Mh1tS4YBpeQpEOMQvTRN1ABwZ4FVhqqFeSUifn51SkU=; fh=yiZaDL1IeCHrUUayVEIqweIygAmg6JG/r7EFhHKURr4=; b=QPbu9DjGmoUcrnXuUQh7T0Irjgmf13kKBz27hSDLNJ0yaDQ/Dsooqk/oQSjOtDHn3p j9vmZWM1ebCGinf6VToZvpKLbsJukTKtzNdz6Ca/0/7VzL+v+v1dpRbFLDJcO6DSo8Av /zNTLDySOvkcxFd+NLRBBFcHDfqEU2D+oFYlK69qrxCIsp4+s86TY/R5tvUwlu1YHz24 N8cFcp9mKEfJKjMGZyk7WfSSq8SIKAK/RLhuLnLawZVLuMOJo6tq6zp3BeazgX6EBIpb nalGPrUxrQgE8phxTtWRRaRJ5y9ySIMGM/3khtT0QQNKPdg9HhgrKPC+0RzUajAsAsfC nlLg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@linux.org.uk header.s=zeniv-20220401 header.b=lLV7uu3w; arc=pass (i=1 dkim=pass dkdomain=linux.org.uk dmarc=pass fromdomain=zeniv.linux.org.uk); spf=pass (google.com: domain of linux-kernel+bounces-131119-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-131119-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=zeniv.linux.org.uk Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id hp18-20020a1709073e1200b00a4e597491c7si5079590ejc.862.2024.04.04.02.57.22 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 04 Apr 2024 02:57:22 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-131119-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; dkim=pass header.i=@linux.org.uk header.s=zeniv-20220401 header.b=lLV7uu3w; arc=pass (i=1 dkim=pass dkdomain=linux.org.uk dmarc=pass fromdomain=zeniv.linux.org.uk); spf=pass (google.com: domain of linux-kernel+bounces-131119-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-131119-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=zeniv.linux.org.uk 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 898A01F2B235 for ; Thu, 4 Apr 2024 08:40:27 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 5412E71B40; Thu, 4 Apr 2024 08:40:17 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linux.org.uk header.i=@linux.org.uk header.b="lLV7uu3w" Received: from zeniv.linux.org.uk (zeniv.linux.org.uk [62.89.141.173]) (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 AD2851E86F; Thu, 4 Apr 2024 08:40:13 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=62.89.141.173 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712220016; cv=none; b=qaer2eMkm4JPe2fEW7s669rbyxcsDQq0x8yYiPkpHhv7PYWgWdlBtHR6KC7BjzT4dDyeV1rwaeHsT6tox9s6fC2RgMcM2/t7cAecPdav5avghgSQr0E7XrcjKf+j0oTRTtNsV4FuBwUzN+OEUWwhbTFz21vCFKjirV/R7PRulME= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712220016; c=relaxed/simple; bh=nu2xamLL/1Lp3Kabf5EBo8dr2TBNEAPViVPLxkTCtZs=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=OYvk9YydvNvMtslxBDM1vJwyh+41ddloLRf3D872y2mVcxJKW9x+oHy7A5uN1kTKk96LJ8W7q1vcShlz2k6kMZB62pAuHSFMa69Hw81yUDP5r04GcnlVAY2Jexep4vRtu6AxlNOc0lPdnY7V2ybrcjgESEAOAJ0PEihyZmkTzJ4= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=zeniv.linux.org.uk; spf=none smtp.mailfrom=ftp.linux.org.uk; dkim=pass (2048-bit key) header.d=linux.org.uk header.i=@linux.org.uk header.b=lLV7uu3w; arc=none smtp.client-ip=62.89.141.173 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=zeniv.linux.org.uk Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=ftp.linux.org.uk DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=linux.org.uk; s=zeniv-20220401; h=Sender:In-Reply-To:Content-Type: MIME-Version:References:Message-ID:Subject:Cc:To:From:Date:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=Mh1tS4YBpeQpEOMQvTRN1ABwZ4FVhqqFeSUifn51SkU=; b=lLV7uu3wHBn23R2nt5JOwZXJ9L e3uVtdKkJep/jj7ZFI9NIBFgvD1+Wd5Fyvm0jB7KzgnEm7eNcANhL7jMuCa1cAjyw7jdXT0PDsOVw tEcBVvRtfslABSr4M0fWPnuu8merb3rglMtKBtx/FaJp9ZWOSr21vpsX3I5fy73tOrQDsRGbwQO1g lDpFkqkvqWLI0JeKjg87TAjQV0HvPD9LaBitqqNNJcmcYABVfOrvF5ViQSeiSKNqqcu9bZ0ViNP8z Ja+HfCsvXkSboF1lu3cMx/hAIBzOyFu0FWtKjo30KubY9v89V/Zw/Bm3Yt1we5SbpzqaynDXr8Z4i Ig+USciQ==; Received: from viro by zeniv.linux.org.uk with local (Exim 4.96 #2 (Red Hat Linux)) id 1rsIdl-005SY0-0V; Thu, 04 Apr 2024 08:40:09 +0000 Date: Thu, 4 Apr 2024 09:40:09 +0100 From: Al Viro To: Amir Goldstein Cc: syzbot , gregkh@linuxfoundation.org, linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, syzkaller-bugs@googlegroups.com, tj@kernel.org, valesini@yandex-team.ru, Christoph Hellwig , Christian Brauner , Jan Kara , Miklos Szeredi Subject: Re: [syzbot] [kernfs?] possible deadlock in kernfs_fop_llseek Message-ID: <20240404084009.GS538574@ZenIV> References: <00000000000098f75506153551a1@google.com> <0000000000002f2066061539e54b@google.com> <20240404081122.GQ538574@ZenIV> <20240404082110.GR538574@ZenIV> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20240404082110.GR538574@ZenIV> Sender: Al Viro On Thu, Apr 04, 2024 at 09:21:10AM +0100, Al Viro wrote: > Similar question applies to ovl_write_iter() - why do you > need to hold the overlayfs inode locked during the call of > backing_file_write_iter()? Consider the scenario when unlink() is called on that sucker during the write() that triggers that pathwalk. We have unlink: blocked on overlayfs inode of file, while holding the parent directory. write: holding the overlayfs inode of file and trying to resolve a pathname that contains .../power/suspend_stats/../../...; blocked on attempt to lock parent so we could do a lookup in it. No llseek involved anywhere, kernfs of->mutex held, but not contended, deadlock purely on ->i_rwsem of overlayfs inodes. Holding overlayfs inode locked during the call of lookup_bdev() is really no-go.