Linux NFS development
 help / color / mirror / Atom feed
* [PATCH 0/3] NFSD: Apply all export checks when a compound changes exports
@ 2026-11-03  1:32 VeroFess
  2026-11-03  1:32 ` [PATCH 1/3] NFSD: Check the secure-port policy when entering an export VeroFess
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: VeroFess @ 2026-11-03  1:32 UTC (permalink / raw)
  To: linux-nfs; +Cc: cel, jlayton

When a compound moves the current filehandle into another export,
NFSD does not always apply all of that export's checks. These patches
fix three such paths: LOOKUP entering an export, RESTOREFH, and COPY
and CLONE with a source and destination in different exports. They
apply to nfsd-testing at 08f97dfc517b.

In each case, the requester must already hold an OPEN stateid that
NFSD granted after a full export check.

Patch 1 checks the secure-port setting of an export entered by LOOKUP.
An AUTH_SYS request from an unreserved port can no longer enter a
secure export that PUTFH of the same filehandle would reject.

Patch 2 applies the entered export's credentials after LOOKUP crosses
into another export and after RESTOREFH, so root_squash and all_squash
follow the export that owns the current filehandle.

Patch 3 verifies the COPY and CLONE source and destination
filehandles, so each stateid is checked with the credentials of its
own export.

The combined tree was built for x86-64 with KASAN, kernel TLS and
NFSD_V4_2_INTER_SSC, and tested in a guest on NFSv4.0, v4.1 and v4.2.
The test results are below the --- line of each patch. The guest log
showed no KASAN report or oops. Each patch also applies and builds
with W=1 on its own.

VeroFess (3):
  NFSD: Check the secure-port policy when entering an export
  NFSD: Apply the entered export's credentials after LOOKUP and
    RESTOREFH
  NFSD: Verify COPY and CLONE source and destination filehandles

 fs/nfsd/export.c   |  8 ++++++--
 fs/nfsd/nfs4proc.c | 18 +++++++++++++++---
 fs/nfsd/nfsfh.c    | 26 ++++++++++++++++++++++----
 fs/nfsd/nfsfh.h    |  2 ++
 fs/nfsd/vfs.c      | 26 ++++++++++++++++++++------
 5 files changed, 65 insertions(+), 15 deletions(-)

base-commit: 08f97dfc517b50a00a41ce99f5af7b6ce2814592

-- 
2.43.0


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

end of thread, other threads:[~2026-11-03 14:06 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-11-03  1:32 [PATCH 0/3] NFSD: Apply all export checks when a compound changes exports VeroFess
2026-11-03  1:32 ` [PATCH 1/3] NFSD: Check the secure-port policy when entering an export VeroFess
2026-11-03  1:32 ` [PATCH 2/3] NFSD: Apply the entered export's credentials after LOOKUP and RESTOREFH VeroFess
2026-11-03  1:32 ` [PATCH 3/3] NFSD: Verify COPY and CLONE source and destination filehandles VeroFess
2026-11-03 14:06 ` [PATCH 0/3] NFSD: Apply all export checks when a compound changes exports Chuck Lever

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