Linux NFS development
 help / color / mirror / Atom feed
From: Jeff Layton <jlayton@kernel.org>
To: Chuck Lever <cel@kernel.org>, NeilBrown <neilb@ownmail.net>,
	Olga Kornievskaia <okorniev@redhat.com>,
	Dai Ngo <dai.ngo@oracle.com>, Tom Talpey <tom@talpey.com>
Cc: linux-nfs@vger.kernel.org, XIAO WU <xiaowu.417@qq.com>
Subject: Re: [PATCH] NFSD: Guard admin state-revocation walks with NFSD_NET_UP
Date: Mon, 22 Jun 2026 10:01:31 -0400	[thread overview]
Message-ID: <2888cb8f7cde2ed76d59a807b2668cf95f1166ff.camel@kernel.org> (raw)
In-Reply-To: <2b3f6886-86ca-4da3-b1df-a2bec0f93e5f@app.fastmail.com>

On Mon, 2026-06-22 at 09:14 -0400, Chuck Lever wrote:
> On Mon, 2026-06-22 at 07:57 -0400, Jeff Layton wrote:
> > Can nn->nfsd_serv be non-NULL while the NFSv4 state tables are still
> > NULL?
> > ...
> > Would checking nn->nfsd_net_up instead of nn->nfsd_serv be more
> > accurate here, since nfsd_net_up is set at the tail of
> > nfsd_startup_net() exactly when the state tables become valid?
> 
> Yep, that's exactly the gap. The hunk you've quoted is 1/3 of the
> earlier "post-shutdown use-after-free" series, which only guarded the
> shutdown side of the window. nn->nfsd_serv is also set at service
> creation, before nfsd_startup_net() allocates conf_id_hashtbl, so the
> startup side was still exposed.
> 
> The thread you're replying to is the follow-on that closes it: it
> switches all three unlock paths (write_unlock_fs,
> nfsd_nl_unlock_filesystem_doit, nfsd_nl_unlock_export_doit) from
> nn->nfsd_serv to test_bit(NFSD_NET_UP, &nn->flags) and rewrites the
> walkers' Context: notes to match. NFSD_NET_UP is set at the tail of
> nfsd_startup_net() and cleared in nfsd_shutdown_net() after the tables
> are freed, so it brackets precisely the window you describe.
> 
> I assume your comment was meant for 1/3 of that series rather than
> this thread... but we've reached the same conclusion, so no action
> needed beyond this patch, correct?


Ahh right. I missed that that had been fixed in the other series. This
is fine then.

Reviewed-by: Jeff Layton <jlayton@kernel.org>

      reply	other threads:[~2026-06-22 14:01 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-06-21 16:25 [PATCH] NFSD: Guard admin state-revocation walks with NFSD_NET_UP Chuck Lever
2026-06-22 11:57 ` Jeff Layton
2026-06-22 13:14   ` Chuck Lever
2026-06-22 14:01     ` Jeff Layton [this message]

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=2888cb8f7cde2ed76d59a807b2668cf95f1166ff.camel@kernel.org \
    --to=jlayton@kernel.org \
    --cc=cel@kernel.org \
    --cc=dai.ngo@oracle.com \
    --cc=linux-nfs@vger.kernel.org \
    --cc=neilb@ownmail.net \
    --cc=okorniev@redhat.com \
    --cc=tom@talpey.com \
    --cc=xiaowu.417@qq.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