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 72EBDBA3D for ; Tue, 14 Apr 2026 00:17: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=1776125879; cv=none; b=OckUPvDoYGzQMCw+5mGrfUMDOaut9UnHnUCKJOSPVkQ7DpMCkfFc//yskRBKeObOOhZWWvln0wDutTLYrLm4QU/Ul2bme2oh7R9npGUqcPmhKP97VtB6nDV2mhAMbTCzja05EbqANnaZwolfb39xd7iMEjg4Yyx+8oQCXfDX1Ss= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1776125879; c=relaxed/simple; bh=DTZUksY6EEFKZLKBt4Suu+f+ObaONVJ8HmiI+1SUrpM=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=ALNRplc4H6z9cNQ5qS80ikno0ZKV5mPV1mIAa2QEogV6XJ8mqKXw/JPSaC+pMJTE7x4gDZa1KKm1YZGX1rLCTbBr5Uc+rQM6gubd1xMt09BQyzLk8dyrx6pKUmvsLUqcgq9iy4sxpRhMtxdi52XSsAYSSc6wLDVo+i0yk4NbR1A= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=M1ViPXz+; 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="M1ViPXz+" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 3B068C2BCAF; Tue, 14 Apr 2026 00:17:58 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1776125879; bh=DTZUksY6EEFKZLKBt4Suu+f+ObaONVJ8HmiI+1SUrpM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=M1ViPXz+/wCfOoK8SY6zsOYzTJ/P9FSfm0xDhOey+csTlQWO/PRsNxZwmcn5cQtpo 1CgZcwAvpVR9lK8lA5a64080KaS6/rzmPP9O5NXZMf/79SFIQIzewbYNqkbMNTKIBc PBRUobZdIK8gBeqShQfU9XuGsdIRAXlxlUlrav3xe791zd31VA0+MMFIzJ9IC8ai25 a0gkT9ILDwHxkoJP0Q5mvi9dyk+7Ae0pAKCOUyBNeBz3WSm/MkgJatt15l3bYXzNjg V+a609UQCG4oaSGteX+/lveyjQXNdMjOQI3XDMXKFXsgL4ud+BZwdzS3jJcdJXmq6c cgzFPar6jnVOA== 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 6.6.y] rxrpc: Fix anonymous key handling Date: Mon, 13 Apr 2026 20:17:56 -0400 Message-ID: <20260414001756.3797211-1-sashal@kernel.org> X-Mailer: git-send-email 2.53.0 In-Reply-To: <2026041310-fox-finished-849e@gregkh> References: <2026041310-fox-finished-849e@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 b9f2f12281b33..6939617afc7bc 100644 --- a/net/rxrpc/sendmsg.c +++ b/net/rxrpc/sendmsg.c @@ -590,7 +590,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