Re: [PATCH] KEYS: fix overflow in keyctl_pkey_params_get_2()
From: Jarkko Sakkinen <jarkko@kernel.org>
Date: 2026-05-31 03:25:26
Also in:
keyrings, lkml, stable
From: Jarkko Sakkinen <jarkko@kernel.org>
Date: 2026-05-31 03:25:26
Also in:
keyrings, lkml, stable
On Sun, May 31, 2026 at 05:49:13AM +0300, Jarkko Sakkinen wrote:
The length for the internal output buffer is calculated incorrectly, which
can result overflow when a too small buffer is provided.
Fix the bug by allocating internal output with the size of the maximum
length of the cryptographic primitive instead of caller provided size.
Cc: stable@vger.kernel.org # v4.20+
Fixes: 00d60fd3b932 ("KEYS: Provide keyctls to drive the new key type ops for asymmetric keys [ver #2]")
Reported-by: Alessandro Grupp <redacted>
Signed-off-by: Jarkko Sakkinen <jarkko@kernel.org>Should be available in -next within a day or along the lines so please be quick with tags/feedback. I'll forward a PR as soon as all is good. BR, Jarkko