Received: by 2002:ab2:3350:0:b0:1f4:6588:b3a7 with SMTP id o16csp306161lqe; Sat, 6 Apr 2024 01:57:20 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCXtlPDqFP1KFOjPbNNWas1CXFApkahlaSoqc/micgrcE93f+zNXs9Z35h1zG2E3nvNdr0aFGz3stbF2r2YYZk8O5bf5bY7YCKFyc0XF3A== X-Google-Smtp-Source: AGHT+IGdaJQbS5v76MHAvOsiXzSGYS4eojofD3O/sypgGGK9eCBIdmsbV6AV4sig6hdVynlaaX4g X-Received: by 2002:a2e:9bc7:0:b0:2d8:36f9:67af with SMTP id w7-20020a2e9bc7000000b002d836f967afmr3204557ljj.44.1712393839937; Sat, 06 Apr 2024 01:57:19 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1712393839; cv=pass; d=google.com; s=arc-20160816; b=aExvpWfusMTTl8QJ4vyFHp6tVz3s4j9xXZhS7C8ERx1QaojwNOma9Z1FzWG/kIZEw9 3CjTDkjveXlxoeg2gvGrqLjrBe7o0fu+1zusUzIDEBkgASt39N/GmsGNp4RWt+0yZKvH rmWl6fEobgBQYuGRFO2kSkew8shLtD9Ex5ka7WlUvdHtx0ZAsPItsNnVXvPSotGrOpXR Nhzdp4Pz8eHrIfy3EDVB40WTcEVhY0wMI/YKwtMc3/5Vq2pfApbd+5IPQ4EeNploex6H t69B1tXObJDEoXOh1SXpLzFZBtgO7TvGOsVpsmywgL4oq/t0eLRkOtdhmc6sUsQYEt+D LeTA== 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=aNcQLYFcRVUrVIl9SKAc3txdt41VLu+DbhyIjFOO5ys=; fh=yiZaDL1IeCHrUUayVEIqweIygAmg6JG/r7EFhHKURr4=; b=AvZkEucloo0hvRL333scdPn49oF3x+6TQVQuPu4xpIuAP1RQ6G0b29Se5PyPguaas8 zCZIlI+ptv4OHN9cjMQbnYCBhIS+59KlT4niasGImtdsu3HwlHA3i5iiia9UhgrjOMcl riJqJPMeAKeeCWgeN7aOk+6/+cjTJJ3iGeDBG9BAiNrlDaXBsZvFREBAyTAlrmcDSEOZ a/3u6I6Gjf7zfl3UHwSP+n+ALwmAORs+wHaA4IF6kwf04ct1qvRDIqXKt/00G7jGhA6o sS1VBouNR3myvuWmoQ3KUYsv/YXT0DclkB2CfLh2yJrbbWf0dYOTCpbPtwJr+ZCsr0vf YFtQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@linux.org.uk header.s=zeniv-20220401 header.b=hFenarQp; 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-133797-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-133797-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. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id gz12-20020a170906f2cc00b00a4e5699142esi1444953ejb.262.2024.04.06.01.57.19 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 06 Apr 2024 01:57:19 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-133797-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) client-ip=2604:1380:4601:e00::3; Authentication-Results: mx.google.com; dkim=pass header.i=@linux.org.uk header.s=zeniv-20220401 header.b=hFenarQp; 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-133797-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-133797-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 1B1E01F227D5 for ; Sat, 6 Apr 2024 04:10:04 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 83ADF1BC46; Sat, 6 Apr 2024 04:09:31 +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="hFenarQp" 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 A075E18C31; Sat, 6 Apr 2024 04:09:28 +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=1712376570; cv=none; b=W6aBfwxjDVlGTt4Vt9ZjjiwPWT//xzGDAuAV4ZuwVXZvYcElupFRhM5qS/MOYYEIfutqf7f3DmH1CO128wtC16wMn/Ih1x7EoBIa2j0R1FReoq4uF4Q3rN8+OpJ8D7tdObxlTjJscAXdfp8HW7T/fimux13XginHzlSWGP28ILg= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712376570; c=relaxed/simple; bh=84CEL3L0YsI3XMS0Ylb0DTXEwQky54Jb7NDYFZGjLyc=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=DDsZ2W/Qw/50lb4w99e9N9+r6dDy1DLKbnbIUvOgeZdq3aFr5QWx2CULpbhMl92QDN+lUeHYUqGAAd4EgfXW7/dQx7u/EoCh0L53mnTci2pXGlqCoYFBq/lYy9DTtqLMLGLP48754Ftaj6b0lDSQCCdVSKW1Z6FG716Jmnjurk8= 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=hFenarQp; 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=aNcQLYFcRVUrVIl9SKAc3txdt41VLu+DbhyIjFOO5ys=; b=hFenarQpeRw+HK/7HvJ8l/AvHz Lsk7bR95k3PifSQC0xuVGznOgvlMZV+datwfcaaU2K8XFbpMOdNZrMtVc1orR/dSLvOMgF+TS25ke uUevxHfH1hr754XMIIlc6sY8u6jWKae+Hzd4zZ+KGjawhoQ7v0RNC7GvrHjmwmUOW+6kT98th9S5q o/NOzRtZ712DP2fxygcYxXTaz+ss326ceRtNDvh7x/Ceju5lg4xSx/3uxsylC6pFN0ymr2vAeBx1K CVFO3tddwqZcp3WdcDpqG9yK11Of234BEwSQ+Inx4P1ggpR9I4+cjdIat7jsB4cEh+uVHTXCr6UKP kf9RK08A==; Received: from viro by zeniv.linux.org.uk with local (Exim 4.96 #2 (Red Hat Linux)) id 1rsxMp-006pPR-2v; Sat, 06 Apr 2024 04:09:24 +0000 Date: Sat, 6 Apr 2024 05:09:23 +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: <20240406040923.GX538574@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: Sender: Al Viro On Thu, Apr 04, 2024 at 12:33:40PM +0300, Amir Goldstein wrote: > We do not (anymore) lock ovl inode in ovl_llseek(), see: > b1f9d3858f72 ovl: use ovl_inode_lock in ovl_llseek() > but ovl inode is held in operations (e.g. ovl_rename) > which trigger copy up and call vfs_llseek() on the lower file. OK, but why do we bother with ovl_inode_lock() there? Note that serialization on struct file level is provided on syscall level - see call of fdget_pos() in there. IOW, which object are you protecting? If it's struct file passed your way, you should already have the serialization. If it's underlying file on disk, that's up to vfs_llseek(). Exclusion with copyup by a different operation? I'm not saying it's wrong - it's just that the thing is tricky enough, so some clarification might be a good idea.