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=1796381532; b=dYiQXGnZY1gIRprFUfagwhFjG/PexFuxthWmNK2X/IEcc6C6oeZozLYT9lBssfERokYn mCDl/qwouPbsf5mlatp5idiPIf9yHaWae7Cl3wCYiJitOO8c681IYAHwokWRbdWD1QWPm FhRza199CzzCkIyP874OxGuc61Tpt6GgmYf8/W4YvfcDk9XXJFQ06pAx+8Kh91huYm7Bs 1NcxKB33l5y7gK2rYBBgZC8FkY5Cynmwy1XNT8uSDrjPtke0JWJmAN71WOk5jhKYmjyWt biuCvMD2UYYGvdPS5AkjuuH90d7wKixDUQWmdM9FHSWwgJl1Meu53SNHL/8vKNi3TEw== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796381532; 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=Rsx/xr3p3dkLSXi+AoVGUxYwLXINDscRbkycWmOvGSE=; b=LJeNvwDZeM5o0RiUj2C51LLus3NA+8DGxCTDJP5Zz50wcTWvwVt7zJskG6235239rk+1 IaVyvGVCiojvPQ55SF+JV858WhFKiti7Hw6cQTNXcxvuDxhZIEjiVJFZIBwIbF9lz5z9O wqPEVaUTz8rTGIgFj37jykupIefLuDb/1KC3va5fVXbyaNqe1GnSmlquIKuXeUuN6GPqy Ces1YrtX1zncTqdGA1fN7nMZ2O+kQHeNi2gWM2x1IdgrxhQKzX2495z6xWSKy8TfHC1do VnL5ijI9fIWDv+6nAICF4IRcXYyiNzspnC2J6SMGNBcxaYzfqzPqXhl5HbQvevyGdEQ== 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="zK/Q/MCp"; 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 3CBB6606A681; Fri, 4 Dec 2026 10:52:12 +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=zK/Q/MCp Received: by smtp.kernel.org (Postfix) with ESMTPSA id 92CA51F000C2; Fri, 4 Dec 2026 10:52:11 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=korg; t=1796381532; bh=Rsx/xr3p3dkLSXi+AoVGUxYwLXINDscRbkycWmOvGSE=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=zK/Q/MCpxjipB4R5UxAt63m2Uhk3KECJVFn0qPucspjiZoyuhctGWJJ5v5vJ+wklE v/qbDf/btE1ry5SWsIdkQPQEgDsQQNgzbieq/IuxL0ZURcE9gJSbbf+ogNnutrA7u4 OylIh498PvpIAuXWiPpyShukWCLX8lw2csQhsz1Q= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Jarkko Sakkinen Subject: [PATCH 7.3 705/742] KEYS: Fix asym key overflow in keyctl_pkey_verify() Date: Fri, 4 Dec 2026 19:09:29 +0900 Message-ID: <20261204100653.783849628@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: Jarkko Sakkinen commit 94cd215923495a0e1031b86dc7d246ef3c33cc73 upstream. While verifying a variable-length signature shorter than info.max_sig_size, memdup_user() reads past the end of the caller's _in2 and passes trailing bytes to ->asym_verify_signature(). Set params->in2_len to uparams.in2_len in the KEYCTL_PKEY_VERIFY case. Cc: stable@vger.kernel.org # v7.2+ Closes: https://sashiko.dev/#/bug/linux-dd9ad2ca-a846-4d0d-89d6-aa262ffd40f1 Fixes: cb481e59ea6c ("KEYS: fix overflow in keyctl_pkey_params_get_2()") Signed-off-by: Jarkko Sakkinen Signed-off-by: Greg Kroah-Hartman --- security/keys/keyctl_pkey.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) --- a/security/keys/keyctl_pkey.c +++ b/security/keys/keyctl_pkey.c @@ -175,7 +175,7 @@ static int keyctl_pkey_params_get_2(cons goto out_up_key_sem; } - params->out_len = info.max_sig_size; + params->in2_len = uparams.in2_len; break; default: ret = -EOPNOTSUPP;