From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (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 8791019ABC6 for ; Tue, 14 Apr 2026 00:36:59 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1776127019; cv=none; b=R2dwxVzkQWGS9kXRKAg9XXPFOt6eKcVTz6pTv8gBqDG5jmKbC/4Cynrij44jKoqR2Isz+wXXNJdoHukmlJwav71iGXTrpglycoNnRh8ZOp/8zwgFZaXZwwHdInWN/z4QALn1v/liHIj1hKSNiQ+gQdgNA2w4JPGKk9kmmSzUZQA= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1776127019; c=relaxed/simple; bh=Y/hMCEVr7NR8VAN6n0eJihV0Hi0DNVigCnyhzvu6OiA=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=kMFTCnT6M56ybx1xyvVRwdsO+jWzQqqCvGhXThJaEh3V3rYltRPDgSxGNqjzuuazcEyaSNpo7vtsUYnpTyw8TjBNGF7BYpZuMej46OT6cyLoZdgtxLtMkikpnkw08qkShnGSvoxXopxL/YE3aqXZbkrjj4jLSrmdF6sCZ4L9Vak= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=QZPvs/i/; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="QZPvs/i/" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 300A7C2BCAF; Tue, 14 Apr 2026 00:36:58 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1776127019; bh=Y/hMCEVr7NR8VAN6n0eJihV0Hi0DNVigCnyhzvu6OiA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=QZPvs/i/It97AUoCNfPy3OVGYaAYuqQ0jyhfNKyJO1yT9a3GyoqtM1Mi8mKuj5Dv4 r0nJdcjLeJzVG0ZHftgFPRyEIlA2YZ29AGUMogQu0TBeMDFp8inkuBnFgdoyiBJgJy Z5wEEPT3ofqH0hJVNzeJBCItDkMJY45LoNPy7leSb8g/FCZYM7jJIABr4s5LgWVu2a qmaf4RWhPdFWpJuIKdsU/+MUZ+mieog3rbkxc7UfPyLb+n+vvTKAFu9EH/gX6CAAcN tMPP/yX6qyZoUeDgDM5tic5ta37ntnsUuDNtuP6J7fPx+BvpICJxmZnpY+nDtpXRYn z3Ayla+b7g+3Q== From: Sasha Levin To: stable@vger.kernel.org Cc: David Howells , Marc Dionne , Jeffrey Altman , Simon Horman , linux-afs@lists.infradead.org, stable@kernel.org, Jakub Kicinski , Sasha Levin Subject: [PATCH 5.10.y] rxrpc: Fix anonymous key handling Date: Mon, 13 Apr 2026 20:36:56 -0400 Message-ID: <20260414003656.3806621-1-sashal@kernel.org> X-Mailer: git-send-email 2.53.0 In-Reply-To: <2026041312-iphone-tattoo-12b6@gregkh> References: <2026041312-iphone-tattoo-12b6@gregkh> Precedence: bulk X-Mailing-List: stable@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit From: David Howells [ Upstream commit 6a59d84b4fc2f27f7b40e348506cc686712e260b ] In rxrpc_new_client_call_for_sendmsg(), a key with no payload is meant to be substituted for a NULL key pointer, but the variable this is done with is subsequently not used. Fix this by using "key" rather than "rx->key" when filling in the connection parameters. Note that this only affects direct use of AF_RXRPC; the kAFS filesystem doesn't use sendmsg() directly and so bypasses the issue. Further, AF_RXRPC passes a NULL key in if no key is set, so using an anonymous key in that manner works. Since this hasn't been noticed to this point, it might be better just to remove the "key" variable and the code that sets it - and, arguably, rxrpc_init_client_call_security() would be a better place to handle it. Fixes: 19ffa01c9c45 ("rxrpc: Use structs to hold connection params and protocol info") Closes: https://sashiko.dev/#/patchset/20260319150150.4189381-1-dhowells%40redhat.com Signed-off-by: David Howells cc: Marc Dionne cc: Jeffrey Altman cc: Simon Horman cc: linux-afs@lists.infradead.org cc: stable@kernel.org Link: https://patch.msgid.link/20260408121252.2249051-4-dhowells@redhat.com Signed-off-by: Jakub Kicinski Signed-off-by: Sasha Levin --- net/rxrpc/sendmsg.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/net/rxrpc/sendmsg.c b/net/rxrpc/sendmsg.c index 1882fea719035..0b24d09637252 100644 --- a/net/rxrpc/sendmsg.c +++ b/net/rxrpc/sendmsg.c @@ -641,7 +641,7 @@ rxrpc_new_client_call_for_sendmsg(struct rxrpc_sock *rx, struct msghdr *msg, memset(&cp, 0, sizeof(cp)); cp.local = rx->local; - cp.key = rx->key; + cp.key = key; cp.security_level = rx->min_sec_level; cp.exclusive = rx->exclusive | p->exclusive; cp.upgrade = p->upgrade; -- 2.53.0