All of lore.kernel.org
 help / color / mirror / Atom feed
From: Ard Biesheuvel <ard.biesheuvel@linaro.org>
To: Herbert Xu <herbert@gondor.apana.org.au>
Cc: Gilad Ben-Yossef <gilad@benyossef.com>,
	Kees Cook <keescook@chromium.org>,
	Eric Biggers <ebiggers@google.com>,
	Antoine Tenart <antoine.tenart@bootlin.com>,
	Boris Brezillon <boris.brezillon@bootlin.com>,
	Arnaud Ebalard <arno@natisbad.org>,
	Corentin Labbe <clabbe.montjoie@gmail.com>,
	Maxime Ripard <maxime.ripard@bootlin.com>,
	Chen-Yu Tsai <wens@csie.org>,
	Christian Lamparter <chunkeey@gmail.com>,
	Philippe Ombredanne <pombredanne@nexb.com>,
	Jonathan Cameron <Jonathan.Cameron@huawei.com>,
	"open list:HARDWARE RANDOM NUMBER GENERATOR CORE"
	<linux-crypto@vger.kernel.org>,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
	linux-arm-kernel <linux-arm-kernel@lists.infradead.org>
Subject: Re: [PATCH 2/2] crypto: skcipher: Remove VLA usage for SKCIPHER_REQUEST_ON_STACK
Date: Thu, 6 Sep 2018 11:29:41 +0200	[thread overview]
Message-ID: <CAKv+Gu_0ehX9sLCtUYR00D4iQw+ytwmsLKmG6dgq9EnLjidKFw@mail.gmail.com> (raw)
In-Reply-To: <20180906085100.xcqqftgqg4sizkec@gondor.apana.org.au>

On 6 September 2018 at 10:51, Herbert Xu <herbert@gondor.apana.org.au> wrote:
> On Thu, Sep 06, 2018 at 10:11:59AM +0200, Ard Biesheuvel wrote:
>>
>> That way, we will almost certainly oops on a NULL pointer dereference
>> right after, but we at least the stack corruption.
>
> A crash is just as bad as a BUG_ON.
>
> Is this even a real problem? Do we have any users of this construct
> that is using it on async algorithms?
>

Perhaps not, but it is not enforced atm.

In any case, limiting the reqsize is going to break things, so that
needs to occur based on the sync/async nature of the algo. That also
means we'll corrupt the stack if we ever end up using
SKCIPHER_REQUEST_ON_STACK() with an async algo whose reqsize is
greater than the sync reqsize limit, so I do think some additional
sanity check is appropriate.

WARNING: multiple messages have this Message-ID (diff)
From: ard.biesheuvel@linaro.org (Ard Biesheuvel)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH 2/2] crypto: skcipher: Remove VLA usage for SKCIPHER_REQUEST_ON_STACK
Date: Thu, 6 Sep 2018 11:29:41 +0200	[thread overview]
Message-ID: <CAKv+Gu_0ehX9sLCtUYR00D4iQw+ytwmsLKmG6dgq9EnLjidKFw@mail.gmail.com> (raw)
In-Reply-To: <20180906085100.xcqqftgqg4sizkec@gondor.apana.org.au>

On 6 September 2018 at 10:51, Herbert Xu <herbert@gondor.apana.org.au> wrote:
> On Thu, Sep 06, 2018 at 10:11:59AM +0200, Ard Biesheuvel wrote:
>>
>> That way, we will almost certainly oops on a NULL pointer dereference
>> right after, but we at least the stack corruption.
>
> A crash is just as bad as a BUG_ON.
>
> Is this even a real problem? Do we have any users of this construct
> that is using it on async algorithms?
>

Perhaps not, but it is not enforced atm.

In any case, limiting the reqsize is going to break things, so that
needs to occur based on the sync/async nature of the algo. That also
means we'll corrupt the stack if we ever end up using
SKCIPHER_REQUEST_ON_STACK() with an async algo whose reqsize is
greater than the sync reqsize limit, so I do think some additional
sanity check is appropriate.

  reply	other threads:[~2018-09-06  9:29 UTC|newest]

