summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJakub Kicinski <kuba@kernel.org>2026-09-04 12:04:09 -0700
committerJakub Kicinski <kuba@kernel.org>2026-09-09 13:52:44 -0700
commitf5134d734770e657ba75d59645a54af362ef556f (patch)
tree802c747bdc0a64e75956e3f5ba4707519d61cac2
parentea8cc4480f3153c6466e2c910c84e67588c89af4 (diff)
downloadlinux-next-f5134d734770e657ba75d59645a54af362ef556f.tar.gz
linux-next-f5134d734770e657ba75d59645a54af362ef556f.zip
netlink: specs: handshake: type the remaining key serials s32
include/linux/key.h has "typedef int32_t key_serial_t" and commit 160f404495aa ("handshake: Fix sign of key_serial_t fields") converted x509.cert and x509.privkey to s32, but accept.peer-identity, accept.keyring and done.remote-auth were left as u32 - the same quantity typed both ways inside one family, and a generated user space struct with __s32 cert next to __u32 keyring. All three come from key_serial_t storage in net/handshake/tlshd.c (treq->th_peerid[], treq->th_keyring), and special keyrings are legitimately negative (KEY_SPEC_PROCESS_KEYRING is -2). NLA_U32 and NLA_S32 have the same length and no range check here, so the only wire effect is how the value is printed. Acked-by: Chuck Lever <cel@kernel.org> Reviewed-by: Asbjørn Sloth Tønnesen <ast@fiberby.net> Link: https://patch.msgid.link/20260904190410.3864660-1-kuba@kernel.org Signed-off-by: Jakub Kicinski <kuba@kernel.org>
-rw-r--r--Documentation/netlink/specs/handshake.yaml6
-rw-r--r--net/handshake/genl.c2
2 files changed, 4 insertions, 4 deletions
diff --git a/Documentation/netlink/specs/handshake.yaml b/Documentation/netlink/specs/handshake.yaml
index ffec12b46759..9ab46da04c49 100644
--- a/Documentation/netlink/specs/handshake.yaml
+++ b/Documentation/netlink/specs/handshake.yaml
@@ -67,7 +67,7 @@ attribute-sets:
enum: auth
-
name: peer-identity
- type: u32
+ type: s32
multi-attr: true
-
name: certificate
@@ -79,7 +79,7 @@ attribute-sets:
type: string
-
name: keyring
- type: u32
+ type: s32
-
name: done
attributes:
@@ -93,7 +93,7 @@ attribute-sets:
type: s32
-
name: remote-auth
- type: u32
+ type: s32
multi-attr: true
operations:
diff --git a/net/handshake/genl.c b/net/handshake/genl.c
index feac1ad063ee..58606c2a4600 100644
--- a/net/handshake/genl.c
+++ b/net/handshake/genl.c
@@ -21,7 +21,7 @@ static const struct nla_policy handshake_accept_nl_policy[HANDSHAKE_A_ACCEPT_HAN
static const struct nla_policy handshake_done_nl_policy[HANDSHAKE_A_DONE_REMOTE_AUTH + 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_U32, },
+ [HANDSHAKE_A_DONE_REMOTE_AUTH] = { .type = NLA_S32, },
};
/* Ops table for handshake */