From patchwork Sun Dec 1 13:12:25 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christian Brauner X-Patchwork-Id: 13889477 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (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 43E7E1CB506; Sun, 1 Dec 2024 13:13:02 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1733058782; cv=none; b=JFbbiaRDW1Szp5TrjRr9jzEjyOtjScBJD96WgAUdQyDuAauHDJB2qJLpdVmkpHT6IYt/n2LqpNpqYPhYX0TNSfsLPVD7EFjaIVDHhulZZv1cRH5wbvdxsjrrSAA3+Gwv4a3PYzGgQwDUG0c6tSuP0h62yskjbPBPO1mrbZaEh5w= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1733058782; c=relaxed/simple; bh=uMTdN9Tq9QOP5CBej/C0az0/Wbj6Oorc2xZALcGYetI=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=f0EQmrdOdyX0vMGTcafuOjL8eEA64cVJ3f3zXG1v7J4qEzPlqJi0rDTuRbQMAUwayEjvP4FyImzlAmN/IwdbPzVeypbjAhnrttEbXPw0EHMjHId8Uo94fskg10NTlkhUa4sD3NcH/00/TLdJAgss+ev4d0eWPZhHkXRMh2YlOWM= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=Ysaac3sD; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="Ysaac3sD" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 11037C4CECF; Sun, 1 Dec 2024 13:12:59 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1733058782; bh=uMTdN9Tq9QOP5CBej/C0az0/Wbj6Oorc2xZALcGYetI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Ysaac3sDDSvYaJtfhoyfN6B9LrvvZUcAZkQsvLi4KTEDgJQmysNRdFrNwXsVCVosL Des04o1KFEJQcJBJX2EIFYghSG3ossIsd2Bn/jNeuY5rs8KIA9PToiVi74l/zSJhB0 Dli5aESXq2vwHv2zMliS9jPxtPE+wmvCdm4KQ82XbATouczasHnrogKHwEzJBzd9EH 8KN+a1bMseslFIF/jj4QlHNL/KRVkmnxEbta+nkL+j/thZ2Hj6ld200/y29WNglGaw A0ux9xNILRPZ4Udj+QETLSCM0PS73PGkZJTR9Gk+rSvHsYl6eSQy/kkmI3RoAjJ/sj Otf6CGqT9HvGQ== From: Christian Brauner To: Amir Goldstein , Jeff Layton Cc: Christian Brauner , Erin Shepherd , Chuck Lever , linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, linux-nfs@vger.kernel.org, stable Subject: [PATCH 1/4] exportfs: add flag to indicate local file handles Date: Sun, 1 Dec 2024 14:12:25 +0100 Message-ID: <20241201-work-exportfs-v1-1-b850dda4502a@kernel.org> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20241201-work-exportfs-v1-0-b850dda4502a@kernel.org> References: <20241201-work-exportfs-v1-0-b850dda4502a@kernel.org> Precedence: bulk X-Mailing-List: linux-fsdevel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Mailer: b4 0.15-dev-355e8 X-Developer-Signature: v=1; a=openpgp-sha256; l=2267; i=brauner@kernel.org; h=from:subject:message-id; bh=uMTdN9Tq9QOP5CBej/C0az0/Wbj6Oorc2xZALcGYetI=; b=owGbwMvMwCU28Zj0gdSKO4sYT6slMaT7JOyrnOTXtIefcc/ZZcfYGRye33l6pyjr0vY2+3iHq QkGFxTvd5SyMIhxMciKKbI4tJuEyy3nqdhslKkBM4eVCWQIAxenAEzEYCPDH+5pCZtswpPdmtm4 z+a9l/5fEbtYOfjRRsc3z9XFVjAVnmT4p7M2Z8Pyv1y5Ky9MOWdibDhZ/XCUcZDQ8gliz03E5Ar EGAE= X-Developer-Key: i=brauner@kernel.org; a=openpgp; fpr=4880B8C9BD0E5106FC070F4F7B3C391EFEA93624 Some filesystems like kernfs and pidfs support file handles as a convenience to use name_to_handle_at(2) and open_by_handle_at(2) but don't want to and cannot be reliably exported. Add a flag that allows them to mark their export operations accordingly. Fixes: aa8188253474 ("kernfs: add exportfs operations") Cc: stable # >= 4.14 Signed-off-by: Christian Brauner --- fs/nfsd/export.c | 8 +++++++- include/linux/exportfs.h | 1 + 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/fs/nfsd/export.c b/fs/nfsd/export.c index eacafe46e3b673cb306bd3c7caabd3283a1e54b1..786551595cc1c2043e8c195c00ca72ef93c769d6 100644 --- a/fs/nfsd/export.c +++ b/fs/nfsd/export.c @@ -417,6 +417,7 @@ static struct svc_export *svc_export_lookup(struct svc_export *); static int check_export(struct path *path, int *flags, unsigned char *uuid) { struct inode *inode = d_inode(path->dentry); + const struct export_operations *nop; /* * We currently export only dirs, regular files, and (for v4 @@ -449,11 +450,16 @@ static int check_export(struct path *path, int *flags, unsigned char *uuid) return -EINVAL; } - if (!exportfs_can_decode_fh(inode->i_sb->s_export_op)) { + if (!exportfs_can_decode_fh(nop)) { dprintk("exp_export: export of invalid fs type.\n"); return -EINVAL; } + if (nop && nop->flags & EXPORT_OP_LOCAL_FILE_HANDLE) { + dprintk("exp_export: filesystem only supports non-exportable file handles.\n"); + return -EINVAL; + } + if (is_idmapped_mnt(path->mnt)) { dprintk("exp_export: export of idmapped mounts not yet supported.\n"); return -EINVAL; diff --git a/include/linux/exportfs.h b/include/linux/exportfs.h index a087606ace194ccc9d1250f990ce55627aaf8dc5..40f78c8e4f31b97b2101b66634e8d1807c1bcc14 100644 --- a/include/linux/exportfs.h +++ b/include/linux/exportfs.h @@ -280,6 +280,7 @@ struct export_operations { */ #define EXPORT_OP_FLUSH_ON_CLOSE (0x20) /* fs flushes file data on close */ #define EXPORT_OP_ASYNC_LOCK (0x40) /* fs can do async lock request */ +#define EXPORT_OP_LOCAL_FILE_HANDLE (0x80) /* fs only supports file handles, no proper export */ unsigned long flags; }; From patchwork Sun Dec 1 13:12:26 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christian Brauner X-Patchwork-Id: 13889478 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (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 C1E671CB536; Sun, 1 Dec 2024 13:13:04 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1733058784; cv=none; b=I7TnCJk9aaszGj5Pt8vBOtcXvuGNGdLtS2ObymYIarYvyVTX5CAasMP03nDlvssIgNajGZfqBghF3ni5BAO/ge1j0fo0HAfWo/l/cSBi8/ZOF4Sq4jx7w5yasfAmUGH+DDRSeOjoW7oJvX9Kehy0YDJwNCs+hdsR3RO6rhU3mHQ= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1733058784; c=relaxed/simple; bh=TJBi4pm189sh4ufpQJIXs7nXM7IBeLfA/J2zP6inFng=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=H1zz/YQHu/4iYY7F1MOmDuFZ3vEaTYtNFuKBJm/sJPVdiVrfRcVmIhqq/DBP75DwDHPeStCUeUfJFT7hCDRjwegKM1skelgGJhj6RhBEas1wikl/i/P4I266uKtEMQ6+jIi7F9vh2fITH+3eVWARB2Q7ov7TI20MSpognOZKcCM= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=Q/J/IQ2a; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="Q/J/IQ2a" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 970B1C4CECF; Sun, 1 Dec 2024 13:13:02 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1733058784; bh=TJBi4pm189sh4ufpQJIXs7nXM7IBeLfA/J2zP6inFng=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Q/J/IQ2aZ09LqY4wvm6kblmxEPW7UC830L4v7N/IEFJEPkE/wDdEd/34MOZw0Ytlo 1AkgKVPYnnTJeO7aDJ6LAzC/9SHbokYXoq1B4zUd/cvi561i8lST/E1hr3TI29NLa1 S/X4lKmTVubfGGWmeMxVrhPbIFowetyZH3Vodew2C1PV+0L6m/AqJSUGmk/TzoV+AH x9/lYLlEf3cswJSxeAQlAGAPFk9DJbB+pUimAgPUyCx2wqSjNy4WusLckkiJz0BiAf thpVPiyLlPBcQ+YQfy6RkTwRL8OK33R7cTvtFyh4hUxSig5JTGvYNGTENlYNen/xU+ Z1ecPmgdzZmaw== From: Christian Brauner To: Amir Goldstein , Jeff Layton Cc: Christian Brauner , Erin Shepherd , Chuck Lever , linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, linux-nfs@vger.kernel.org, stable Subject: [PATCH 2/4] kernfs: restrict to local file handles Date: Sun, 1 Dec 2024 14:12:26 +0100 Message-ID: <20241201-work-exportfs-v1-2-b850dda4502a@kernel.org> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20241201-work-exportfs-v1-0-b850dda4502a@kernel.org> References: <20241201-work-exportfs-v1-0-b850dda4502a@kernel.org> Precedence: bulk X-Mailing-List: linux-fsdevel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Mailer: b4 0.15-dev-355e8 X-Developer-Signature: v=1; a=openpgp-sha256; l=809; i=brauner@kernel.org; h=from:subject:message-id; bh=TJBi4pm189sh4ufpQJIXs7nXM7IBeLfA/J2zP6inFng=; b=owGbwMvMwCU28Zj0gdSKO4sYT6slMaT7JOz7XRBnuOPYe9vOovSCjI1nS/y2T3zsOTtdx7GJ+ WNFZJ1HRykLgxgXg6yYIotDu0m43HKeis1GmRowc1iZQIYwcHEKwEQibzAyHIiMPjx3wewlTqkm s591dutGv2SvO9f96IbVe+40rurNTxkZtpvnv10+jWfeN83f51eEpnmw8XE12M7jzxH7/F5x0iZ RVgA= X-Developer-Key: i=brauner@kernel.org; a=openpgp; fpr=4880B8C9BD0E5106FC070F4F7B3C391EFEA93624 The kernfs filesystem uses local file handles that cannot be exported. Mark its export operations accordingly. Fixes: aa8188253474 ("kernfs: add exportfs operations") Cc: stable # >= 4.14 Signed-off-by: Christian Brauner --- fs/kernfs/mount.c | 1 + 1 file changed, 1 insertion(+) diff --git a/fs/kernfs/mount.c b/fs/kernfs/mount.c index 1358c21837f1a0fe1b109e39134e993d0ef83879..c6266ecc78a3ca767e3dcab24fde7c2b79f5370d 100644 --- a/fs/kernfs/mount.c +++ b/fs/kernfs/mount.c @@ -154,6 +154,7 @@ static const struct export_operations kernfs_export_ops = { .fh_to_dentry = kernfs_fh_to_dentry, .fh_to_parent = kernfs_fh_to_parent, .get_parent = kernfs_get_parent_dentry, + .flags = EXPORT_OP_LOCAL_FILE_HANDLE, }; /** From patchwork Sun Dec 1 13:12:27 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christian Brauner X-Patchwork-Id: 13889479 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (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 6AA3F1CB51C; Sun, 1 Dec 2024 13:13:07 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1733058788; cv=none; b=FBDMX3sI4vp4MOKNEZq8W3jxm5cO9WjdYefcVuep6jFyhBouMiIXlakazY7ILGHMpYjq173Ody2veaUDbaobCisQxA9hGMqph8Zk0vezcoKTlQyC/hu4CPPUv5QI3lHFu/rP62CGOS3tezmueZYG/esLx85Cv6qoQq0zcgeWobk= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1733058788; c=relaxed/simple; bh=5orgtBoTxXpJkz8BkoZsQy5RLFKoiEsCdBaXTMOGW3w=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=e8l+UgvPLMFaR4Pze1Gl1lrEu7RhnsMJZNXWD3UlHPRi1d2HTHmVWgO1bxgySYtfgW81t5uTr9Fjzxp4s4TNSaqK+KCHgGvw3DDGL5rLm3opGITiatClMrX2rtA7MOW4W2Q8F1Bp5aHyFm1NZBQg7LVQHXgDCIFZqAN9JR1aPZ0= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=JgNnuDNh; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="JgNnuDNh" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 2031AC4CEE2; Sun, 1 Dec 2024 13:13:04 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1733058787; bh=5orgtBoTxXpJkz8BkoZsQy5RLFKoiEsCdBaXTMOGW3w=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=JgNnuDNhGp4eusO4adtDhr/sJHwKp797fU/JnsFMqLDfOXEdGkT99T8ZSeXRqw0vP ad6gInwqc9mr8yWHLWLm6iKTs9ed0KVM43rukrio8MYNAqmbpt5XkgVp5e+wVp4bZ9 mfj2ChoLWNtqWhFlxqzpCnx6xk/ArB3a4RUFFgevmS+fzwAXN24E+mMc63XFLg6dcE bhDrSfC7swo0Fu0+joBNDomBj//1flncMigX7lHPB4KzbOOsb+wbjcSP+xGdcrd8f+ sIWhF8engmZNHdkJEUGdHDlLsYpwAMPUzVTlmMGcKmR8Yu2YA25wrdTmOHp5Am1Ryw o2mpKYMOkevYw== From: Christian Brauner To: Amir Goldstein , Jeff Layton Cc: Christian Brauner , Erin Shepherd , Chuck Lever , linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, linux-nfs@vger.kernel.org Subject: [PATCH 3/4] ovl: restrict to exportable file handles Date: Sun, 1 Dec 2024 14:12:27 +0100 Message-ID: <20241201-work-exportfs-v1-3-b850dda4502a@kernel.org> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20241201-work-exportfs-v1-0-b850dda4502a@kernel.org> References: <20241201-work-exportfs-v1-0-b850dda4502a@kernel.org> Precedence: bulk X-Mailing-List: linux-fsdevel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Mailer: b4 0.15-dev-355e8 X-Developer-Signature: v=1; a=openpgp-sha256; l=922; i=brauner@kernel.org; h=from:subject:message-id; bh=5orgtBoTxXpJkz8BkoZsQy5RLFKoiEsCdBaXTMOGW3w=; b=owGbwMvMwCU28Zj0gdSKO4sYT6slMaT7JOx/1KMZsrbr08q/m2Y8s3jx0DpTMTyV5Wdj16Kfp iu3PBLQ7ShlYRDjYpAVU2RxaDcJl1vOU7HZKFMDZg4rE8gQBi5OAZiIVRQjwzeOuLUzKmyWVpxc +fQWX9V/S8sL0br9Nq8/WembTRCYJsPwP1xZTv/szz7Zja+rn1Z16h9dWaNiWL70Y/C/f3HGOab 27AA= X-Developer-Key: i=brauner@kernel.org; a=openpgp; fpr=4880B8C9BD0E5106FC070F4F7B3C391EFEA93624 Ensure that overlayfs only allows decoding exportable file handles. Signed-off-by: Christian Brauner --- fs/overlayfs/util.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/fs/overlayfs/util.c b/fs/overlayfs/util.c index 9aa7493b1e10365cbcc97fceab26d614a319727f..b498c74084f3950d8e4d9f63a804d1abe08258fc 100644 --- a/fs/overlayfs/util.c +++ b/fs/overlayfs/util.c @@ -83,10 +83,15 @@ void ovl_revert_creds(const struct cred *old_cred) */ int ovl_can_decode_fh(struct super_block *sb) { + const struct export_operations *nop = sb->s_export_op; + if (!capable(CAP_DAC_READ_SEARCH)) return 0; - if (!exportfs_can_decode_fh(sb->s_export_op)) + if (!exportfs_can_decode_fh(nop)) + return 0; + + if (nop && nop->flags & EXPORT_OP_LOCAL_FILE_HANDLE) return 0; return sb->s_export_op->encode_fh ? -1 : FILEID_INO32_GEN; From patchwork Sun Dec 1 13:12:28 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christian Brauner X-Patchwork-Id: 13889480 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (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 92A051CBE8B; Sun, 1 Dec 2024 13:13:09 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1733058789; cv=none; b=eoMTUSH9YRjbuv8QJOQssPzsd83YuEkBahD8afBD31W2eUwoLTQ2xv6pxhjjx7aIrvT52i2V/ojIy1KqQwjMz4mKD31/t/QDEp3Yx/scANeoKPcgtIaLgB6LpRbwwWGq4eemnnG2WZDi908+GP3otfwpCAwVJw2e0Vt2bS31Pz4= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1733058789; c=relaxed/simple; bh=N6ELxN7yqBpBUb4zPoFR5SDo9lVcqXtWjzQrppLLRkE=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=XxC3dafp6dhFPOY7w6lV70XVst9cxKYXC8DPzszPFw3o+iSVOQrijqIrihtnK85hl2Ze0i91qOcBoNjPGhg7w4umrFSjnPiJn2IwR3q9ypzg0GIoaVxqzkuz5zdB/WjIxYj876ccFcT1PnelIvyd1r+3/E7Dt75ed3KqiU2epIA= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=VkGNjEKY; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="VkGNjEKY" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 6D185C4CEDC; Sun, 1 Dec 2024 13:13:07 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1733058789; bh=N6ELxN7yqBpBUb4zPoFR5SDo9lVcqXtWjzQrppLLRkE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=VkGNjEKYseyrjvPxIZLc+ApoginC05F37JMUEQvSbYdnSEC+kf6NJ/TFkkq/EdrU7 JDdgetmCh4E7abwwMvXG0dpoW/KRKlxqshXn4XATq9dx9oOmqosJNaQb4XfBUcfJbC uTIYfLF6pIpwqeyMjh3cKxJZtrVCbyQ7YjUBJmKsBwxRUb0r4ZGVDGEVkWzQCTkzdV erY5zlFWatqTRi+gpkEdX3cNntU8Ewg3cpA6/BJIbzP38d970V3IRnpYnKq4fM0XE7 //az4xi46J6TajE7rd9/dQFBPj2PBQ7ZsQvEzHKbTekdQdydBqqY4PSEOHQyf0J+ad 8rJbcmNBFZKzQ== From: Christian Brauner To: Amir Goldstein , Jeff Layton Cc: Christian Brauner , Erin Shepherd , Chuck Lever , linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, linux-nfs@vger.kernel.org Subject: [PATCH 4/4] pidfs: restrict to local file handles Date: Sun, 1 Dec 2024 14:12:28 +0100 Message-ID: <20241201-work-exportfs-v1-4-b850dda4502a@kernel.org> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20241201-work-exportfs-v1-0-b850dda4502a@kernel.org> References: <20241201-work-exportfs-v1-0-b850dda4502a@kernel.org> Precedence: bulk X-Mailing-List: linux-fsdevel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Mailer: b4 0.15-dev-355e8 X-Developer-Signature: v=1; a=openpgp-sha256; l=734; i=brauner@kernel.org; h=from:subject:message-id; bh=N6ELxN7yqBpBUb4zPoFR5SDo9lVcqXtWjzQrppLLRkE=; b=owGbwMvMwCU28Zj0gdSKO4sYT6slMaT7JOxPZp08pYkhxnxf7Y76uy/YXy16GPtwNY+Uf+26d FGtqHerO0pZGMS4GGTFFFkc2k3C5ZbzVGw2ytSAmcPKBDKEgYtTACbiPYHhn3bj0YuxNXNt7Wf2 HtqqKDwh7nJw2ZT+/KvfH/+cP0l9eR4jw7WvFZkx34OmTyp8rzyvPPZf5UNOf5NMrjW7tkVdfMS nywMA X-Developer-Key: i=brauner@kernel.org; a=openpgp; fpr=4880B8C9BD0E5106FC070F4F7B3C391EFEA93624 The pidfs filesystem uses local file handles that cannot be exported. Mark its export operations accordingly. Signed-off-by: Christian Brauner --- fs/pidfs.c | 1 + 1 file changed, 1 insertion(+) diff --git a/fs/pidfs.c b/fs/pidfs.c index dde3e4e90ea968c12dba0a0d37c95e2218253369..29c894f2792b4a5360a0e1933f850bfaf08413eb 100644 --- a/fs/pidfs.c +++ b/fs/pidfs.c @@ -570,6 +570,7 @@ static const struct export_operations pidfs_export_operations = { .fh_to_dentry = pidfs_fh_to_dentry, .open = pidfs_export_open, .permission = pidfs_export_permission, + .flags = EXPORT_OP_LOCAL_FILE_HANDLE, }; static int pidfs_init_inode(struct inode *inode, void *data)