summaryrefslogtreecommitdiff
path: root/net/handshake/tlshd.c
diff options
context:
space:
mode:
authorChuck Lever <chuck.lever@oracle.com>2023-09-21 09:07:40 -0400
committerJakub Kicinski <kuba@kernel.org>2023-10-02 12:34:21 -0700
commita6b07a51b161ba1ad3d81919955fe77b697f9d48 (patch)
tree69b5a338fb249d8f73322b1824c2e335da11af8b /net/handshake/tlshd.c
parentaf54c197a90b804b57eb7ae4256aaeb5c46216c5 (diff)
handshake: Fix sign of socket file descriptor fields
Socket file descriptors are signed integers. Use nla_get/put_s32 for those to avoid implicit signed conversion in the netlink protocol. Signed-off-by: Chuck Lever <chuck.lever@oracle.com> Reviewed-by: Simon Horman <horms@kernel.org> Link: https://lore.kernel.org/r/169530165057.8905.8650469415145814828.stgit@oracle-102.nfsv4bat.org Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Diffstat (limited to 'net/handshake/tlshd.c')
-rw-r--r--net/handshake/tlshd.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/net/handshake/tlshd.c b/net/handshake/tlshd.c
index bbfb4095ddd6..7ac80201aa1f 100644
--- a/net/handshake/tlshd.c
+++ b/net/handshake/tlshd.c
@@ -214,7 +214,7 @@ static int tls_handshake_accept(struct handshake_req *req,
goto out_cancel;
ret = -EMSGSIZE;
- ret = nla_put_u32(msg, HANDSHAKE_A_ACCEPT_SOCKFD, fd);
+ ret = nla_put_s32(msg, HANDSHAKE_A_ACCEPT_SOCKFD, fd);
if (ret < 0)
goto out_cancel;
ret = nla_put_u32(msg, HANDSHAKE_A_ACCEPT_MESSAGE_TYPE, treq->th_type);