From: "Chuck Lever" <cel@kernel.org>
To: sariorkunemin@gmail.com, "Jeff Layton" <jlayton@kernel.org>,
NeilBrown <neil@brown.name>,
"Olga Kornievskaia" <okorniev@redhat.com>,
"Dai Ngo" <Dai.Ngo@oracle.com>, "Tom Talpey" <tom@talpey.com>
Cc: linux-nfs@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH 2/2] nfsd: check access to the export being entered when crossing mounts
Date: Wed, 04 Nov 2026 13:52:13 -0500 [thread overview]
Message-ID: <d2539122-2d86-4306-af54-43598f4aded7@app.fastmail.com> (raw)
In-Reply-To: <20261104-nfsd-cross-mnt-v1-2-5ec5fca0a553@gmail.com>
On Wed, Nov 4, 2026, at 6:56 AM, orkunsari via B4 Relay wrote:
> From: orkunsari <sariorkunemin@gmail.com>
>
> Commit f0d6ad5a2f67 ("nfsd: move check_nfsd_access() call into
> nfsd_cross_mnt()") moved the check_nfsd_access() calls from
> nfsd_lookup() and the NFSv4 READDIR encoder into nfsd_cross_mnt(). The
> moved call checks @exp, the export being left, which the caller has
> already verified, rather than @exp2, the export being entered. The
> sec= and xprtsec= settings of a crossmnt/nohide child export are
> therefore no longer applied when LOOKUP or READDIR returns its root
> filehandle and attributes. Later operations on that filehandle are
> still checked by fh_verify().
>
> The same commit also removed the check that nfsd_lookup() applied after
> a ".." lookup steps up into a parent export via nfsd_lookup_parent().
>
> Simply checking @exp2 instead is not enough: nfsd_lookup_dentry() also
> serves SECINFO, which must not fail with NFS4ERR_WRONGSEC (RFC 8881,
> section 2.6.3.1.1.5) and did not check the target export before.
>
> Split the crossing into __nfsd_cross_mnt(), which checks @exp2 before
> switching to it only when asked to. nfsd_cross_mnt() keeps checking,
> for READDIR and the CREATE paths, while nfsd_lookup_dentry() does not.
> nfsd_lookup() checks the resulting export whenever it differs from the
> directory's, which covers both mount crossings and "..", as it did
> before.
>
> This was found by AI-assisted code review (Claude Code). The fix has
> been build-tested with W=1 only; no reproducer was run.
>
> Fixes: f0d6ad5a2f67 ("nfsd: move check_nfsd_access() call into
> nfsd_cross_mnt()")
> Signed-off-by: orkunsari <sariorkunemin@gmail.com>
This issue is very likely addressed by patches I posted earlier this
week in response to a similar vulnerability report.
- "NFSD: Check the entered export on a mount crossing" checks the
entered export inside nfsd_cross_mnt and in nfsd_lookup_parent,
which covers the ".." case that 2/2 also raises.
- "NFSD: Let SECINFO query an export that excludes the request's
flavor" handles the SECINFO concern the patch solves with its
__nfsd_cross_mnt split.
- Two follow-ups (secure-port policy, applying the entered export's
credentials after LOOKUP and RESTOREFH) rework the same region
further.
Let's set 2/2 aside for now, because the series I posted seems more
thorough.
--
Chuck Lever (Come to NFS bake-a-thon! https://nfsv4bat.org)
next prev parent reply other threads:[~2026-11-04 18:52 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-04 11:56 [PATCH 0/2] nfsd: fix two mount-crossing regressions from the v7.4 merge window orkunsari via B4 Relay
2026-11-04 11:56 ` [PATCH 1/2] nfsd: unlock the locked parent after crossing a mount in CREATE orkunsari via B4 Relay
2026-11-04 11:56 ` [PATCH 2/2] nfsd: check access to the export being entered when crossing mounts orkunsari via B4 Relay
2026-11-04 18:52 ` Chuck Lever [this message]
2026-11-04 19:48 ` [PATCH 0/2] nfsd: fix two mount-crossing regressions from the v7.4 merge window Chuck Lever
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=d2539122-2d86-4306-af54-43598f4aded7@app.fastmail.com \
--to=cel@kernel.org \
--cc=Dai.Ngo@oracle.com \
--cc=jlayton@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-nfs@vger.kernel.org \
--cc=neil@brown.name \
--cc=okorniev@redhat.com \
--cc=sariorkunemin@gmail.com \
--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
all inboxes | Powered by JetHome®