Skip to content

Commit 25fb53e

Browse files
chucklevergregkh
authored andcommitted
handshake: Require admin permission for DONE command
[ Upstream commit 81246a6 ] ACCEPT and DONE are the two downcalls of the handshake genl family, both intended for use by the trusted handshake agent (tlshd). ACCEPT already requires GENL_ADMIN_PERM; DONE has no privilege check at all. The fd-lookup in handshake_nl_done_doit() only confirms that some pending handshake request exists for the supplied sockfd; it does not authenticate the sender. An unprivileged process that guesses or observes a valid sockfd can therefore submit a DONE with HANDSHAKE_A_DONE_STATUS == 0, leaving the kernel consumer to proceed as if the handshake succeeded. A non-zero status on a forged DONE tears down a legitimate in-flight handshake before tlshd can report its real result. Fixes: 3b3009e ("net/handshake: Create a NETLINK service for handling handshake requests") Reviewed-by: Jeff Layton <jlayton@kernel.org> Reviewed-by: Hannes Reinecke <hare@kernel.org> Signed-off-by: Chuck Lever <chuck.lever@oracle.com> Link: https://patch.msgid.link/20260609141831.90694-1-cel@kernel.org Signed-off-by: Jakub Kicinski <kuba@kernel.org> Signed-off-by: Sasha Levin <sashal@kernel.org>
1 parent 23a29ee commit 25fb53e

2 files changed

Lines changed: 2 additions & 1 deletion

File tree

Documentation/netlink/specs/handshake.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -113,6 +113,7 @@ operations:
113113
name: done
114114
doc: Handler reports handshake completion
115115
attribute-set: done
116+
flags: [admin-perm]
116117
do:
117118
request:
118119
attributes:

net/handshake/genl.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ static const struct genl_split_ops handshake_nl_ops[] = {
3636
.doit = handshake_nl_done_doit,
3737
.policy = handshake_done_nl_policy,
3838
.maxattr = HANDSHAKE_A_DONE_REMOTE_AUTH,
39-
.flags = GENL_CMD_CAP_DO,
39+
.flags = GENL_ADMIN_PERM | GENL_CMD_CAP_DO,
4040
},
4141
};
4242

0 commit comments

Comments
 (0)