From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-alma10-1.taild15c8.ts.net [100.103.45.18]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 99C36415F0E; Tue, 21 Jul 2026 19:29:53 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=100.103.45.18 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1784662194; cv=none; b=XG6V224Z4I7a+Yp/RAnRc+Ew3gzBaFUpJUnNTal7JO1bljVuzjSpd/Y1uNQf4cKIBofPxai5WzV6UX1gYc50tTwmIyK3EzVX1bDGHvuFeU9zMtQxnmSvvXUAqL94DMJFe7Ba+QtziQpMFdmqnUEhbW7WLrsOkbcgLVPlIWCMF+Y= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1784662194; c=relaxed/simple; bh=anWFCwObqOolIpTbZ8YdjospFjCW3wRjNtUi8CiyFbI=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=SgTNxQFMg+tcN+dJLaT7lR5Ov5g8DKAT3LsO2ZlECv7qNM5kpopxzhT9adLvRjSFniGC86CYwriulmeqpTUgeXUsGVs+vR/DTw5GeIYZCk+S1pCrFUtuCQ9hjFAtW5zYAmSrc2WQpG0LJ2bg+0MMUmshLWebhXuyVq8IqqlrCb8= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=OJzckI8f; arc=none smtp.client-ip=100.103.45.18 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="OJzckI8f" Received: by smtp.kernel.org (Postfix) with ESMTPSA id B4F331F000E9; Tue, 21 Jul 2026 19:29:52 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=korg; t=1784662193; bh=CzV2PVkK7fBlcszqUKsNEQlsT64FO64FrcIPrvwYYSk=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=OJzckI8fG3kYNTZC9ukDmokepL5PoSEGn6EY1fOlyK00GubrLQwaExDi31BF/NPuS 8z5W6GqbZnwYsOh27R2NK6HPkAKLITebDR7/D+UGZe4e6u1mxBfj3in2+MaWH/G/XE t/Wyuhs7XZKl8e4Q0g8NaLXKSmBxnOmS6NvoVaJY= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Jeff Layton , Hannes Reinecke , Chuck Lever , Jakub Kicinski , Sasha Levin Subject: [PATCH 6.12 0351/1276] handshake: Require admin permission for DONE command Date: Tue, 21 Jul 2026 17:13:14 +0200 Message-ID: <20260721152453.967630109@linuxfoundation.org> X-Mailer: git-send-email 2.55.0 In-Reply-To: <20260721152446.065700225@linuxfoundation.org> References: <20260721152446.065700225@linuxfoundation.org> User-Agent: quilt/0.69 X-stable: review X-Patchwork-Hint: ignore Precedence: bulk X-Mailing-List: patches@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 6.12-stable review patch. If anyone has any objections, please let me know. ------------------ From: Chuck Lever [ Upstream commit 81246a65303d9635266b1334490142caaf86a11f ] 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: 3b3009ea8abb ("net/handshake: Create a NETLINK service for handling handshake requests") Reviewed-by: Jeff Layton Reviewed-by: Hannes Reinecke Signed-off-by: Chuck Lever Link: https://patch.msgid.link/20260609141831.90694-1-cel@kernel.org Signed-off-by: Jakub Kicinski Signed-off-by: Sasha Levin --- Documentation/netlink/specs/handshake.yaml | 1 + net/handshake/genl.c | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/Documentation/netlink/specs/handshake.yaml b/Documentation/netlink/specs/handshake.yaml index 090fc11da4604a..4edaf9c7143988 100644 --- a/Documentation/netlink/specs/handshake.yaml +++ b/Documentation/netlink/specs/handshake.yaml @@ -121,6 +121,7 @@ operations: name: done doc: Handler reports handshake completion attribute-set: done + flags: [admin-perm] do: request: attributes: diff --git a/net/handshake/genl.c b/net/handshake/genl.c index a5fa8b27f22423..7ec805ae3d7d6f 100644 --- a/net/handshake/genl.c +++ b/net/handshake/genl.c @@ -37,7 +37,7 @@ static const struct genl_split_ops handshake_nl_ops[] = { .doit = handshake_nl_done_doit, .policy = handshake_done_nl_policy, .maxattr = HANDSHAKE_A_DONE_REMOTE_AUTH, - .flags = GENL_CMD_CAP_DO, + .flags = GENL_ADMIN_PERM | GENL_CMD_CAP_DO, }, }; -- 2.53.0