The Linux Kernel Mailing List
 help / color / mirror / Atom feed
From: Jarkko Sakkinen <jarkko@kernel.org>
To: Stefan Berger <stefanb@linux.ibm.com>
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 16:10:08 +0200	[thread overview]
Message-ID: <avcaQGqHKnNFNFSG@kernel.org> (raw)
In-Reply-To: <20261113140311.1375048-1-stefanb@linux.ibm.com>

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>

Thanks.

Br, Jarkko

  reply	other threads:[~2026-11-13 14:10 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-13 14:03 [PATCH] KEYS: Fix signature input size for KEYCTL_PKEY_VERIFY Stefan Berger
2026-11-13 14:10 ` Jarkko Sakkinen [this message]
2026-11-13 14:11   ` Jarkko Sakkinen
2026-11-13 14:45     ` Stefan Berger
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=avcaQGqHKnNFNFSG@kernel.org \
    --to=jarkko@kernel.org \
    --cc=dhowells@redhat.com \
    --cc=florian.bauckholt@cispa.de \
    --cc=keyrings@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=stefanb@linux.ibm.com \
    /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