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 8B60B24EA90; Mon, 13 Apr 2026 16:13:07 +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=1776096787; cv=none; b=Rr/eaGOzLqc0BbfbFemBcvg1NtJJxdAvoHjy2FM0qWwLpL/hcJXtwH99w67I58adBh+i25lhfk6z5aVi7EaLqvXYm6PA2+5lmTUueNpusTZHEE8i88YW6PYcLX7rBgkItTmaeOefqSPr60xnsUxwrrnlvurHbspVr4/gpEjb6zM= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1776096787; c=relaxed/simple; bh=desH7iDoSVZ1lptHdtuyIXfLnfbEprumoWawnJ9hc1w=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=kQ8flvp8upXYugL/DfEDr5XM+S1PpSAr1IrlyFXEzg4ryKfvKq6PwZut9Fdsu3RAXGPkaBcZ6zZ5bkyudvMZuZ0h/Ub1SUiW6+Pp2iZ47JIgjtyKrvNe3wtkLN8Xt5Re1do0SENGdAaHhU8Lyiaci/Pq2h9L1kSsHPYowHWbrTQ= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=ssvntpm7; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="ssvntpm7" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 22019C2BCAF; Mon, 13 Apr 2026 16:13:06 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1776096787; bh=desH7iDoSVZ1lptHdtuyIXfLnfbEprumoWawnJ9hc1w=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=ssvntpm7hfWTdtUH8vMvnqmY6a5HCup/znSQsrdAqHazI/7jOeJiMQ9V0D+pHDo2R OHKkGEJIY5HuP/CnchqjAVD2IpVVxbfqkUQ/RBSNIxLELCnXe73oixdK8yshwMEKu1 TIT4HkeFgvTykqKMznAGb30cXJnfBdp311Fjm5Zc= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Anderson Nascimento , David Howells , Jeffrey Altman , Marc Dionne , Simon Horman , linux-afs@lists.infradead.org, stable@kernel.org, Jakub Kicinski Subject: [PATCH 6.12 63/70] rxrpc: Fix key reference count leak from call->key Date: Mon, 13 Apr 2026 18:00:58 +0200 Message-ID: <20260413155730.531205097@linuxfoundation.org> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20260413155728.181580293@linuxfoundation.org> References: <20260413155728.181580293@linuxfoundation.org> User-Agent: quilt/0.69 X-stable: review X-Patchwork-Hint: ignore Precedence: bulk X-Mailing-List: stable@vger.kernel.org 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: Anderson Nascimento commit d666540d217e8d420544ebdfbadeedd623562733 upstream. When creating a client call in rxrpc_alloc_client_call(), the code obtains a reference to the key. This is never cleaned up and gets leaked when the call is destroyed. Fix this by freeing call->key in rxrpc_destroy_call(). Before the patch, it shows the key reference counter elevated: $ cat /proc/keys | grep afs@54321 1bffe9cd I--Q--i 8053480 4169w 3b010000 1000 1000 rxrpc afs@54321: ka $ After the patch, the invalidated key is removed when the code exits: $ cat /proc/keys | grep afs@54321 $ Fixes: f3441d4125fc ("rxrpc: Copy client call parameters into rxrpc_call earlier") Signed-off-by: Anderson Nascimento Co-developed-by: David Howells Signed-off-by: David Howells Reviewed-by: Jeffrey Altman cc: Marc Dionne cc: Simon Horman cc: linux-afs@lists.infradead.org cc: stable@kernel.org Link: https://patch.msgid.link/20260408121252.2249051-9-dhowells@redhat.com Signed-off-by: Jakub Kicinski Signed-off-by: Greg Kroah-Hartman --- net/rxrpc/call_object.c | 1 + 1 file changed, 1 insertion(+) --- a/net/rxrpc/call_object.c +++ b/net/rxrpc/call_object.c @@ -690,6 +690,7 @@ static void rxrpc_destroy_call(struct wo rxrpc_put_bundle(call->bundle, rxrpc_bundle_put_call); rxrpc_put_peer(call->peer, rxrpc_peer_put_call); rxrpc_put_local(call->local, rxrpc_local_put_call); + key_put(call->key); call_rcu(&call->rcu, rxrpc_rcu_free_call); }