Netdev List
 help / color / mirror / Atom feed
From: "Chuck Lever" <cel@kernel.org>
To: linux-nfs@vger.kernel.org, "Sagi Grimberg" <sagi@grimberg.me>
Cc: keyrings@vger.kernel.org, kernel-tls-handshake@lists.linux.dev,
	netdev@vger.kernel.org, "Trond Myklebust" <trondmy@kernel.org>,
	"Anna Schumaker" <anna@kernel.org>,
	"Christoph Hellwig" <hch@lst.de>,
	"Hannes Reinecke" <hare@suse.de>,
	"David Howells" <dhowells@redhat.com>,
	"Jarkko Sakkinen" <jarkko@kernel.org>
Subject: Re: [RFC] NFS: named client identities for mTLS mounts and a per-namespace .nfs keyring
Date: Sun, 13 Sep 2026 12:05:30 -0400	[thread overview]
Message-ID: <8ddb29a7-28e7-4c90-8d6c-5ab2976fa53a@app.fastmail.com> (raw)
In-Reply-To: <20260602154740.49861-1-cel@kernel.org>



On Tue, Jun 2, 2026, at 11:47 AM, Chuck Lever wrote:

> Userspace front end
> ===================
>
> With the keyring in place the front end is straightforward and follows
> the nvme-cli / cifscreds pattern.
>
> A new nfs-utils tool -- working name nfstlskey, fitting the nfsidmap /
> nfsconf family -- manages x.509 client identities:
>
>     nfstlskey add  <identity> --cert cert.pem --key key.pem
>     nfstlskey list
>     nfstlskey remove <identity>
>
> The add subcommand reads the PEM cert and key, converts each to DER,
> and creates two "user" keys on the netns .nfs keyring ("user" because
> tlshd consumes raw DER via keyctl_read_alloc()), with possessor-only
> read. Description convention:
>
>     nfs:x509:<identity>:cert
>     nfs:x509:<identity>:privkey
>
> The mount command names the identity:
>
>     mount -o xprtsec=mtls,tls_identity=<identity> server:/export /mnt
>
> mount.nfs runs in the caller's namespace, searches the .nfs keyring for
> the two descriptions, and passes the existing cert_serial= and
> privkey_serial= options to the kernel. tls_identity= is purely a
> userspace convenience that resolves a name to the serials the kernel
> already accepts; the raw serial options remain as a documented escape
> hatch. Both get documented in nfs(5), with a new nfstlskey(8) page.
>
> tlshd changes are minimal: confirm the per-handshake link of the passed
> keyring happens before the cert and privkey serials are read, and
> retire the now-unnecessary .nfs entry in the keyrings= startup path.

I've created an nfstlskey tool and pushed it to the nfs-mtls-identity
branch of https://github.com/oracle/ktls-utils/ . It compiles, but I
haven't otherwise tested it. There is a nfstlskey(8) man page.

There is a change to tlshd so that the handshake children processes
pick up the .nfs keyring instead of picking .nfs up at tlshd start-up
time. This avoids the ordering problem of starting tlshd before the
NFS client module is loaded.

I'm hoping this new tool can be used with current kernels, though
all of this is missing proper namespace support at the moment, so
it should work in the init net-ns only. Kernel patches for namespace
support are in the works.

Please kick the tires. Is this the kind of administrative UX you
expect?


-- 
Chuck Lever (Come to NFS bake-a-thon! https://nfsv4bat.org)

      parent reply	other threads:[~2026-09-13 16:05 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-06-02 15:47 [RFC] NFS: named client identities for mTLS mounts and a per-namespace .nfs keyring Chuck Lever
2026-06-03  1:39 ` Hannes Reinecke
2026-06-03 14:27   ` Chuck Lever
2026-06-05 21:32     ` Sagi Grimberg
2026-06-05 22:07       ` Chuck Lever
2026-09-11 19:20   ` Chuck Lever
2026-06-05 21:44 ` Sagi Grimberg
2026-06-06  6:50   ` Hannes Reinecke
2026-09-13 16:05 ` Chuck Lever [this message]

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=8ddb29a7-28e7-4c90-8d6c-5ab2976fa53a@app.fastmail.com \
    --to=cel@kernel.org \
    --cc=anna@kernel.org \
    --cc=dhowells@redhat.com \
    --cc=hare@suse.de \
    --cc=hch@lst.de \
    --cc=jarkko@kernel.org \
    --cc=kernel-tls-handshake@lists.linux.dev \
    --cc=keyrings@vger.kernel.org \
    --cc=linux-nfs@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=sagi@grimberg.me \
    --cc=trondmy@kernel.org \
    /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