From: Jeff Layton <jlayton@kernel.org>
To: Chen Hanxiao <chenhx.fnst@fujitsu.com>,
Chuck Lever <chuck.lever@oracle.com>, Neil Brown <neilb@suse.de>,
Olga Kornievskaia <kolga@netapp.com>,
Dai Ngo <Dai.Ngo@oracle.com>, Tom Talpey <tom@talpey.com>
Cc: linux-nfs@vger.kernel.org
Subject: Re: [PATCH] NFSD: nfsctl: remove read permission of filehandle
Date: Tue, 19 Mar 2024 09:09:12 -0400 [thread overview]
Message-ID: <3dc4e3e0a730795bb803ce4cde66b45ed428765a.camel@kernel.org> (raw)
In-Reply-To: <20240319104714.1178-1-chenhx.fnst@fujitsu.com>
On Tue, 2024-03-19 at 18:47 +0800, Chen Hanxiao wrote:
> As write_filehandle can't accept zero-bytes writting,
> remove read permission of /proc/fs/nfsd/filehandle
>
> Signed-off-by: Chen Hanxiao <chenhx.fnst@fujitsu.com>
> ---
> fs/nfsd/nfsctl.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/fs/nfsd/nfsctl.c b/fs/nfsd/nfsctl.c
> index ecd18bffeebc..da1387f1e30a 100644
> --- a/fs/nfsd/nfsctl.c
> +++ b/fs/nfsd/nfsctl.c
> @@ -1346,7 +1346,7 @@ static int nfsd_fill_super(struct super_block *sb, struct fs_context *fc)
> &transaction_ops, S_IWUSR|S_IRUSR},
> [NFSD_FO_UnlockFS] = {"unlock_filesystem",
> &transaction_ops, S_IWUSR|S_IRUSR},
> - [NFSD_Fh] = {"filehandle", &transaction_ops, S_IWUSR|S_IRUSR},
> + [NFSD_Fh] = {"filehandle", &transaction_ops, S_IWUSR},
> [NFSD_Threads] = {"threads", &transaction_ops, S_IWUSR|S_IRUSR},
> [NFSD_Pool_Threads] = {"pool_threads", &transaction_ops, S_IWUSR|S_IRUSR},
> [NFSD_Pool_Stats] = {"pool_stats", &pool_stats_operations, S_IRUGO},
I don't think we can do this. mountd does this to get the rootfh for an
exported fs and it'll probably start failing if it can't open that file
for read:
f = open("/proc/fs/nfsd/filehandle", O_RDWR);
That write_filehandle interface sure is weird though. Could we get rid
of it by teaching cache_get_filehandle how to use name_to_handle_at
instead? That would be a lot cleaner and would get rid of yet another
dependency on /proc/fs/nfsd.
--
Jeff Layton <jlayton@kernel.org>
next prev parent reply other threads:[~2024-03-19 13:09 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-03-19 10:47 [PATCH] NFSD: nfsctl: remove read permission of filehandle Chen Hanxiao
2024-03-19 13:09 ` Jeff Layton [this message]
2024-03-20 15:49 ` Hanxiao Chen (Fujitsu)
2024-03-20 16:27 ` Jeff Layton
2024-03-27 6:40 ` Chen Hanxiao
2024-03-27 10:50 ` Jeff Layton
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=3dc4e3e0a730795bb803ce4cde66b45ed428765a.camel@kernel.org \
--to=jlayton@kernel.org \
--cc=Dai.Ngo@oracle.com \
--cc=chenhx.fnst@fujitsu.com \
--cc=chuck.lever@oracle.com \
--cc=kolga@netapp.com \
--cc=linux-nfs@vger.kernel.org \
--cc=neilb@suse.de \
--cc=tom@talpey.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox