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=1796386061; b=0Dqwi8SnNfh6UXI55UmWWAGkZQSLx7DZ1ccsJuMTs+QEDpHN+fkWXuq3ZJu6xSnr+RvX 4xzJvrFhqvdXe/eyqMf2pcm2LlPpukLX74axpSfsSxFtpibUSxRv4F2QGykCHudLPn7nm l0ic2Z0+821F3eRthr9fbjrIMXpOKjXPpP6w2YW0XqgViEJDH7r4JAq+IRGhpxao+f5T9 eQOLTlAqC9q/jmiPjZgt/qPENCeGDfV10lkX6H9LgYBnA5O/pHpPvcUJjuMgtf12TXAgw RigPme5snj27ZUE4upUsYHLdFuMAk5rsDh0uqotb+LBb3MM5kvx3BzcXoV1h7oe5JdQ== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796386061; 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=glq6ITwbE51SaHUZdR2JCNfNEfGykOrjXY5xVUGh1uM=; b=xYaE0LwlIGXd7/gh1BxQYeRvJ7TwzEeJw6Ry3eir3e56cuKkGNtUS4eX+yRboNsunXER U1l/w1mR9mtVvngVcYzXdKJ81c1f7uC9rSUkjGSVQasTOYJHL0GcqjpKp0Jm9ZfVdtWHO GN/f36vQT7Z+NOlFxgPD00tO8h8YZC0Rb1COIMvwGospsd/l7xh5QjwUDrESPZjlpkp0Y YvRyNheUkZ3KHRaUSfIMtVz38MJAl/uplRvwFJAxrv5b+Z7dE/jPa7NxHAU4J1oNxwSeC u2mehqExnvrIRhw74AutDLDP6vR0OzKA/H84k3oz0Sfkx5q6H2os5NbTG5XMG4kTrOA== 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=0NnpIhLP; 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 55822606A32F; Fri, 4 Dec 2026 12:07:41 +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=0NnpIhLP Received: by smtp.kernel.org (Postfix) with ESMTPSA id C4C841F000C2; Fri, 4 Dec 2026 12:07:40 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=korg; t=1796386061; bh=glq6ITwbE51SaHUZdR2JCNfNEfGykOrjXY5xVUGh1uM=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=0NnpIhLPoWvJLKx7QG0As7r5Daq/Jy9ZipibyHh7gOoAFdkQD+FTbpTlwasZwyyZn MzfygMdm5NQGKWhd8dcEqAxcOP3JdFSDZckNFVo+GwxuWuVAxdEe83L7cfLa4mNV0o O+37KsGK3iWaC8SZ4gbPj4TlohyolkXonTZiNvH0= 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.6 0769/1167] keys: keyctl_pkey: replace BUG with return -EOPNOTSUPP Date: Fri, 4 Dec 2026 19:03:16 +0900 Message-ID: <20261204100722.121227058@linuxfoundation.org> X-Mailer: git-send-email 2.56.1 In-Reply-To: <20261204100702.047403948@linuxfoundation.org> References: <20261204100702.047403948@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.6-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