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=1796379779; b=FQRqJ/T3mXzlvRkpvHy1gh5abu+Cz8QpkR7e/XT5RjOj4f8NA6VxrhUItEKsHS/ISxBN p2l15LFhEIuPZaA1DWuaBjGXbsKj69VcMpmh5V7IJktnizT4/sUnCtkG2VBwQGbQZBlIE bsutxUiqd0otKMjF0OHNRWOtSauQtLRwOGORvTIh7JWVRV33JprYLDvKEFj0GaYcfmDkj DiA7xIFzcXbfk2/NiGT0uvK9nhCrhzfAR8Azu0HbGyMcZyx114ysFkxYI94GIR4rk1a9G MtFVsShwz0M1mZ2eAYjngtJ44kCzSth5sncYLbQ8NJOOPcy+NocDB8Ke+w2mTdWV9tQ== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796379779; 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=C4n9df7yEOvOgddOzbVdJnILHrbrGILJkmrZ+qbuFwU=; b=WzDaa8TwWAEn9GWQG1htGppbqDKMWlsJVNAMGyvmpZq1C/UlmCiKWTVmO6yVnpB5jrYo pR7d010O664ISLWW8HTSTuY4EzZyqdHSBtNnSlZzj6oMJAoqSfRjnCiU8B4wDcI4+i5Hp O1oiL0jEid30LtsYmDNcrQzWA0XBk5yOdZQVprKXLDV2qwAyZifJBjwHZcWJkAPOb0HU7 Ka7+mh62Exw08OCemUQpSGVl0J5m+GGJH+gFezkvxCXM49jMq6MrR5Daql0tFyZhzTIyZ OUtGoR6Lwo/lW6w+JaFnu/Y9v9NjKRHzMHayUHZoz/R8sQW9v2A8hOWhPsISFh01WNg== 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=aV96F1xw; 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 B3F53606A322; Fri, 4 Dec 2026 10:22:59 +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=aV96F1xw Received: by smtp.kernel.org (Postfix) with ESMTPSA id 2FA1B1F000C2; Fri, 4 Dec 2026 10:22:59 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=korg; t=1796379779; bh=C4n9df7yEOvOgddOzbVdJnILHrbrGILJkmrZ+qbuFwU=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=aV96F1xwZVOrA88zEG+J/Ito6NqQlhsnZ2Rr29NuUAHGxfb30yfKpksUdSiu7+e+F hVQiPnsWO3KCO4easOD5B6QpRv+fdx40h8Ol/KICLyv9dDdornItf/lnO89Zj1TuyP p+P8v1GRYz6gECQ1mxU4KRFa9fE4QpLAItX4bGyU= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Mohammed EL Kadiri , Jarkko Sakkinen , Sasha Levin Subject: [PATCH 6.12 057/555] keys: keyctl_pkey: replace BUG with return -EOPNOTSUPP Date: Fri, 4 Dec 2026 19:01:40 +0900 Message-ID: <20261204100608.752075514@linuxfoundation.org> X-Mailer: git-send-email 2.56.1 In-Reply-To: <20261204100603.988357525@linuxfoundation.org> References: <20261204100603.988357525@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 6.12-stable review patch. If anyone has any objections, please let me know. ------------------ From: Mohammed EL Kadiri [ Upstream commit 1b9524250996b1f2f49833a1b2ae21c34e486f85 ] Replace two BUG() calls in keyctl_pkey_params_get_2() and keyctl_pkey_e_d_s() default cases with -EOPNOTSUPP, matching the error style already used in these functions. Signed-off-by: Mohammed EL Kadiri Signed-off-by: Jarkko Sakkinen Stable-dep-of: bab48a104447 ("KEYS: Protect pkey method checks against type removal") Signed-off-by: Sasha Levin --- security/keys/keyctl_pkey.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/security/keys/keyctl_pkey.c b/security/keys/keyctl_pkey.c index ba150ee2d4a37..15b6bf6399b59 100644 --- a/security/keys/keyctl_pkey.c +++ b/security/keys/keyctl_pkey.c @@ -163,7 +163,7 @@ static int keyctl_pkey_params_get_2(const struct keyctl_pkey_params __user *_par params->out_len = info.max_sig_size; break; default: - BUG(); + return -EOPNOTSUPP; } params->in_len = uparams.in_len; @@ -245,7 +245,8 @@ long keyctl_pkey_e_d_s(int op, params.op = kernel_pkey_sign; break; default: - BUG(); + ret = -EOPNOTSUPP; + goto error_params; } in = memdup_user(_in, params.in_len); -- 2.53.0