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 043951E9B3D; Mon, 13 Apr 2026 16:15:29 +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=1776096929; cv=none; b=JhovwmsmYcAO5deYBGiBxJI7jchY/4n7Gm8aWIbAPnqQCoDJhFERaYTZY//YDBOvxljqVNbwEFKiiN3wz7tvamoR8LXZp50UTDuYvuFLjljGVEFwKaFA2jlFx3nfYB8PSoTWPd0PrSbdrKd3kdU1tfCq5WX6SdxCoPnI16tnUlk= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1776096929; c=relaxed/simple; bh=Xkb/Yoc71Tj1J7PHCI8bVD7h+sVUNQYjEsDHRDXU7+0=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=JOzzcxFyko8HpigmELQApPJhZh3CBwQsGCwADhLvbQChsVYum8mVogJw0FhobVjTm5MphDPOlK8wocej/AZKPwM+l/oqJCMYt6CSkVoK/iXVV93TD6KUGW3ilA2DjcQ7VCa6aMuX/6Cy8cto9Xh8Tqg5kAPPG9o+8+qGgUrhCdI= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=l6owg/52; 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="l6owg/52" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 655DAC2BCAF; Mon, 13 Apr 2026 16:15:28 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1776096928; bh=Xkb/Yoc71Tj1J7PHCI8bVD7h+sVUNQYjEsDHRDXU7+0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=l6owg/527WtbMXx0CJaC6JTX8T137WbC2/S5+8KgfU1PmJA0KbId8kGOpVO8MHZ8o jPqHOiFv15JBWfzCnFiNrpfMy7gJd9dmpPEdLtaSYf4Crg6Il0H9fkMuXoG9GPF080 zfWI2I88BORbGIgb9Wak4wq/6AHtINhnDLbS4/mw= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Yifan Wu , Juefei Pu , Yuan Tan , Xin Liu , Ren Wei , Luxiao Xu , Ren Wei , David Howells , Marc Dionne , Simon Horman , linux-afs@lists.infradead.org, stable@kernel.org, Jakub Kicinski Subject: [PATCH 6.6 47/50] rxrpc: fix reference count leak in rxrpc_server_keyring() Date: Mon, 13 Apr 2026 18:01:14 +0200 Message-ID: <20260413155726.267702433@linuxfoundation.org> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20260413155724.497323914@linuxfoundation.org> References: <20260413155724.497323914@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.6-stable review patch. If anyone has any objections, please let me know. ------------------ From: Luxiao Xu commit f125846ee79fcae537a964ce66494e96fa54a6de upstream. This patch fixes a reference count leak in rxrpc_server_keyring() by checking if rx->securities is already set. Fixes: 17926a79320a ("[AF_RXRPC]: Provide secure RxRPC sockets for use by userspace and kernel both") Reported-by: Yifan Wu Reported-by: Juefei Pu Co-developed-by: Yuan Tan Signed-off-by: Yuan Tan Suggested-by: Xin Liu Tested-by: Ren Wei Signed-off-by: Luxiao Xu Signed-off-by: Ren Wei Signed-off-by: David Howells cc: Marc Dionne cc: Simon Horman cc: linux-afs@lists.infradead.org cc: stable@kernel.org Link: https://patch.msgid.link/20260408121252.2249051-15-dhowells@redhat.com Signed-off-by: Jakub Kicinski Signed-off-by: Greg Kroah-Hartman --- net/rxrpc/server_key.c | 3 +++ 1 file changed, 3 insertions(+) --- a/net/rxrpc/server_key.c +++ b/net/rxrpc/server_key.c @@ -125,6 +125,9 @@ int rxrpc_server_keyring(struct rxrpc_so _enter(""); + if (rx->securities) + return -EINVAL; + if (optlen <= 0 || optlen > PAGE_SIZE - 1) return -EINVAL;