🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: linux.kernel.netdev
Article #23647

Re: [PATCH net-next v3 00/10] Deliver TLS session tags to upper-layer consumers (NFSD)

#23647
From: "Chuck Lever"
Date: Fri, 27 Nov 2026 16:30
116 lines
15918 bytes
On Sat, Nov 21, 2026, at 7:13 PM, Jakub Kicinski wrote:
> On Fri, 13 Nov 2026 14:21:58 -0500 Chuck Lever wrote:
>> NFSD controls remote access to its exports today by IP address and
>> hostname. Neither of these are cryptographically secure. For
>> instance, a MitM can replace the response to a server's plaintext
>> DNS query. As a result, a malicious NFS client can pretend to be a
>> client whose hostname matches one that has access to exports it
>> would otherwise be denied access to.
>> 
>> So instead, we want access-control decisions to be based on
>> cryptographically-vetted objects such as TLS peer-certificates.
>> In-kernel x.509 parsing would duplicate work mature userspace
>> libraries already do, so let's make tlshd evaluate peer certificates
>> in user space.
>> 
>> The certificates are evaluated against admin-defined policy, such
>> as whether the certificate's Issuer matches a particular string.
>> tlshd then marks NFS TLS sessions with those policy matches. Admins
>> also provide a set of policy names on each NFSD export (allow_tags).
>> Computing the intersection with these per-export tags is quick and
>> completely separate from the details of parsing x.509 certificates.
>> 
>> A yet-to-be-posted patch series introduces tag set support to the
>> exportfs command in nfs-utils. tlshd 1.5.0, current as of this
>> writing, already implements TLS session tagging.

> The patches look reasonable to me, overall. At a high level tho - 
> I don't have any familiarity with "tag" based policies.
> Are you confident it's flexible and convenient enough to survive
> as uAPI?
>
> Naively I'd think it creates unnecessarily wide API on both ends
> (handshake and server). My knee jerk design would be to populate
> the full policy in the server, and only carry some "policy ID"
> thru the handshake. Number of policy IDs would equal to the number
> of tag combinations (which result in different behavior).
>
> Any examples of APIs like the one you're adding working well?

Here are a few similar mechanisms that are deployed and working.

1. OpenSSH certificate principals. A CA-signed certificate carries
   a set of principal names. AuthorizedPrincipalsFile lists the
   names a target accepts, and access is granted if any principal
   in the certificate matches a line. That is exactly the
   non-empty-intersection rule. AuthorizedPrincipalsCommand
   computes the set in user space, which is the role tlshd plays
   here. The difference is that principals are minted when the
   certificate is issued, not mapped by a local policy at handshake
   time. [3]

2. AWS IAM Roles Anywhere. It maps X.509 Subject/Issuer/SAN fields
   into session principal tags, such as aws:PrincipalTag/x509Subject/OU,
   through a per-profile attribute mapping. Resource and trust policies
   then condition on those tags. It even uses the name "session tags",
   and the certificate-to-tags step is configured separately from the
   resource policy, as in your design. The differences: AWS tags are
   key/value pairs, and the policy language is richer than set
   intersection. [1], [2]

3. Kerberos PAC group SIDs (AD, Samba, SMB). The KDC, a separate
   component, resolves identity into a set of group SIDs carried in
   the ticket. The file server grants access by intersecting that set
   with the resource ACL and never sees how membership was decided.
   Linux credentials already work this way: supplementary groups and
   the AUTH_SYS gid list are a set of IDs in the credential checked
   against the object. The kernel already enforces
   "set in the session ∩ set on the resource".

The policy-ID model you mentioned looks a lot like labeled IPsec
(XFRMA_SEC_CTX). The IKE daemon puts a single security context on
the SA, and an LSM enforces it.

The kernel already does only mechanical enforcement (intersection).

Policy IDs make the problem bigger, not smaller, IMHO. One ID per
combination of tags that behaves differently, the combinations grow
combinatorially. Policy IDs also force one compiler that knows both
the certificate rules and every export, which joins together the two
independently managed configs that tags keep apart.

So, we could:

- Rename tags "group memberships" in the cover letter and documentation,
  since that is the term PAC, SSH and AWS deployments use.

- Pin the string format in the uAPI by specifying a character set,
  maximum length and the existing cap, with any other format rejected
  at the DONE downcall. Optionally, reserve a prefix: namespace so other
  upper-layer protocols (NVMe) can't collide with NFS tags.

