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=1796382970; b=MHpDmrIsrrakz/0WyC8LbSu7fF1B4a/dPpPSUgptoeZjuBJ6UYC5Wbk24ajEvbn+uIni +jKmRqbfX8wIYKEIyh2IYrxRAlknHLexkOG0R8sdcOe2aGnV/GNHsxwGfX9KUBcCjoxY5 259+P34+w806LyBSKQjrnXBhIJKGWZDyh7av12rGIkAvdT6nlPxuHu87w9Su/Xd6cPLui eOn+r5IDs0uhlICZ0jD/BUeU1qKwCUb95rKvZwJNamIUo3uyI9p0gAUEB7mpVu+X6yQU8 CsuUePJEAqey9W8/J3A4gkIbvo6Jj/FNzfLEc1ZfN4HhTdn/Rn1p5iQdJUI8uT1p3Ug== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796382970; 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=iiwL/I8lKUe3dgmJIbcN0yL+xlc71L2SZUvp3VylRvE=; b=KqTWiy0oNAmsKi4aHteIH9Mk/cDHUEh/oSEISp8+CfyDBj7aGJ9XnGn4Y0/f5ukakLyV Y3Dpy6KigKukXWJlG5shyT0ZO5v5KMoYcj1XCHc19LcUrNppCE7try/4U2O9VscEHRwp3 r7gZgEfdWwVpU7YVUWFTVwwJBYE3aGjjfOyXz6EnvCSybS//nzffJ7tWs62jFU+zxL9Sm 8ueiqvIpr0GJ8HU6UsODDF/3bikaOPW/TBj4/l4krfpuoUlo7LR7Tf/PgRxr/87R00LMu N/RsdvcXYIWDNEhXdx3rfvtfizFcK5GZVnOtX2EVQf3/V5nYn361iGY2GU0xgrCflSA== 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=kQ7kk0eg; 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 F0DF4606A32C; Fri, 4 Dec 2026 11:16:09 +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=kQ7kk0eg Received: by smtp.kernel.org (Postfix) with ESMTPSA id 68F601F000C2; Fri, 4 Dec 2026 11:16:09 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=korg; t=1796382969; bh=iiwL/I8lKUe3dgmJIbcN0yL+xlc71L2SZUvp3VylRvE=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=kQ7kk0egmYu5r4jSkpSifayP6fIW37IIBDGUkA3b5oEEjoIdzkpDhgOowHXGAIj4I HvpmUQ44YqXADqNrfe0/EhoerkM88Z2+uptAVuC/KTg67uu78LV5oqfgZYv0tN1AFL KyiSvTb8MD2vctjEGxBHGddDXWeaeGkwy+zZBevk= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Jarkko Sakkinen Subject: [PATCH 6.18 630/703] KEYS: Fix asym key overflow in keyctl_pkey_verify() Date: Fri, 4 Dec 2026 19:08:49 +0900 Message-ID: <20261204100644.546773554@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: 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;