From 0fa13b71c3303cc5fbb75ae215ccf2dec7efe19a Mon Sep 17 00:00:00 2001 From: Jakub Kicinski Date: Tue, 15 Sep 2026 19:15:15 -0700 Subject: [PATCH] netlink: specs: nlctrl: fix the policy attribute numbering mask and pad are declared the wrong way round, giving mask 11 and pad 12, while enum netlink_policy_type_attr has NL_POLICY_TYPE_ATTR_PAD at 11 and NL_POLICY_TYPE_ATTR_MASK at 12. The kernel emits the mask for every NLA_POLICY_MASK() attribute, so a Python YNL client parsing a policy dump maps it onto pad and throws it away - 30 of them in ethtool's policy alone. In the other direction the 64-bit alignment padding, which the kernel does emit on architectures without efficient unaligned access, is decoded as a u64 mask and blows up the whole dump. But those architectures are rare. The generated C parser is not affected, it keys the attributes off the uAPI symbol names rather than off the values the spec derives. Reviewed-by: Donald Hunter Link: https://patch.msgid.link/20260916021516.1701760-1-kuba@kernel.org Signed-off-by: Jakub Kicinski --- Documentation/netlink/specs/nlctrl.yaml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Documentation/netlink/specs/nlctrl.yaml b/Documentation/netlink/specs/nlctrl.yaml index 7e7c158e3e73..6acac4aeab03 100644 --- a/Documentation/netlink/specs/nlctrl.yaml +++ b/Documentation/netlink/specs/nlctrl.yaml @@ -156,12 +156,12 @@ attribute-sets: - name: bitfield32-mask type: u32 - - - name: mask - type: u64 - name: pad type: pad + - + name: mask + type: u64 - name: byte-order doc: Byte order of the attribute, absent means host byte order.