From: "Chuck Lever" <cel@kernel.org>
To: "Jeff Layton" <jlayton@kernel.org>,
"Donald Hunter" <donald.hunter@gmail.com>,
"Jakub Kicinski" <kuba@kernel.org>,
"David S. Miller" <davem@davemloft.net>,
"Eric Dumazet" <edumazet@google.com>,
"Paolo Abeni" <pabeni@redhat.com>,
"Simon Horman" <horms@kernel.org>,
"Jonathan Corbet" <corbet@lwn.net>,
"Shuah Khan" <skhan@linuxfoundation.org>,
"Andrew Morton" <akpm@linux-foundation.org>,
"John Fastabend" <john.fastabend@gmail.com>,
"Sabrina Dubroca" <sd@queasysnail.net>,
"Keith Busch" <kbusch@kernel.org>, "Jens Axboe" <axboe@kernel.dk>,
"Christoph Hellwig" <hch@lst.de>,
"Sagi Grimberg" <sagi@grimberg.me>,
"Chaitanya Kulkarni" <kch@nvidia.com>,
NeilBrown <neil@brown.name>,
"Olga Kornievskaia" <okorniev@redhat.com>,
"Dai Ngo" <Dai.Ngo@oracle.com>, "Tom Talpey" <tom@talpey.com>,
"Trond Myklebust" <trondmy@kernel.org>,
"Anna Schumaker" <anna@kernel.org>
Cc: kernel-tls-handshake@lists.linux.dev, netdev@vger.kernel.org,
linux-nvme@lists.infradead.org, linux-nfs@vger.kernel.org,
"Chuck Lever" <chuck.lever@oracle.com>
Subject: Re: [PATCH 0/9] Deliver TLS session tags to upper-layer consumers (NFSD)
Date: Sat, 06 Jun 2026 07:43:17 -0700 [thread overview]
Message-ID: <ca63fcf5-8d3d-4ee5-ac62-fd0af937cf87@app.fastmail.com> (raw)
In-Reply-To: <cbb8bf9325d5877d8e736b42f2ffde01dc7e2739.camel@kernel.org>
On Sat, Jun 6, 2026, at 6:26 AM, Jeff Layton wrote:
> On Fri, 2026-06-05 at 13:34 -0400, Chuck Lever wrote:
>> NFSD and similar upper-layer services want access-control decisions
>> based on TLS peer-certificate characteristics, but in-kernel x.509
>> parsing would duplicate work mature userspace libraries already do.
>> This series gives tlshd a way to evaluate certificates against
>> admin-defined policy and report matching policies back to the kernel
>> as opaque string tags. The handshake layer plumbs the tags through to
>> the upper-layer consumer's completion callback; intersection against
>> per-resource tag sets stays the consumer's problem.
>>
>> Four architectural choices shape the series, only one of which is
>> visible in any single patch.
>>
>> The tagging vocabulary is opaque to the kernel. tlshd decides what
>> each tag means; the handshake layer and its consumers only test
>> membership. This keeps x.509 out of the kernel and lets policy evolve
>> at userspace speed. Any future attribute the kernel wants to gate on
>> must be expressed as a tag rather than as a new netlink field per
>> attribute.
>>
>> DONE gains a privilege check (patch 1) as a prerequisite, not as
>> cleanup. Without it, an unprivileged process guessing a sockfd could
>> submit a forged DONE and effectively grant or deny tag membership
>> for a real handshake. Once tags carry authorization weight, that
>> pre-existing gap becomes load-bearing. The fix predates tags in
>> principle and carries a Fixes: tag, but it sits at the head of this
>> series so the rest of the work has a trustworthy foundation.
>>
>> HANDSHAKE_MAX_SESSIONTAGS is advertised on every ACCEPT reply as
>> HANDSHAKE_A_ACCEPT_MAX_TAGS (patch 6), so tlshd can size its
>> DONE-side tag list against the kernel's runtime limit rather than
>> guessing from header constants. If a daemon overruns anyway, the
>> DONE handler truncates and logs one pr_warn_once rather than
>> returning -E2BIG: tearing down a handshake the operator almost
>> certainly wants to keep is a worse outcome than dropping a few
>> tags. The truncation path is defense-in-depth for a buggy or
>> stale agent, not the primary signal.
>>
>> The tagset helper (patch 3) is split out as a generic library so
>> NFSD export tagging (patches 8 and 9) can use it without further
>> churn in net/handshake/.
>>
>> ---
>> Chuck Lever (9):
>> handshake: Require admin permission for DONE command
>> handshake: Add tags to "done" downcall
>> lib: Add a "tagset" data structure
>> handshake: Pick up session tags passed during the DONE downcall
>> handshake: Add a kunit test for the completion gate
>> handshake: advertise the session-tag cap to user space
>> SUNRPC: Copy the TLS session tags when they are available
>> NFSD: Implement export tagging
>> NFSD: Add allow_tags to the netlink export interface
>>
>> Documentation/core-api/index.rst | 1 +
>> Documentation/core-api/tagset.rst | 225 +++++++++++++++++++++++++++++
>> Documentation/netlink/specs/handshake.yaml | 16 ++
>> Documentation/netlink/specs/nfsd.yaml | 10 ++
>> Documentation/networking/tls-handshake.rst | 63 +++++++-
>> drivers/nvme/host/tcp.c | 3 +-
>> drivers/nvme/target/tcp.c | 3 +-
>> fs/nfsd/export.c | 141 +++++++++++++++++-
>> fs/nfsd/export.h | 11 ++
>> fs/nfsd/netlink.c | 4 +-
>> fs/nfsd/netlink.h | 3 +-
>> fs/nfsd/trace.h | 19 +++
>> include/linux/sunrpc/svc_xprt.h | 2 +
>> include/linux/tagset.h | 187 ++++++++++++++++++++++++
>> include/net/handshake.h | 30 +++-
>> include/uapi/linux/handshake.h | 4 +
>> include/uapi/linux/nfsd_netlink.h | 1 +
>> lib/Makefile | 1 +
>> lib/tagset.c | 174 ++++++++++++++++++++++
>> net/handshake/genl.c | 7 +-
>> net/handshake/handshake-test.c | 72 +++++++++
>> net/handshake/handshake.h | 6 +
>> net/handshake/netlink.c | 109 +++++++++++++-
>> net/handshake/request.c | 68 ++++++++-
>> net/handshake/tlshd.c | 10 +-
>> net/sunrpc/svc_xprt.c | 11 +-
>> net/sunrpc/svcauth_unix.c | 12 ++
>> net/sunrpc/svcsock.c | 38 ++++-
>> net/sunrpc/xprtsock.c | 5 +-
>> 29 files changed, 1205 insertions(+), 31 deletions(-)
>> ---
>> base-commit: 4d4d6605de5f91a40335729b6a7cc15e83b280f3
>> change-id: 20260512-tls-session-tags-9d0042583f44
>>
>> Best regards,
>> --
>> Chuck Lever <chuck.lever@oracle.com>
>
> I was wanting to review this, but I can't seem to get it to apply
> cleanly to any known tree. What tree is this based on?
commit 4d4d6605de5f91a40335729b6a7cc15e83b280f3 (cel/nfsd-testing)
Author: Chuck Lever <chuck.lever@oracle.com>
AuthorDate: Thu Sep 5 15:25:37 2024 -0400
Commit: Chuck Lever <chuck.lever@oracle.com>
CommitDate: Thu May 28 11:34:51 2026 -0400
That's some old shit.
I will rebase it before posting it again.
--
Chuck Lever
prev parent reply other threads:[~2026-06-06 14:43 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-06-05 17:34 [PATCH 0/9] Deliver TLS session tags to upper-layer consumers (NFSD) Chuck Lever
2026-06-05 17:34 ` [PATCH 1/9] handshake: Require admin permission for DONE command Chuck Lever
2026-06-06 12:20 ` Jeff Layton
2026-06-05 17:34 ` [PATCH 2/9] handshake: Add tags to "done" downcall Chuck Lever
2026-06-05 17:34 ` [PATCH 3/9] lib: Add a "tagset" data structure Chuck Lever
2026-06-05 17:34 ` [PATCH 4/9] handshake: Pick up session tags passed during the DONE downcall Chuck Lever
2026-06-05 17:34 ` [PATCH 5/9] handshake: Add a kunit test for the completion gate Chuck Lever
2026-06-05 17:34 ` [PATCH 6/9] handshake: advertise the session-tag cap to user space Chuck Lever
2026-06-05 17:34 ` [PATCH 7/9] SUNRPC: Copy the TLS session tags when they are available Chuck Lever
2026-06-05 17:34 ` [PATCH 8/9] NFSD: Implement export tagging Chuck Lever
2026-06-05 17:34 ` [PATCH 9/9] NFSD: Add allow_tags to the netlink export interface Chuck Lever
2026-06-06 13:26 ` [PATCH 0/9] Deliver TLS session tags to upper-layer consumers (NFSD) Jeff Layton
2026-06-06 14:43 ` 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=ca63fcf5-8d3d-4ee5-ac62-fd0af937cf87@app.fastmail.com \
--to=cel@kernel.org \
--cc=Dai.Ngo@oracle.com \
--cc=akpm@linux-foundation.org \
--cc=anna@kernel.org \
--cc=axboe@kernel.dk \
--cc=chuck.lever@oracle.com \
--cc=corbet@lwn.net \
--cc=davem@davemloft.net \
--cc=donald.hunter@gmail.com \
--cc=edumazet@google.com \
--cc=hch@lst.de \
--cc=horms@kernel.org \
--cc=jlayton@kernel.org \
--cc=john.fastabend@gmail.com \
--cc=kbusch@kernel.org \
--cc=kch@nvidia.com \
--cc=kernel-tls-handshake@lists.linux.dev \
--cc=kuba@kernel.org \
--cc=linux-nfs@vger.kernel.org \
--cc=linux-nvme@lists.infradead.org \
--cc=neil@brown.name \
--cc=netdev@vger.kernel.org \
--cc=okorniev@redhat.com \
--cc=pabeni@redhat.com \
--cc=sagi@grimberg.me \
--cc=sd@queasysnail.net \
--cc=skhan@linuxfoundation.org \
--cc=tom@talpey.com \
--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