linux/Documentation/filesystems/nfs
Benjamin Coddington 2a83ffc557 NFSD: Sign filehandles
NFS clients may bypass restrictive directory permissions by using
open_by_handle() (or other available OS system call) to guess the
filehandles for files below that directory.

In order to harden knfsd servers against this attack, create a method to
sign and verify filehandles using SipHash-2-4 as a MAC (Message
Authentication Code).  According to
https://cr.yp.to/siphash/siphash-20120918.pdf, SipHash can be used as a
MAC, and our use of SipHash-2-4 provides a low 1 in 2^64 chance of forgery.

Filehandles that have been signed cannot be tampered with, nor can
clients reasonably guess correct filehandles and hashes that may exist in
parts of the filesystem they cannot access due to directory permissions.

Append the 8 byte SipHash to encoded filehandles for exports that have set
the "sign_fh" export option.  Filehandles received from clients are
verified by comparing the appended hash to the expected hash.  If the MAC
does not match the server responds with NFS error _STALE.  If unsigned
filehandles are received for an export with "sign_fh" they are rejected
with NFS error _STALE.

Signed-off-by: Benjamin Coddington <bcodding@hammerspace.com>
Reviewed-by: Jeff Layton <jlayton@kernel.org>
Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
2026-03-29 21:25:09 -04:00
..
client-identifier.rst Documentation: Fix typos 2023-08-18 11:29:03 -06:00
exporting.rst NFSD: Sign filehandles 2026-03-29 21:25:09 -04:00
index.rst NFSD: Add toctree entry for NFSD IO modes docs 2025-12-03 09:05:14 -05:00
knfsd-stats.rst Documentation: nfs: knfsd-stats: convert to ReST 2020-02-13 11:21:35 -07:00
localio.rst nfs: probe for LOCALIO when v3 client reconnects to server 2025-01-14 17:05:10 -05:00
nfs41-server.rst Documentation: nfs: nfs41-server: convert to ReST 2020-02-13 11:21:31 -07:00
nfsd-io-modes.rst NFSD: nfsd-io-modes: Separate lists 2025-12-03 09:05:14 -05:00
nfsd-maintainer-entry-profile.rst NFS: nfsd-maintainer-entry-profile: Inline function name prefixes 2025-11-17 08:46:06 -05:00
pnfs.rst Documentation: nfs: convert pnfs.txt to ReST 2020-02-13 11:21:08 -07:00
reexport.rst nfsd: disallow file locking and delegations for NFSv4 reexport 2025-03-10 09:11:08 -04:00
rpc-cache.rst Documentation: Fix typos 2023-08-18 11:29:03 -06:00
rpc-server-gss.rst Documentation: Fix typos 2023-08-18 11:29:03 -06:00