From: Benjamin Coddington <bcodding@hammerspace.com>
To: Lionel Cons <lionelcons1972@gmail.com>
Cc: linux-nfs@vger.kernel.org, linux-fsdevel@vger.kernel.org,
linux-crypto@vger.kernel.org
Subject: Re: [PATCH v2 3/3] NFSD: Sign filehandles
Date: Fri, 30 Jan 2026 08:25:45 -0500 [thread overview]
Message-ID: <97207D44-31EC-474F-8D68-CBA50CA324AE@hammerspace.com> (raw)
In-Reply-To: <CAPJSo4XhEOGncxBRZcOL6KmyBRY+pERiCLUkWzN7Zw+8oUmXGg@mail.gmail.com>
On 30 Jan 2026, at 7:58, Lionel Cons wrote:
> [You don't often get email from lionelcons1972@gmail.com. Learn why this is important at https://aka.ms/LearnAboutSenderIdentification ]
>
> On Wed, 21 Jan 2026 at 22:03, Benjamin Coddington
> <bcodding@hammerspace.com> wrote:
>>
>> 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 as a MAC (Message Authentication
>> Code). 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. The filehandle's fh_auth_type is set to
>> FH_AT_MAC(1) to indicate the filehandle is signed. 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 _BADHANDLE.
>> If unsigned filehandles are received for an export with "sign_fh" they are
>> rejected with NFS error _BADHANDLE.
>
Hi Lionel,
> Random questions:
> 1. CPU load: Linux NFSv4 servers consume LOTS of CPU time, which has
> become a HUGE problem for hosting them on embedded hardware (so no
> realistic NFSv4 server performance on an i.mx6 or RISC/V machine). And
> this has become much worse in the last two years. Did anyone measure
> the impact of this patch series?
We're essentially adding a siphash operation for every encode and decode of
a filehandle. Siphash is lauded as "faster than sha255, slower than
xxhash". Measuring the performance impact might look like crafting huge
compounds of GETATTR, but I honestly don't think (after network latency) the
performance impact will be measurable.
I attempted to measure a time difference between runs of fstests suite --
there were no significant measurable effects in my crude total time
calculations.
I could, if it pleases everyone, do a function profile for fh_append_mac and
fh_verify_mac - but the users of this option do not care about gating it
behind strict performance optimizations because we're fixing a security
problem that matters much more to those users.
> 2. Do NFS clients require any changes for this?
No - the filehandle is opaque.
Ben
next prev parent reply other threads:[~2026-01-30 13:25 UTC|newest]
Thread overview: 50+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-01-21 20:24 [PATCH v2 0/3] kNFSD Signed Filehandles Benjamin Coddington
2026-01-21 20:24 ` [PATCH v2 1/3] NFSD: Add a key for signing filehandles Benjamin Coddington
2026-01-21 20:43 ` Chuck Lever
2026-01-21 20:54 ` Benjamin Coddington
2026-01-21 22:17 ` Chuck Lever
2026-01-21 22:56 ` Benjamin Coddington
2026-01-21 23:55 ` Chuck Lever
2026-01-22 1:22 ` Benjamin Coddington
2026-01-22 12:30 ` Jeff Layton
2026-01-22 13:28 ` Benjamin Coddington
2026-01-22 13:50 ` Jeff Layton
2026-01-22 14:53 ` Chuck Lever
2026-01-22 14:49 ` Chuck Lever
2026-01-22 15:17 ` Benjamin Coddington
2026-01-23 23:24 ` NeilBrown
2026-01-22 12:38 ` Jeff Layton
2026-01-22 18:20 ` Benjamin Coddington
2026-01-22 19:01 ` Chuck Lever
2026-01-22 0:51 ` Eric Biggers
2026-01-22 1:08 ` Benjamin Coddington
2026-01-21 20:24 ` [PATCH v2 2/3] NFSD/export: Add sign_fh export option Benjamin Coddington
2026-01-22 16:02 ` Jeff Layton
2026-01-22 16:31 ` Benjamin Coddington
2026-01-22 16:50 ` Jeff Layton
2026-01-22 16:54 ` Benjamin Coddington
2026-01-22 17:03 ` Jeff Layton
2026-01-22 18:57 ` Chuck Lever
2026-01-21 20:24 ` [PATCH v2 3/3] NFSD: Sign filehandles Benjamin Coddington
2026-01-23 21:33 ` Chuck Lever
2026-01-23 22:21 ` NeilBrown
2026-01-23 22:28 ` Chuck Lever
2026-01-23 23:38 ` NeilBrown
2026-01-24 0:33 ` Chuck Lever
2026-01-24 1:56 ` NeilBrown
2026-01-24 13:58 ` Benjamin Coddington
2026-01-24 16:07 ` Chuck Lever
2026-01-24 18:48 ` Trond Myklebust
2026-01-24 19:48 ` Chuck Lever
2026-01-26 18:22 ` Benjamin Coddington
2026-01-28 14:41 ` Chuck Lever
2026-01-28 21:24 ` Benjamin Coddington
2026-01-29 14:36 ` Chuck Lever
2026-01-30 12:58 ` Lionel Cons
2026-01-30 13:25 ` Benjamin Coddington [this message]
2026-01-30 14:47 ` Chuck Lever
2026-01-30 23:26 ` Benjamin Coddington
2026-01-30 16:33 ` Trond Myklebust
2026-01-30 14:43 ` Chuck Lever
2026-01-21 22:55 ` [PATCH v2 0/3] kNFSD Signed Filehandles NeilBrown
2026-01-23 22:24 ` [PATCH v2 1/3] NFSD: Add a key for signing filehandles NeilBrown
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=97207D44-31EC-474F-8D68-CBA50CA324AE@hammerspace.com \
--to=bcodding@hammerspace.com \
--cc=linux-crypto@vger.kernel.org \
--cc=linux-fsdevel@vger.kernel.org \
--cc=linux-nfs@vger.kernel.org \
--cc=lionelcons1972@gmail.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