- Clarify in the series cover letter that the kernel only intersects and
  group/tag policy is handled in user space.


Lastly, I haven't found a perfect fit for security policy reviewers, but
these come close:

  Cc: linux-security-module@vger.kernel.org
  Cc: Paul Moore <paul@paul-moore.com>


-- 
Chuck Lever

[1] IAM Roles Anywhere: certificate attribute mapping (https://docs.aws.amazon.com/rolesanywhere/latest/userguide/attribute-mapping.html)
[2] IAM Roles Anywhere: attribute mapping and trust policy
    (https://docs.aws.amazon.com/rolesanywhere/latest/userguide/attribute-mapping-and-trust-policy.html)
[3] openssh-unix-dev: AuthorizedPrincipalsFile (2010) (https://lists.mindrot.org/pipermail/openssh-unix-dev/2010-October/029012.html)
  - GitLab: AuthorizedPrincipalsCommand (https://docs.gitlab.com/administration/operations/ssh_certificates/)
Technical Details
Message-ID: <bbac34f0-1f86-46e2-a3f1-248c65a1b9ec@app.fastmail.com>
Path: mbox-mo1.pugleaf.net!srv.newsdeef.eu!news.mb-net.net!open-news-network.org!news.nntp4.net!nntp.xenet.de!news.neodome.net!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-372848-linux-kernel-netdev=dewy.ru
References: <20261113-tls-session-tags-v3-0-91271964cdb0@kernel.org> <20261121161302.69f202c8@kernel.org>

Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!srv.newsdeef.eu!news.mb-net.net!open-news-network.org!news.nntp4.net!nntp.xenet.de!news.neodome.net!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-372848-linux-kernel-netdev=dewy.ru
From: cel@kernel.org ("Chuck Lever")
Newsgroups: linux.kernel.netdev
Subject: Re: [PATCH net-next v3 00/10] Deliver TLS session tags to upper-layer
 consumers (NFSD)
Date: Fri, 27 Nov 2026 11:30:12 -0500
Organization: Usenet Network
Message-ID: <bbac34f0-1f86-46e2-a3f1-248c65a1b9ec@app.fastmail.com>
References: <20261113-tls-session-tags-v3-0-91271964cdb0@kernel.org>
 <20261121161302.69f202c8@kernel.org>
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: quoted-printable
Injection-Info: usenet.network;
	logging-data="772909"; mail-complaints-to="abuse@usenet.network"
Cancel-Lock: sha1:C7r2kuIUMIM8NKc9iHVeieJ2aC0= sha256:+Bjx8Ykm4tVOOrHtH5MHtBULPm4NPipYFRu5KKmHJYs=
	sha1:Xmc0zl1scRlqNJuFjUoY5zSMUlU= sha256:qtQQzJH3sBZApy1lsJTSNcTjCKSBffxR0O209EU8I6Y=
List-ID: <netdev.vger.kernel.org>
X-Mailpost-Empty-Hdrs: X-Spam-Level
X-Received: from localhost (localhost [127.0.0.1])
	by mail.dewy.ru (Postfix) with ESMTP id 212E5125F62; Fri, 27 Nov 2026 19:30:58 +0300 (MSK)
X-Virus-Scanned: Debian amavisd-new at usenet.network
X-Spam-Flag: NO
X-Spam-Score: -3.501
X-Spam-Status: No, score=-3.501 tagged_above=-9999 required=6.31
	tests=[DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1,
	DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, MAILING_LIST_MULTI=-1,
	RCVD_IN_DNSWL_MED=-2.3, SPF_HELO_NONE=0.001, SPF_PASS=-0.001]
	autolearn=ham autolearn_force=no
X-Authentication-Results: mail.dewy.ru (amavisd-new); dkim=pass (2048-bit key)
	header.d=kernel.org
X-Received: from mail.dewy.ru ([127.0.0.1])
	by localhost (mail.dewy.ru [127.0.0.1]) (amavisd-new, port 10024)
	with ESMTP id 9mvnzT46e3Xq;
	Fri, 27 Nov 2026 19:30:54 +0300 (MSK)
X-Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=172.232.135.74; helo=sto.lore.kernel.org; envelope-from=netdev+bounces-372848-linux-kernel-netdev=dewy.ru@vger.kernel.org; receiver=<UNKNOWN> 
X-Authentication-Results: OpenDMARC; dmarc=pass (p=quarantine dis=none) header.from=kernel.org
X-Received: from sto.lore.kernel.org (sto.lore.kernel.org [172.232.135.74])
	by mail.dewy.ru (Postfix) with ESMTPS id 32584125F60; Fri, 27 Nov 2026 19:30:43 +0300 (MSK)
X-Received: from smtp.subspace.kernel.org (conduit.subspace.kernel.org [100.77.114.92])
	by sto.lore.kernel.org (Postfix) with ESMTP id F12D9604B1B; Fri, 27 Nov 2026 16:30:42 +0000 (UTC)
X-Authentication-Results: smtp.subspace.kernel.org; arc=pass header.oldest-pass=0 smtp.remote-ip=127.0.0.1
X-ARC-Seal: i=2; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=pass;
	t=1795797041;
	b=JPbNGib1V8MJoR8tm1qBUPHbjzOd1jV+AXrS4Z0naGn2SU6zdmzrOY5kDRPwFFSE4W3B
	 URylMh3BGQrhEn1z/LJ5U5rIGLghyyONDpR1fVPbmEzhGZu8/T5oqPS3zFEqNR6OTrQid
	 zWHksKmP6sWPqdCu+Ghjsb5DesUTnrKKKqmKnbo8XNOr8L9yd21HVwa49cvBXY3crBfUB
	 oi/CQNeNfq3eWIddQGEYo9nLR9981Ohxw+ntcHq992zPRWLJtXmhYJLl5b6oqDMToa8Zv
	 iyXN4rf+1yucjs8XwTZYEKgvLsAjg1LMVV90ym5bv8vY5w+e1QpXK/ChQBECPOUWOqg==
X-ARC-Message-Signature: i=2; d=subspace.kernel.org; s=arc20261015;
	a=rsa-sha256; c=relaxed/relaxed; t=1795797041;
	h=X-Original-To:Received:Received:DKIM-Signature:Received:Received:
	 X-ME-Sender:X-ME-Proxy-Cause:X-ME-Proxy:Feedback-ID:Received:X-Mailer:
	 X-Mailing-List:List-Id:List-Post:List-Help:List-Subscribe:
	 List-Unsubscribe:List-Owner:Precedence:MIME-Version:X-ThreadId:Date:
	 From:To:Cc:Message-Id:In-Reply-To:References:Subject:Content-Type:
	 Content-Transfer-Encoding;
	bh=Sw0tp8NDejfGg7X2BMLM/bjCiaduIGwJmfTqzVWl61E=;
	b=nu8pfUuBVbos+IFmMx5KJPvzWM0uQKwFolcJI6Liqs3nQtIiUVRUeRfMSrZbOd3ffzm4
	 MQMlWWDE0L04AmX/Q5qJM2fQTb8Rb2v6bG6NXpDHUGlYqUcuE49SUobUaphTkpUNw2z88
	 HNmAGnFWZj7gzyMqXrI0zBdo6aCW6iNLu9SIjkDT1CraHZwPFeHuQ0hSbsx4Ia/bkNldG
	 y54tV2rn+OoJ8vO+aYu4IsWEEisZXHjyySF9naj+xmwgVodEkMM1jvPp8zfO1Kr6gWeK9
	 Ts2NYAx6Z13oW+ab55uX9UGNJpFcI8kxEBjY89pljNPbR6vBi3Z3FqYXQ2zpyMoNk0w==
X-ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; 
	dkim=pass header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=mghHXH79;
	arc=pass header.oldest-pass=0 smtp.remote-ip=127.0.0.1
X-Received: from localhost.localdomain (localhost [127.0.0.1])
	by smtp.subspace.kernel.org (Postfix) with ESMTP id 53A0A606A31F;
	Fri, 27 Nov 2026 16:30:41 +0000 (UTC)
X-Authentication-Results: smtp.subspace.kernel.org;
	dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=mghHXH79
X-Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=100.103.45.18
X-ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none;
	t=1795797035;
	b=1suE0Yk4JbDyl0qNzKODdWDmoUjpHz1GPXEMRIWUNjPXB8gLJ3BqwFgSkvIO2erZWF4T
	 3YRv2k0nKf09JNK4KUxKNg8NeAxqLR+/85g61drAQCSOfwQTYeTEiSfOmBL/CJ71b4jcL
	 7SWYcTx7KXbYTBhPphZuU/8l2dxkmLjhyiAixuu+zRTtYa0iCOEhioQ3jgLdWUmvraEgI
	 1Gt7Ect0AAC19JRc977urx1Ua1c7fmssHBsJn3qhYHa1JimmB0UnpYMuNyXRB/5Gv5FRM
	 TZDjDQk8fHF5Jn4+WqOfaH7qGXnvZXV7uSaNWaJ0vSWhPM8sriXZHnQe9H9IRab970Q==
X-ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015;
	a=rsa-sha256; c=relaxed/relaxed; t=1795797035;
	h=Received:DKIM-Signature:Received:Received:X-ME-Sender:
	 X-ME-Proxy-Cause:X-ME-Proxy:Feedback-ID:Received:X-Mailer:
	 MIME-Version:X-ThreadId:Date:From:To:Cc:Message-Id:In-Reply-To:
	 References:Subject:Content-Type:Content-Transfer-Encoding;
	bh=Sw0tp8NDejfGg7X2BMLM/bjCiaduIGwJmfTqzVWl61E=;
	b=a5GibqndlyEsS9I4bLhA/2AZeadenAzkfNQDqRNEp8vmJmqrcl2W2fHPwUTNOSAHQvEa
	 7avM/WVXO0b9MvT1kPdC1nIJ19aK6LMprGem6twUX3tIWEmY6vnWq21UvE7vH+YJnQbeX
	 pL5mp0E1qA4RqPBbatgoOU+fCaiiVaPCAerD88AH1dc1ZCuG55D+xzPFKjP8X94TdXXhS
	 j1BgKU29mb3IXnvaBkdcKU2p3tqCXtLjUUC3ESp5d4MtZGP2lKjehxcX9BmHYRmsZKSOV
	 LldFQz0rZKw+3JPqhP+bqrrwUkd+KioyHr/+qembMOWclJxi1aleHxJbW0BPiJbaS+A==
X-ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; 
	dkim=pass header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=mghHXH79;
	arc=none smtp.remote-ip=100.103.45.18
X-Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18])
	(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
	 key-exchange X25519 server-signature ECDSA (prime256v1))
	(No client certificate requested)
	by smtp.subspace.kernel.org (Postfix) with ESMTPS id 70629606A324;
	Fri, 27 Nov 2026 16:30:35 +0000 (UTC)
X-Received: by smtp.kernel.org (Postfix) with ESMTPSA id A38701F0089A;
	Fri, 27 Nov 2026 16:30:33 +0000 (UTC)
X-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org;
	s=k20260515; t=1795797034;
	bh=Sw0tp8NDejfGg7X2BMLM/bjCiaduIGwJmfTqzVWl61E=;
	h=Date:From:To:Cc:In-Reply-To:References:Subject;
	b=mghHXH79DxJD14zUrWcTaPxXHAVc8vhsm5WZmqMEElaOgUzzkbap0YRw97Fns4Bc/
	 jsST1rGi1TC5p7nXNi1WvFcBcQgcutvExdcd1oL+lHRvReu74td4KlKcSY6RoSE1bL
	 jLpvQJPI4u2lgXvBwQIWHOYSaRs1q4YbP413XzWQ0JLYS/bEXvgzuQBrCL5znBiZgK
	 5Fx7gmQPTUG6chOlqNWEAFpsIQMGXKMmxST20xpwFVXZOIHLOOMYVpl7XUgfl6NLyW
	 lhrBr9HDyHPuyDja+KgUSq3Z5rIldITrqmk2mX0vU8z7ekXcHBDVlCwYHhnLYNiKW0
	 DFJgSHe/13O2Q==
X-Received: from phl-compute-10.internal (phl-compute-10.internal [10.202.2.50])
	by mailfauth.phl.internal (Postfix) with ESMTP id DA185F40066;
	Fri, 27 Nov 2026 11:30:32 -0500 (EST)
X-Received: from phl-imap-15 ([10.202.2.104])
  by phl-compute-10.internal (MEProxy); Fri, 27 Nov 2026 11:30:32 -0500
X-ME-Sender: <xms:KLAJayV9S1YvMsnQ1LGCav8NXCjBj8xgQUO-mq3w96-0FZObKiLfqA>
    <xme:KLAJa5ZaPuDYiDfQab55wJTxi8BRN1iXYAYyIdiCc9L01Dy5AA998zTdaEFbK1aGM
    bHaypsvFlmhba2b6dz1AXOuYFRXDko_Pgoiru_IikrCY_W43uEqz38x>
X-ME-Proxy-Cause: dmFkZTEQYo7d31CaQQDpLnR4G7vJ+9syIEHphpomb/uGssUZqpOqMQ32iGMPTc9KW/2l2Y
    Cq0tkdZOuWVuNsLi7DyAFvPT9nOE9wa3InXGuOuQBGaBQ8uDsWJ7tTmpVb/ZmKRyQLBSVr
    YUZ2EUX+JT5M+a9K2Crbgfu8YTE9Rqdx4gRQmu7T+ns9jBiLlRBY8eowZTFj+vTLal8kS0
    iX0vVv9kwO3P9cmi4quZ4AEwQo+nA//IEG/IJS6RX8Q3S2Bc/rtlwyACYY926bPR3Z4S7y
    okXqDJUQz+3H1cbeuVW0hdyz1wBhhK/DTHxWjT0BhiIqFRD3A4DkztJXW6OCmIeGcl/JJY
    f5Eopi/1cOm/+QXjeqX521u3ULZeRJogvbjX6U7W1ztFEf5AQipL6unWQQ+w8IV7LUxF9v
    1L2Ds8nn5XLfRUfiX+qm0qLICsq+d8JAlE8ZG3h3mEGiHEQDtOaXkhBPhPR/rCU2BK7L+D
    9h1yx8lSkAvWemetZCSRwMrMxz/IAB626OYRvD4V1jzZkp/V2ho9hOQgBdBJYu5hjT8yHe
    Ri5Ix+1RLMdK6oEPgSAkwH1ZXcKjZ9vMB4MQZA3VKTsSdDVQk5H7NLBtCt17ynumjr3xNM
    RaUbsrs2rev95OP9YY6/qG1K0dQ0PozayI0kmEerWOV0iKCShlOVI5T8WAOg
X-ME-Proxy: <xmx:KLAJa5Xt4J0cWCv85OOevdKrAVU9UeRpbR_f7bnnW_4sNhNyTjbsrQ>
    <xmx:KLAJa-f55YsBqF4Vl2sdxI9rxFXC_nxuIgCfTHoNoNYp19_k8P2xHA>
    <xmx:KLAJay8CkTrUINgwQD7M4L5nPVUg4kw0NpV9Nol46zQKFOgJweAJdg>
    <xmx:KLAJa-b3qgnDvJXrzGj17TcNhjdfVMcXCqV4yESED8_z0q0JcJCwgQ>
    <xmx:KLAJayuK1FDjqbq7shMocOFxoI_R41bbZVIy0OoUR-TaL_b-1rAT43bf>
X-Feedback-ID: ifa6e4810:Fastmail
X-Received: by mailuser.phl.internal (Postfix, from userid 501)
	id A4EA1780070; Fri, 27 Nov 2026 11:30:32 -0500 (EST)
X-Mailer: MessagingEngine.com Webmail Interface
X-Mailing-List: netdev@vger.kernel.org
X-List-Post: <mailto:netdev@vger.kernel.org>
X-List-Help: <mailto:netdev+help@vger.kernel.org>
X-List-Subscribe: <mailto:netdev+subscribe@vger.kernel.org>
X-List-Unsubscribe: <mailto:netdev+unsubscribe@vger.kernel.org>
X-List-Owner: <mailto:netdev+owner@vger.kernel.org>
X-Precedence: list
X-ThreadId: A8Z6fJDuAPLk
X-Cc: "Donald Hunter" <donald.hunter@gmail.com>,
 "David S. Miller" <davem@davemloft.net>, "Paolo Abeni" <pabeni@redhat.com>,
 "Simon Horman" <horms@kernel.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>,
 "Jeff Layton" <jlayton@kernel.org>, NeilBrown <neil@brown.name>,
 "Olga Kornievskaia" <okorniev@redhat.com>, "Dai Ngo" <Dai.Ngo@oracle.com>,
 "Tom Talpey" <tom@talpey.com>, "Eric Dumazet" <edumazet@kernel.org>,
 kernel-tls-handshake@lists.linux.dev, netdev@vger.kernel.org,
 linux-nvme@lists.infradead.org, linux-nfs@vger.kernel.org,
 "Hannes Reinecke" <hare@kernel.org>
X-In-Reply-To: <20261121161302.69f202c8@kernel.org>