From: Stefan Berger <stefanb@linux.ibm.com>
To: Jarkko Sakkinen <jarkko@kernel.org>
Cc: keyrings@vger.kernel.org, linux-kernel@vger.kernel.org,
dhowells@redhat.com,
Florian Bauckholt <florian.bauckholt@cispa.de>
Subject: Re: [PATCH] KEYS: Fix signature input size for KEYCTL_PKEY_VERIFY
Date: Fri, 13 Nov 2026 09:45:05 -0500 [thread overview]
Message-ID: <5c9ba3d6-cf55-4a8d-914d-2c85f7b7f5cf@linux.ibm.com> (raw)
In-Reply-To: <avcadBCRBGUXDapR@kernel.org>
On 11/13/26 9:11 AM, Jarkko Sakkinen wrote:
> On Fri, Nov 13, 2026 at 04:10:12PM +0200, Jarkko Sakkinen wrote:
>> On Fri, Nov 13, 2026 at 09:03:11AM -0500, Stefan Berger wrote:
>>> Revert the changes made for signature verification in cb481e59ea6c back
>>> to the old behavior where effectively the params->in2_len was set to the
>>> length of the user provided buffer uparams.in2_len (out_len is an alias
>>> for in2_len due to the union). We cannot use the max_sig_size in the
>>> case of signature verification since this is neither the true size of the
>>> input buffer nor would it pass tests of size indicators found in the ASN.1
>>> in the buffer comparing against the input buffer size.
>>>
>>> Fixes: cb481e59ea6c ("KEYS: fix overflow in keyctl_pkey_params_get_2()")
>>> Cc: Jarkko Sakkinen <jarkko@kernel.org>
>>> Cc: Florian Bauckholt <florian.bauckholt@cispa.de>
>>> Signed-off-by: Stefan Berger <stefanb@linux.ibm.com>
>>> ---
>>> security/keys/keyctl_pkey.c | 2 +-
>>> 1 file changed, 1 insertion(+), 1 deletion(-)
>>>
>>> diff --git a/security/keys/keyctl_pkey.c b/security/keys/keyctl_pkey.c
>>> index 15b6bf6399b5..794fa3d01911 100644
>>> --- a/security/keys/keyctl_pkey.c
>>> +++ b/security/keys/keyctl_pkey.c
>>> @@ -160,7 +160,7 @@ static int keyctl_pkey_params_get_2(const struct keyctl_pkey_params __user *_par
>>> uparams.in2_len > info.max_sig_size)
>>> return -EINVAL;
>>>
>>> - params->out_len = info.max_sig_size;
>>> + params->in2_len = uparams.in2_len;
>>> break;
>>> default:
>>> return -EOPNOTSUPP;
>>> --
>>> 2.56.0
>>>
>>
>>
>> Reviewed-by: Jarkko Sakkinen <jarkko@kernel.org>
>
> Did we have reported-by and closes tags for this?
Let me add this here for v2:
Link:
https://lore.kernel.org/linux-crypto/473700a3-f5d7-4a7a-b89a-12c51adcc3df@cispa.de/T/#t
Reported-by: Sashiko <sashiko-bot@kernel.org>
Once Florian added his Tested-by: to v1 should I then add this?
Cc: stable@vger.kernel.org
>
> Br, Jarkko
next prev parent reply other threads:[~2026-11-13 14:45 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-13 14:03 Stefan Berger
2026-11-13 14:10 ` Jarkko Sakkinen
2026-11-13 14:11 ` Jarkko Sakkinen
2026-11-13 14:45 ` Stefan Berger [this message]
2026-11-13 14:47 ` Jarkko Sakkinen
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=5c9ba3d6-cf55-4a8d-914d-2c85f7b7f5cf@linux.ibm.com \
--to=stefanb@linux.ibm.com \
--cc=dhowells@redhat.com \
--cc=florian.bauckholt@cispa.de \
--cc=jarkko@kernel.org \
--cc=keyrings@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®