From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=100.103.45.18 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796380055; b=ZNtcXY/hjbI7MF2KMVGMwph1/7AXRi9ctyzDY7oAqz1zmVZaVVDr7MfM9fAExJ1DiIMA Odi6z80Nolg4HfADZaE1x7bjSob3Q7y9jsEA45WJpW1Ikkzm2y134eXfeeIYTapBl7Hry J39pdz/Auv4NJUm/9weXyVfLFUZp3fCYBl4ZQ86fCYzXc+frDed8fK0b24dh1e7FMUfpB 3i7YjEiICVSwpGsFMw2P4k4EQb/c+aAN4Dcx9/PSOgXMj3im7S5uM7RY+vWfTxx5kg9dc cSDexb/g7rhQoGxluUXlDTuaexk5UqyVKz8jRTdWVURQLxJN/dT+ccH/45SZtbWF3Aw== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796380055; h=Received:DKIM-Signature:From:To:Cc:Subject:Date:Message-ID:X-Mailer: In-Reply-To:References:User-Agent:X-stable:X-Patchwork-Hint: MIME-Version:Content-Transfer-Encoding; bh=eQwNqjLHSk56h4/TDOWL3aiQnstIVhVaXiYNtYmWPiE=; b=hn4aAv+NtfkNT3UhEGbfbkbMR1XyNkD6rNy8r0o5WGhKKFIdves0kRqQMY76GqSCoQwO YGvBOi6D0e1Q24lguMF2Nb1leQrh08gWy8W97CBheyIo2u0vNg2MyS6paf6K9wXx1iqmU 7PjK/g2FzLsBANGaUW1iOqnudLxr4WPRSpBTxBMIb7L9t+zdJmPzzhJfLde3MV8p/kgZM EfWH4us4zKSt1MWQ8KDTOqIDdF23goed6SVF2syaTU8xWl+pL5+rrA0W8qvofYptZ5gRr Rnw1XOjltShbUcLFWTvzjGfMcB/xOc2V89kqxZtIs87TTuB3FGzZJ1Zed/Q2fq2iwdg== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass header.d=linuxfoundation.org header.i=@linuxfoundation.org header.a=rsa-sha256 header.s=korg header.b=pALBtx1B; arc=none smtp.remote-ip=100.103.45.18 Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 54BD5606A32D; Fri, 4 Dec 2026 10:27:35 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.a=rsa-sha256 header.s=korg header.b=pALBtx1B Received: by smtp.kernel.org (Postfix) with ESMTPSA id BFE411F000C2; Fri, 4 Dec 2026 10:27:34 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=korg; t=1796380055; bh=eQwNqjLHSk56h4/TDOWL3aiQnstIVhVaXiYNtYmWPiE=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=pALBtx1BWmuCSz7bZid0raRWgl/4KYwhoVW3eYiL6bvSgrCMYAFzqqf58uSLAhxXb YbQS8/LDn0BBtKnJQBkpLDXE9xqLMPeKlo1yYtphA9xpT6ng+tngcgU6o/JEtXdFdI 434nRBMAc0M20OBWFCaFaD1cmEtGL6vsoMZxEyLM= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Heiko Carstens , Jarkko Sakkinen , Alexander Gordeev , Sasha Levin Subject: [PATCH 7.3 108/742] s390/cert_store: Fix cs_keyring reference leak in fill_cs_keyring() Date: Fri, 4 Dec 2026 18:59:32 +0900 Message-ID: <20261204100638.005973737@linuxfoundation.org> X-Mailer: git-send-email 2.56.1 In-Reply-To: <20261204100635.034361255@linuxfoundation.org> References: <20261204100635.034361255@linuxfoundation.org> User-Agent: quilt/0.69 X-stable: review X-Patchwork-Hint: ignore X-Mailing-List: patches@lists.linux.dev List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 7.3-stable review patch. If anyone has any objections, please let me know. ------------------ From: Heiko Carstens [ Upstream commit f992716c4c767a89b6be32e24ee6e4e41ad99da4 ] create_cs_keyring() returns cs_keyring with a reference held. On the success path fill_cs_keyring() never drops it, leaking the reference. The keyring is kept alive by its link to the session keyring. Drop the reference after add_certificates_to_keyring() returns. Fixes: 8cf57d7217c3 ("s390: add support for user-defined certificates") Signed-off-by: Heiko Carstens Reviewed-by: Jarkko Sakkinen Signed-off-by: Alexander Gordeev Signed-off-by: Sasha Levin --- arch/s390/kernel/cert_store.c | 1 + 1 file changed, 1 insertion(+) diff --git a/arch/s390/kernel/cert_store.c b/arch/s390/kernel/cert_store.c index a142f46cc82b8..39545f2f3d2ea 100644 --- a/arch/s390/kernel/cert_store.c +++ b/arch/s390/kernel/cert_store.c @@ -723,6 +723,7 @@ static int fill_cs_keyring(void) if (rc) goto cleanup_cs_keyring; + key_put(cs_keyring); goto out; cleanup_cs_keyring: -- 2.53.0