From: sashiko-bot@kernel.org
To: "Chuck Lever" <cel@kernel.org>
Cc: linux-nvme@lists.infradead.org,
"Jeff Layton" <jlayton@kernel.org>,
"Anna Schumaker" <anna@kernel.org>
Subject: Re: [PATCH net-next v3 01/10] handshake: Add tags to "done" downcall
Date: Sat, 14 Nov 2026 19:22:48 +0000 [thread overview]
Message-ID: <sashiko-outbox-214957@kernel.org> (raw)
In-Reply-To: <20261113-tls-session-tags-v3-1-91271964cdb0@kernel.org>
Thank you for your contribution! Sashiko AI review found 1 potential
issue to consider:
- [Medium] handshake: HANDSHAKE_A_DONE_TAG uses NLA_STRING instead of
NLA_NUL_STRING
--
commit 686d8603f3072dc2bd0a821dcea3a0351fd8b262
Author: Chuck Lever <cel@kernel.org>
handshake: Add tags to "done" downcall
This commit adds the HANDSHAKE_A_DONE_TAG netlink attribute to the
handshake "done" downcall so userspace agents can return session tags to
the kernel.
> diff --git a/Documentation/netlink/specs/handshake.yaml b/Documentation/netlink/specs/handshake.yaml
> index 0498ada2dd97a..17521b159e893 100644
> --- a/Documentation/netlink/specs/handshake.yaml
> +++ b/Documentation/netlink/specs/handshake.yaml
[ ... ]
> @@ -96,6 +100,16 @@ attribute-sets:
> name: remote-auth
> type: s32
> multi-attr: true
> + -
> + name: tag
> + type: string
> + doc: >-
> + A tag the handshake agent assigns to this handshake. The
> + payload may omit the trailing NUL. An embedded NUL is
> + rejected.
> + checks:
> + max-len: session-tag-max-len
> + multi-attr: true
[ ... ]
> diff --git a/net/handshake/genl.c b/net/handshake/genl.c
> index 26e3efec64ca7..7150b32a54c45 100644
> --- a/net/handshake/genl.c
> +++ b/net/handshake/genl.c
> @@ -18,10 +18,11 @@ static const struct nla_policy handshake_accept_nl_policy[HANDSHAKE_A_ACCEPT_HAN
> };
>
> /* HANDSHAKE_CMD_DONE - do */
> -static const struct nla_policy handshake_done_nl_policy[HANDSHAKE_A_DONE_REMOTE_AUTH + 1] = {
> +static const struct nla_policy handshake_done_nl_policy[HANDSHAKE_A_DONE_TAG + 1] = {
> [HANDSHAKE_A_DONE_STATUS] = NLA_POLICY_MAX(NLA_U32, MAX_ERRNO),
> [HANDSHAKE_A_DONE_SOCKFD] = { .type = NLA_S32, },
> [HANDSHAKE_A_DONE_REMOTE_AUTH] = { .type = NLA_S32, },
> + [HANDSHAKE_A_DONE_TAG] = { .type = NLA_STRING, .len = HANDSHAKE_SESSION_TAG_MAX_LEN, },
> };
[Severity: Medium]
Should HANDSHAKE_A_DONE_TAG require NUL termination with NLA_NUL_STRING
instead of NLA_STRING?
In non-legacy genetlink specifications, string attributes are required to
be NUL-terminated. Here, tools/net/ynl/pyynl/ynl_gen_c.py emitted
NLA_STRING only because TypeMultiAttr inherits Type.attr_policy() and
delegates _attr_policy() instead of attr_policy(), bypassing
TypeString.attr_policy():
tools/net/ynl/pyynl/ynl_gen_c.py:TypeMultiAttr._attr_policy() {
def _attr_policy(self, policy):
return self.base_type._attr_policy(policy)
}
Documenting in handshake.yaml that the payload may omit the trailing NUL
bakes this generator quirk into the uAPI: if TypeMultiAttr is later fixed
to emit NLA_NUL_STRING for multi-attr strings, regenerating the policy
with tools/net/ynl/ynl-regen.sh will break userspace agents that omit the
trailing NUL.
--
Sashiko AI review · https://sashiko.dev/#/patchset/20261113-tls-session-tags-v3-0-91271964cdb0@kernel.org?part=1
next prev parent reply other threads:[~2026-11-14 19:23 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-13 19:21 [PATCH net-next v3 00/10] Deliver TLS session tags to upper-layer consumers (NFSD) Chuck Lever
2026-11-13 19:21 ` [PATCH net-next v3 01/10] handshake: Add tags to "done" downcall Chuck Lever
2026-11-14 19:22 ` sashiko-bot [this message]
2026-11-13 19:22 ` [PATCH net-next v3 02/10] lib: Add a "stringset" data structure Chuck Lever
2026-11-13 19:22 ` [PATCH net-next v3 03/10] lib: Add KUnit tests for the stringset " Chuck Lever
2026-11-13 19:22 ` [PATCH net-next v3 04/10] handshake: Add a session-tags argument to the TLS done callback Chuck Lever
2026-11-13 19:22 ` [PATCH net-next v3 05/10] handshake: Pick up session tags passed during the DONE downcall Chuck Lever
2026-11-13 19:22 ` [PATCH net-next v3 06/10] handshake: Add a kunit test for the completion gate Chuck Lever
2026-11-13 19:22 ` [PATCH net-next v3 07/10] handshake: Advertise the session-tag cap to user space Chuck Lever
2026-11-13 19:22 ` [PATCH net-next v3 08/10] SUNRPC: Copy the TLS session tags when they are available Chuck Lever
2026-11-13 19:22 ` [PATCH net-next v3 09/10] NFSD: Implement export tagging Chuck Lever
2026-11-13 19:22 ` [PATCH net-next v3 10/10] NFSD: Add allow_tags to the netlink export interface Chuck Lever
2026-11-14 19:22 ` sashiko-bot
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=sashiko-outbox-214957@kernel.org \
--to=sashiko-bot@kernel.org \
--cc=anna@kernel.org \
--cc=cel@kernel.org \
--cc=jlayton@kernel.org \
--cc=linux-nvme@lists.infradead.org \
--cc=sashiko-reviews@lists.linux.dev \
/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