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=1796384188; b=Brwo3Vwjd4OxI2X5NXxDUHLtOGCC6rFH0M1eR70wIwGeau139nbyTipUBy6coI4HUmwz U8B1YY6whC9QahpXhaM0Vn0uo53ybT9InSz29AxV+nVRjgmpIoGDPYgYf5u1WDjs+DV60 QKEx72d9jyaQ73Xl3/CkBqGzMJzUdXOIW2aFS9m5p6mJn70lEj1Asa+QkJMx5DXAZdH72 HkBuLGPX3a7n/qfh6L1D1567QZoejVobGAXjYMLvqf1LO6yMw9UMQU+fQXYIHXt2AmN7R JY53mdjbVLrq2E8cIlbN3sD0XKY69kgGl7iXaXLLYLEufZXj7I9fjf8rHS6RnhKmAeg== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796384188; 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=HIQH7rpDu35z6/QXtzBaI/hTUtMLk3qNguTLfk/TQMY=; b=eW16BgvXL8MqUgGwMJWOI/63tcb8NGQvLpDlpcw+KsZ5y5v8QLlw2ZQjJ5ICRdOm2mc5 rcarWe2R/B6FOHtUis/lsT0NyUqII1dT/tjSGjKXeZC7Zd/Fa2mS7TA0SMUkjV8ke5Qwe 42mP6B4hpkYeWRRhKeIGvohUOVfe0kLd7js8+ZuRBD6bGHbF6uYR5G+lkc1Kgg3Tx7LQr 1Bt9XjrXJay9F1pYATx/gZmg0+C5ws/gkMvvDifqBeox8vpezkUAGQVMq0JN/pKMfKogu FhlOqfisH0ZWVdFU42cXEACUs6O7F0XQxx5gBB6fTnzk7xbr++Po+WDdfLTFUzNEVeg== 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=ciGaJP66; 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 BC023606A322; Fri, 4 Dec 2026 11:36:28 +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=ciGaJP66 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 364D21F000C2; Fri, 4 Dec 2026 11:36:28 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=korg; t=1796384188; bh=HIQH7rpDu35z6/QXtzBaI/hTUtMLk3qNguTLfk/TQMY=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=ciGaJP66a64TACzz3gIQDlaQUKAO9zb8miE8jIn8ccyZZyWASluhCFGgvcf/KDRRv Sc0nAGyIzH+s60Oi2ZE4ReMf3ZtJcdXlK9Y929RqO5oukvAaN3jWPu4/Ct3MJ7ToeQ D7meSi5b7h9+d9Z4fILPWSQ1UiqB975pl4onr5Aw= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Jarkko Sakkinen Subject: [PATCH 6.12 533/555] KEYS: Fix asym key overflow in keyctl_pkey_verify() Date: Fri, 4 Dec 2026 19:09:36 +0900 Message-ID: <20261204100628.984460141@linuxfoundation.org> X-Mailer: git-send-email 2.56.1 In-Reply-To: <20261204100603.988357525@linuxfoundation.org> References: <20261204100603.988357525@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.12-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;