Thread overview: 54+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-09-04 18:16 [PATCH 0/2] crypto: Remove VLA usage from skcipher Kees Cook
2018-09-04 18:16 ` Kees Cook
2018-09-04 18:16 ` [PATCH 1/2] crypto: skcipher: Allow crypto_skcipher_set_reqsize() to fail Kees Cook
2018-09-04 18:16   ` Kees Cook
2018-09-04 18:16 ` [PATCH 2/2] crypto: skcipher: Remove VLA usage for SKCIPHER_REQUEST_ON_STACK Kees Cook
2018-09-04 18:16   ` Kees Cook
2018-09-05  6:05   ` Alexander Stein
2018-09-05  6:05     ` Alexander Stein
2018-09-05  6:05     ` Alexander Stein
2018-09-05  9:18   ` Ard Biesheuvel
2018-09-05  9:18     ` Ard Biesheuvel
2018-09-05  9:18     ` Ard Biesheuvel
2018-09-05 21:05     ` Kees Cook
2018-09-05 21:05       ` Kees Cook
2018-09-05 21:05       ` Kees Cook
2018-09-05 22:49       ` Ard Biesheuvel
2018-09-05 22:49         ` Ard Biesheuvel
2018-09-05 22:49         ` Ard Biesheuvel
2018-09-06  0:43         ` Kees Cook
2018-09-06  0:43           ` Kees Cook
2018-09-06  0:43           ` Kees Cook
2018-09-06 20:22           ` Kees Cook
2018-09-06 20:22             ` Kees Cook
2018-09-06 20:22             ` Kees Cook
2018-09-06 22:23             ` Kees Cook
2018-09-06 22:23               ` Kees Cook
2018-09-06 22:23               ` Kees Cook
2018-09-06  4:53         ` Gilad Ben-Yossef
2018-09-06  4:53           ` Gilad Ben-Yossef
2018-09-06  4:53           ` Gilad Ben-Yossef
2018-09-06  7:21           ` Ard Biesheuvel
2018-09-06  7:21             ` Ard Biesheuvel
2018-09-06  7:21             ` Ard Biesheuvel
2018-09-06  8:11             ` Ard Biesheuvel
2018-09-06  8:11               ` Ard Biesheuvel
2018-09-06  8:11               ` Ard Biesheuvel
2018-09-06  8:51               ` Herbert Xu
2018-09-06  8:51                 ` Herbert Xu
2018-09-06  8:51                 ` Herbert Xu
2018-09-06  9:29                 ` Ard Biesheuvel [this message]
2018-09-06  9:29                   ` Ard Biesheuvel
2018-09-06  9:29                   ` Ard Biesheuvel
2018-09-06 13:11                   ` Herbert Xu
2018-09-06 13:11                     ` Herbert Xu
2018-09-06 13:11                     ` Herbert Xu
2018-09-06 14:49                     ` Ard Biesheuvel
2018-09-06 14:49                       ` Ard Biesheuvel
2018-09-06 14:49                       ` Ard Biesheuvel
2018-09-06 19:18                       ` Kees Cook
2018-09-06 19:18                         ` Kees Cook
2018-09-06 19:18                         ` Kees Cook
2018-09-06  8:25             ` Gilad Ben-Yossef
2018-09-06  8:25               ` Gilad Ben-Yossef
2018-09-06  8:25               ` Gilad Ben-Yossef

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=CAKv+Gu_0ehX9sLCtUYR00D4iQw+ytwmsLKmG6dgq9EnLjidKFw@mail.gmail.com \
    --to=ard.biesheuvel@linaro.org \
    --cc=Jonathan.Cameron@huawei.com \
    --cc=antoine.tenart@bootlin.com \
    --cc=arno@natisbad.org \
    --cc=boris.brezillon@bootlin.com \
    --cc=chunkeey@gmail.com \
    --cc=clabbe.montjoie@gmail.com \
    --cc=ebiggers@google.com \
    --cc=gilad@benyossef.com \
    --cc=herbert@gondor.apana.org.au \
    --cc=keescook@chromium.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-crypto@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=maxime.ripard@bootlin.com \
    --cc=pombredanne@nexb.com \
    --cc=wens@csie.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 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.