From: Lukas Wunner <lukas@wunner.de>
To: Doruk Tan Ozturk <doruk@0sec.ai>
Cc: stable@vger.kernel.org, herbert@gondor.apana.org.au,
linux-crypto@vger.kernel.org, linux-kernel@vger.kernel.org,
Ignat Korchagin <ignat@linux.win>
Subject: Re: [PATCH 6.1/6.6/6.12.y] crypto: rsa-pkcs1pad: Don't WARN on an empty digest
Date: Mon, 27 Jul 2026 12:29:58 +0200 [thread overview]
Message-ID: <amczJhA6T8UcthZp@wunner.de> (raw)
In-Reply-To: <20260720191525.15450-1-doruk@0sec.ai>
On Mon, Jul 20, 2026 at 09:15:25PM +0200, Doruk Tan Ozturk wrote:
> KEYCTL_PKEY_VERIFY lets an unprivileged caller supply a zero-length
> digest (in_len == 0). keyctl_pkey_params_get_2() accepts the zero
> length and the request reaches pkcs1pad_verify(), where the empty
> digest is rejected but only after being passed through
> WARN_ON(!digest_size). The warning is therefore directly
> user-triggerable, and on kernels built with panic_on_warn=1 an
> unprivileged process can panic the machine -- a local denial of
> service. Reproduced as UID 65534 in a setuid sandbox.
>
> Keep rejecting the invalid request with -EINVAL, but do not emit a
> warning for the user-controlled length.
>
> Mainline does not contain this code path; commit 1e562deacecc
> ("crypto: rsassa-pkcs1 - Migrate to sig_alg backend") removed
> pkcs1pad_verify() in v6.13-rc1. This is a minimal fix for the
> affected stable branches. It applies as-is to 6.1.y, 6.6.y and
> 6.12.y (identical pkcs1pad_verify); the 5.10.y/5.15.y form is sent
> as a separate patch due to the older req->dst_len spelling.
>
> Found by 0sec automated security-research tooling (https://0sec.ai).
>
> Fixes: c7381b012872 ("crypto: akcipher - new verify API for public key algorithms")
> Cc: stable@vger.kernel.org
> Assisted-by: 0sec:multi-model
> Signed-off-by: Doruk Tan Ozturk <doruk@0sec.ai>
Reviewed-by: Lukas Wunner <lukas@wunner.de>
next prev parent reply other threads:[~2026-07-27 10:30 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-07-20 19:15 [PATCH 6.1/6.6/6.12.y] crypto: rsa-pkcs1pad: Don't WARN on an empty digest Doruk Tan Ozturk
2026-07-22 0:53 ` Sasha Levin
2026-07-25 19:04 ` Doruk (0sec)
2026-07-26 23:14 ` Herbert Xu
2026-07-27 10:29 ` Lukas Wunner [this message]
2026-07-27 22:19 ` Sasha Levin
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=amczJhA6T8UcthZp@wunner.de \
--to=lukas@wunner.de \
--cc=doruk@0sec.ai \
--cc=herbert@gondor.apana.org.au \
--cc=ignat@linux.win \
--cc=linux-crypto@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=stable@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