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=1796388650; b=aPIs+nE7/2qhd9l2VUAlXvay6yrlr9QJwiRkmn5UnFNSYgfA/s3p8MaWTsd5ZQBKPNmQ QJ/5neZm1DcMijjxbo9bPPO3KIoLdxWy4WHJESE68R844wYSVBMZLa7VRiQa/afFd0d6u FV6mTVPIh4Pvk2YciVHMI94bHVtS7LO2nrYGYjMgCLEZ7gbkVGfHpun/sewlojdZbFp56 rrYKjvMq9/p32u9uGy2Bk7dI9J86VnJA0IOM5aNikaxBWhQ18q2VeelUBhvxmpdwuUkGs 63sIFRCP0qe+P0eBfW6ag8aeyAFj+Gr1bPS9wBfakD3TRS+8K+w/onpoyMBE1OT7qjA== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796388650; 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=SeMY/E0Uk3TqhI5vNWaMAWJ1YFSeBM1UqSwQkX3zgAA=; b=hQbu+ZWPwflhMbhe0FoBW7+X10z4Hauy8utLYHfM54rkPbDACVn8IPTrd66XawcfzKGY fubj4dLYce7eTtUCT1/QsRrEFC0x9bpXLJOhgpZ3PaSXI+HYah8LGFHTNBFqpoTjimPyn cts6MkmprgxTthH2qVvkpDql2ESkwpArnA/RmeeD9ICujfa8iiJrq/tndb9Ve0SVZ+boe ZFVCuP4uRuBDRpn5QiuzK5XichnEpfB2dPpMk/bL8WJIowgbrZ5g8Nu6kLKbfjaXFZ1+b gEmGDjZuwwWKenUOqui7vBWSgR5nf60XAjMCTxnEw84+A3VF2oVbywOGikEJAp8Rprw== 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="xKb/r0OH"; 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 C82B7606A32F; Fri, 4 Dec 2026 12:50:50 +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=xKb/r0OH Received: by smtp.kernel.org (Postfix) with ESMTPSA id D3B211F000C2; Fri, 4 Dec 2026 12:50:49 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=korg; t=1796388650; bh=SeMY/E0Uk3TqhI5vNWaMAWJ1YFSeBM1UqSwQkX3zgAA=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=xKb/r0OHPm+z8mvY5zZ20zV5xKq7nsnsertELNW72KUuvgQmc6PwEjtLGZ/CyA52w drSIc1v7+arZ/xke8JLRC3mbpljpJ6YMWjajKSq3mbsrZi9OHWmTxpbQ6boNmxoQ6k 8BFGf+U012nZBxW4AOM/Ya48nosTH/bXidMyRL2s= 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.1 0700/1059] keys: keyctl_pkey: replace BUG with return -EOPNOTSUPP Date: Fri, 4 Dec 2026 19:03:51 +0900 Message-ID: <20261204100702.108988848@linuxfoundation.org> X-Mailer: git-send-email 2.56.1 In-Reply-To: <20261204100643.980430235@linuxfoundation.org> References: <20261204100643.980430235@linuxfoundation.org> User-Agent: quilt/0.69 X-stable: review X-Patchwork-Hint: ignore X-Mailing-List: stable@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 6.1-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