All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jarkko Sakkinen <jarkko@kernel.org>
To: Stefan Berger <stefanb@linux.ibm.com>
Cc: florian.bauckholt@cispa.de, David Howells <dhowells@redhat.com>,
	Lukas Wunner <lukas@wunner.de>, Ignat Korchagin <ignat@linux.win>,
	Herbert Xu <herbert@gondor.apana.org.au>,
	"David S. Miller" <davem@davemloft.net>,
	Paul Moore <paul@paul-moore.com>,
	James Morris <jmorris@namei.org>,
	"Serge E. Hallyn" <serge@hallyn.com>,
	Hui Peng <benquike@gmail.com>,
	keyrings@vger.kernel.org, linux-crypto@vger.kernel.org,
	linux-security-module@vger.kernel.org,
	linux-kernel@vger.kernel.org, stable@vger.kernel.org
Subject: Re: [PATCH 1/2] KEYS: fix signature length passed to KEYCTL_PKEY_VERIFY
Date: Wed, 18 Nov 2026 22:28:16 +0200	[thread overview]
Message-ID: <av4KYKy7pZHyErVs@kernel.org> (raw)
In-Reply-To: <f38f6d32-16d3-4986-8d6a-9d65517f5317@linux.ibm.com>

On Wed, Nov 18, 2026 at 03:08:19PM -0500, Stefan Berger wrote:
> 
> 
> On 11/11/26 10:56 AM, Florian Bauckholt via B4 Relay wrote:
> > From: Florian Bauckholt <florian.bauckholt@cispa.de>
> > 
> > Commit cb481e59ea6c ("KEYS: fix overflow in keyctl_pkey_params_get_2()")
> > made keyctl_pkey_params_get_2() set params->out_len to the maximum
> > output size of the operation instead of the size provided by the caller.
> > It does so for KEYCTL_PKEY_VERIFY as well, but verify has no output
> > buffer: out_len shares a union with in2_len, the length of the
> > signature.
> > 
> > As a result keyctl_pkey_verify() ignores the signature length passed by
> > the caller. It copies max_sig_size bytes from the signature pointer and
> > passes max_sig_size as the signature size to the verification.
> > 
> > This makes no difference for signatures that are always max_sig_size
> > bytes long, such as RSA. A shorter signature, e.g. a DER-encoded ECDSA
> > signature, is followed by whatever is behind it in the caller's memory,
> > or the call fails with -EFAULT if that memory is not readable. The
> > x962 ECDSA template currently ignores data following the signature,
> > which hides the problem.
> > 
> > Use the length provided by the caller, which has already been checked
> > against max_sig_size.
> > 
> > Fixes: cb481e59ea6c ("KEYS: fix overflow in keyctl_pkey_params_get_2()")
> > Cc: stable@vger.kernel.org
> > Link: https://lore.kernel.org/all/20260919221742.3709658-1-benquike@gmail.com/
> > Signed-off-by: Florian Bauckholt <florian.bauckholt@cispa.de>
> 
> Tested-by: Stefan Berger <stefanb@linux.ibm.com>

Can these patches be rebased? They don't apply.

I've probably missed b4 shazam issue last time.

Was just wondering why I don't have these yet.

Br, Jarkko

  reply	other threads:[~2026-11-18 20:28 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-11 15:56 [PATCH 0/2] KEYS: two fixes for the asymmetric keyctl operations Florian Bauckholt via B4 Relay
2026-11-11 15:56 ` Florian Bauckholt
2026-11-11 15:56 ` [PATCH 1/2] KEYS: fix signature length passed to KEYCTL_PKEY_VERIFY Florian Bauckholt via B4 Relay
2026-11-11 15:56   ` Florian Bauckholt
2026-11-11 16:40   ` sashiko-bot
2026-11-11 22:56   ` Jarkko Sakkinen
2026-11-17 13:21   ` Rodolfo Giometti
2026-11-18 23:18     ` Florian Bauckholt
2026-11-18 20:08   ` Stefan Berger
2026-11-18 20:28     ` Jarkko Sakkinen [this message]
2026-11-18 23:01       ` Florian Bauckholt
2026-11-11 15:56 ` [PATCH 2/2] KEYS: asymmetric: Fix PKCS#1 decryption of an empty message Florian Bauckholt via B4 Relay
2026-11-11 15:56   ` Florian Bauckholt
2026-11-11 16:48   ` sashiko-bot
2026-11-11 23:01   ` Jarkko Sakkinen
2026-11-20  9:52   ` Herbert Xu

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=av4KYKy7pZHyErVs@kernel.org \
    --to=jarkko@kernel.org \
    --cc=benquike@gmail.com \
    --cc=davem@davemloft.net \
    --cc=dhowells@redhat.com \
    --cc=florian.bauckholt@cispa.de \
    --cc=herbert@gondor.apana.org.au \
    --cc=ignat@linux.win \
    --cc=jmorris@namei.org \
    --cc=keyrings@vger.kernel.org \
    --cc=linux-crypto@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-security-module@vger.kernel.org \
    --cc=lukas@wunner.de \
    --cc=paul@paul-moore.com \
    --cc=serge@hallyn.com \
    --cc=stable@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.