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 4249F24E4AF; Mon, 13 Apr 2026 16:13:15 +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=1776096795; cv=none; b=usNLxlF398rokSXL0TyNtnE9SsesURxtM6vzty+yRrYxD8PQnlGB+Rl+wWA4SQr46BDA5YyBni2j/I+qdH5H94omZj+/XQeYh9Y0fF6rbafQ076EJPUHIlH7Y3TDSp8HEkGMFiKUSjd2vVvNxplnFxZOjkrva+KTfu4Z6Eh/7eU= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1776096795; c=relaxed/simple; bh=00LlyA4fvjw/5KiB7Pnxo6LZ/ICZK7qvlKFA6PCM2jc=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=jXr9+H9GKV5Hg6Vg2JOxyYQu3ib/fB+pBX0LxQNwni1XZ9zEX/xhT/1txx/a9ck/lrJ/hPKNcq+t1dR94ftZx+O+2GfaOvzDWFzwr5vxqtDpMOxQ4dSE+RwiPcUxpZCJRCvIukN9Yxg364BrvFmv1V/cVhyEc5OyBfq659o8gAg= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=UNSV6MS1; 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="UNSV6MS1" Received: by smtp.kernel.org (Postfix) with ESMTPSA id A58A4C2BCAF; Mon, 13 Apr 2026 16:13:14 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1776096795; bh=00LlyA4fvjw/5KiB7Pnxo6LZ/ICZK7qvlKFA6PCM2jc=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=UNSV6MS15M2Pu6SIFbDFx9Gec7+0w7brPmTxMqsow2nw4f1G8uNgkvy2RlWTkS/uP pucc5GTvpMzvjaArAkC1hitb6hEDN4pESg4kTrLvbfyM6jWqvZFelOQXdaUTvUcOTO 6ijkXU6/0vNdAvlDSkq/VIsWOdV5z9r+YtassaPM= 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.12 66/70] rxrpc: fix reference count leak in rxrpc_server_keyring() Date: Mon, 13 Apr 2026 18:01:01 +0200 Message-ID: <20260413155730.641070780@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: 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: 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;