[PATCH net-next v3 10/10] NFSD: Add allow_tags to the netlink export interface
sashiko-bot at kernel.org
sashiko-bot at kernel.org
Sat Nov 14 11:22:56 PST 2026
Thank you for your contribution! Sashiko AI review found 1 potential
issue to consider:
- [Medium] nfsd: NLA_STRING policy in fs/nfsd/netlink.c disagrees with
nfsd.yaml
--
commit 9462d94731ddc9a3ecf082d3129a435c7feed8da
Author: Chuck Lever <cel at kernel.org>
NFSD: Add allow_tags to the netlink export interface
This commit adds the allow-tags attribute to the NFSD svc-export netlink
interface, parses and validates session tags in nfsd_nl_parse_one_export(),
and reports validation errors through the netlink extended ACK.
> diff --git a/Documentation/netlink/specs/nfsd.yaml b/Documentation/netlink/specs/nfsd.yaml
> index 9ae37bf3ea717..e58856b34b020 100644
> --- a/Documentation/netlink/specs/nfsd.yaml
> +++ b/Documentation/netlink/specs/nfsd.yaml
[ ... ]
> @@ -297,6 +301,12 @@ attribute-sets:
> -
> name: fsid
> type: s32
> + -
> + name: allow-tags
> + type: string
> + checks:
> + max-len: handshake-session-tag-max-len
> + multi-attr: true
[ ... ]
> diff --git a/fs/nfsd/netlink.c b/fs/nfsd/netlink.c
> index 88a4a4ffcb7fd..146c655757410 100644
> --- a/fs/nfsd/netlink.c
> +++ b/fs/nfsd/netlink.c
[ ... ]
> @@ -55,6 +56,7 @@ const struct nla_policy nfsd_svc_export_nl_policy[NFSD_A_SVC_EXPORT_FSID + 1] =
> [NFSD_A_SVC_EXPORT_XPRTSEC] = NLA_POLICY_MASK(NLA_U32, 0x7),
> [NFSD_A_SVC_EXPORT_FLAGS] = NLA_POLICY_MASK(NLA_U32, 0x3ffff),
> [NFSD_A_SVC_EXPORT_FSID] = { .type = NLA_S32, },
> + [NFSD_A_SVC_EXPORT_ALLOW_TAGS] = { .type = NLA_STRING, .len = HANDSHAKE_SESSION_TAG_MAX_LEN, },
> };
[Severity: Medium]
Should nfsd_svc_export_nl_policy[NFSD_A_SVC_EXPORT_ALLOW_TAGS] match the
NLA_NUL_STRING policy generated from Documentation/netlink/specs/nfsd.yaml?
fs/nfsd/netlink.c is generated by tools/net/ynl/ynl-regen.sh, which emits
NLA_NUL_STRING for string attributes without unterminated-ok:
tools/net/ynl/pyynl/ynl_gen_c.py:TypeString.attr_policy()
if self.checks.get('unterminated-ok', False):
policy = 'NLA_STRING'
else:
policy = 'NLA_NUL_STRING'
Because fs/nfsd/netlink.c was edited to use NLA_STRING here, running
ynl-regen.sh will overwrite it with NLA_NUL_STRING and silently change the
kernel uAPI validation policy to reject non-NUL-terminated tag payloads.
--
Sashiko AI review · https://sashiko.dev/#/patchset/20261113-tls-session-tags-v3-0-91271964cdb0@kernel.org?part=10
More information about the Linux-nvme
mailing list