]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
NFSD/export: Add sign_fh export option
authorBenjamin Coddington <bcodding@hammerspace.com>
Wed, 25 Feb 2026 12:51:37 +0000 (07:51 -0500)
committerChuck Lever <chuck.lever@oracle.com>
Mon, 30 Mar 2026 01:25:09 +0000 (21:25 -0400)
In order to signal that filehandles on this export should be signed, add a
"sign_fh" export option.  Filehandle signing can help the server defend
against certain filehandle guessing attacks.

Setting the "sign_fh" export option sets NFSEXP_SIGN_FH.  In a future patch
NFSD uses this signal to append a MAC onto filehandles for that export.

While we're in here, tidy a few stray expflags to more closely align to the
export flag order.

Link: https://lore.kernel.org/linux-nfs/cover.1772022373.git.bcodding@hammerspace.com
Signed-off-by: Benjamin Coddington <bcodding@hammerspace.com>
Reviewed-by: Jeff Layton <jlayton@kernel.org>
Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
fs/nfsd/export.c
include/uapi/linux/nfsd/export.h

index 8e8a76a44ff0b16a2b9d2c4cd6da36d632657daf..7f4a51b832ef75f6ecf1b70e7ab4ca9da2e5a1dc 100644 (file)
@@ -1362,13 +1362,14 @@ static struct flags {
        { NFSEXP_ASYNC, {"async", "sync"}},
        { NFSEXP_GATHERED_WRITES, {"wdelay", "no_wdelay"}},
        { NFSEXP_NOREADDIRPLUS, {"nordirplus", ""}},
+       { NFSEXP_SECURITY_LABEL, {"security_label", ""}},
+       { NFSEXP_SIGN_FH, {"sign_fh", ""}},
        { NFSEXP_NOHIDE, {"nohide", ""}},
-       { NFSEXP_CROSSMOUNT, {"crossmnt", ""}},
        { NFSEXP_NOSUBTREECHECK, {"no_subtree_check", ""}},
        { NFSEXP_NOAUTHNLM, {"insecure_locks", ""}},
+       { NFSEXP_CROSSMOUNT, {"crossmnt", ""}},
        { NFSEXP_V4ROOT, {"v4root", ""}},
        { NFSEXP_PNFS, {"pnfs", ""}},
-       { NFSEXP_SECURITY_LABEL, {"security_label", ""}},
        { 0, {"", ""}}
 };
 
index a73ca3703abbc2e1d759fc7729fd0545ebd0cc44..de647cf166c382fe49b3b311ce93c6140934f1c3 100644 (file)
@@ -34,7 +34,7 @@
 #define NFSEXP_GATHERED_WRITES 0x0020
 #define NFSEXP_NOREADDIRPLUS    0x0040
 #define NFSEXP_SECURITY_LABEL  0x0080
-/* 0x100 currently unused */
+#define NFSEXP_SIGN_FH         0x0100
 #define NFSEXP_NOHIDE          0x0200
 #define NFSEXP_NOSUBTREECHECK  0x0400
 #define        NFSEXP_NOAUTHNLM        0x0800          /* Don't authenticate NLM requests - just trust */
@@ -55,7 +55,7 @@
 #define NFSEXP_PNFS            0x20000
 
 /* All flags that we claim to support.  (Note we don't support NOACL.) */
-#define NFSEXP_ALLFLAGS                0x3FEFF
+#define NFSEXP_ALLFLAGS                0x3FFFF
 
 /* The flags that may vary depending on security flavor: */
 #define NFSEXP_SECINFO_FLAGS   (NFSEXP_READONLY | NFSEXP_ROOTSQUASH \