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=1796379828; b=YXpKkNa1VHzr/Y6ThsHvFeSMLmMXB+JZkfPF5icp26G0NlxFZsqFx1OcSloh2BbdXEmr PFfYLvqTsoo2sCrKLoiid6NXpR/+sri0ckqHR2k2xBEDJOBdB2WNZQqnl4/m4KLQ1Q6Zy 8Qani6kE1EGKKUeoSd/3aV8/GeUuNjK4yfAuGqtVr3oGGa7y3m3GMjMKjkhtSpfz75xJh vOZUubFjHWlZ14Ysokq2GdispVNLKR6OI87UkyGYwqWVFEe3ztCyf68QihmDm0lcyQGRf AvqzY9DEZCSlO+bpV1u+WkXiCu3qE2wVLihe9d71wByb4ufWyuZ9OOkqI1HdVMapIuQ== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796379828; 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=QgBjkKqB7Xq4XDDHwrAro1l3djjfEMUycOoYSq27bY0=; b=G5mukXhxNEHTg0JZwdHu+B5adqN6Tqnhv/M/a9/033MueGbfVbDBNstWUB2dH25A6Ce8 YPz7R9hwGML4q8FgbvGcJcxytaW5SnJdjHpFgaLQLedfYmCcR+k16aUodGTmy6DMvtJvw Z2GMF+x25yLPw6a8rQsLeCshbxAHypWB8nygoC+lB1RQl86JgXKQE0mlvALtdSTP8WzKs 772kgtnWHPFafWzddngJYFeB8vok3kSJQMjtzih1+VC1IpJI9ZSlaG2qxACvOYKgcApAx hvASx09Kts5SNlWhXBLUsF+F8wlSjA3+ReuIUAp/nw6ABjvZ2GAw0M9OtJjynNw/oxw== 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=i4oC+OZU; 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 F3DE1606A322; Fri, 4 Dec 2026 10:23:47 +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=i4oC+OZU Received: by smtp.kernel.org (Postfix) with ESMTPSA id 6C3041F000CE; Fri, 4 Dec 2026 10:23:47 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=korg; t=1796379827; bh=QgBjkKqB7Xq4XDDHwrAro1l3djjfEMUycOoYSq27bY0=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=i4oC+OZUUH1fcn2bsYN+YJNoImLL6F6X5gw4X4DKGLCG7usaKUABlQL4rzLm4IHqh qEkMS+8pxNq9pHcgiNRlYwgNWTrIRglbBhh9cM7JUfP5ko+HMqxm0fEbfOQOWroP1y d+uYA/8jk5nwsDRQOm9k8TqVjnn2N57xpp9967Vg= 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.18 039/703] keys: keyctl_pkey: replace BUG with return -EOPNOTSUPP Date: Fri, 4 Dec 2026 18:58:58 +0900 Message-ID: <20261204100628.649079411@linuxfoundation.org> X-Mailer: git-send-email 2.56.1 In-Reply-To: <20261204100627.522266145@linuxfoundation.org> References: <20261204100627.522266145@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.18-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