Linux NFS development
 help / color / mirror / Atom feed
* [PATCH 0/5] NFSD: Apply export security when a compound crosses exports
@ 2026-11-03 19:52 Chuck Lever
  2026-11-03 19:52 ` [PATCH 1/5] NFSD: Check the secure-port policy when entering an export Chuck Lever
                   ` (5 more replies)
  0 siblings, 6 replies; 8+ messages in thread
From: Chuck Lever @ 2026-11-03 19:52 UTC (permalink / raw)
  To: VeroFess, Jeff Layton, NeilBrown, Olga Kornievskaia, Dai Ngo,
	Tom Talpey, Al Viro
  Cc: linux-nfs, Chuck Lever

VeroFess reported that a compound can move the current filehandle
into another export without NFSD applying all of that export's
policy:

  https://patch.msgid.link/20261103013237.1174538-1-coderzeng@gmail.com

fh_verify() is where NFSD checks an export's secure-port setting and
installs the credentials its squash options map a request to. A
LOOKUP that crosses a mountpoint, RESTOREFH, and the saved filehandle
that COPY and CLONE consume do not go through fh_verify(). An
operation that then uses an OPEN stateid, such as READ, CLONE, or
COPY, resolves the stateid without calling fh_verify() either. The
request runs under the previous export's port policy and credential
mapping. The requester must already hold an OPEN stateid that NFSD
granted after a full check, so the exposure is a client that keeps a
stateid across a change of port or of export options.

Rather than repeat fh_verify() at every crossing, this series makes
the crossing path itself complete. check_nfsd_access() gains the port
check, so a check added there covers LOOKUP, LOOKUPP, and the COPY
source alongside PUTFH. nfsd_setuser() runs after a crossing and
after RESTOREFH, and once for each side of a cross-export COPY or
CLONE.

---
Chuck Lever (5):
      NFSD: Check the secure-port policy when entering an export
      NFSD: Defer the PUTFH secure-port check
      NFSD: Report WRONGSEC from PUTFH when OPEN uses the current filehandle
      NFSD: Apply the entered export's credentials after LOOKUP and RESTOREFH
      NFSD: Use each export's credentials for the COPY and CLONE stateids

 fs/nfsd/export.c   | 24 ++++++++++++++------
 fs/nfsd/export.h   |  3 ++-
 fs/nfsd/nfs4proc.c | 65 +++++++++++++++++++++++++++++++++++++++++++++++-------
 fs/nfsd/nfsfh.c    | 45 +++++++++++++++++++++++++++++--------
 fs/nfsd/nfsfh.h    |  2 ++
 fs/nfsd/trace.h    |  3 ++-
 fs/nfsd/vfs.c      | 17 +++++++++-----
 fs/nfsd/vfs.h      |  1 +
 8 files changed, 128 insertions(+), 32 deletions(-)
---
base-commit: 693afd3ce9ae5cddb7225ec87975e6ef1443e502
change-id: 20261103-verofess-2-3101d53cfc18

Best regards,
--  
Chuck Lever <cel@kernel.org>


^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2026-11-04 21:07 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-11-03 19:52 [PATCH 0/5] NFSD: Apply export security when a compound crosses exports Chuck Lever
2026-11-03 19:52 ` [PATCH 1/5] NFSD: Check the secure-port policy when entering an export Chuck Lever
2026-11-03 19:52 ` [PATCH 2/5] NFSD: Defer the PUTFH secure-port check Chuck Lever
2026-11-03 19:52 ` [PATCH 3/5] NFSD: Report WRONGSEC from PUTFH when OPEN uses the current filehandle Chuck Lever
2026-11-03 19:52 ` [PATCH 4/5] NFSD: Apply the entered export's credentials after LOOKUP and RESTOREFH Chuck Lever
2026-11-03 19:52 ` [PATCH 5/5] NFSD: Use each export's credentials for the COPY and CLONE stateids Chuck Lever
2026-11-04 20:32 ` [PATCH 0/5] NFSD: Apply export security when a compound crosses exports VeroFess
2026-11-04 21:06   ` Chuck Lever

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox