Linux-ARM-Kernel Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Herbert Xu <herbert@gondor.apana.org.au>
To: Siddharth Vadapalli <s-vadapalli@ti.com>
Cc: davem@davemloft.net, stable@vger.kernel.org,
	linux-crypto@vger.kernel.org, linux-kernel@vger.kernel.org,
	linux-arm-kernel@lists.infradead.org, srk@ti.com
Subject: Re: [PATCH v2] crypto: sa2ul - Fix stack overflow in sa_prepare_iopads
Date: Wed, 16 Sep 2026 19:00:48 +1000	[thread overview]
Message-ID: <aqpawGagrSvRkpTi@gondor.apana.org.au> (raw)
In-Reply-To: <20260831055141.1632832-1-s-vadapalli@ti.com>

On Mon, Aug 31, 2026 at 11:21:38AM +0530, Siddharth Vadapalli wrote:
>
> Since crypto_shash_export() writes 105 bytes into this 104-byte union, it
> overflows by one byte into the adjacent stack frame.

This should be converted to crypto_shash_export_core which exports
just the hash state without the partial block buffer.
 
> Changes since v1:
> - Propagated error from sa_prepare_iopads throughout the call chain.
> - Added missing check for authentication key size being within limits.
> Above changes are based on Sashiko review of the v1 patch at:
> https://sashiko.dev/#/patchset/20260819142357.3950463-1-s-vadapalli%40ti.com

Looks like Sashiko is still not happy:

https://sashiko.dev/#/patchset/20260831055141.1632832-1-s-vadapalli%40ti.com

Let's split this up.  Just do a one-liner to switch shash_export
to shash_export_core, that should fix the stack overrun.  Then
fix the long key issue in a separate patch.

I think you should support long keys properly by hashing them as
crypto/hmac.c does.

Thanks,
-- 
Email: Herbert Xu <herbert@gondor.apana.org.au>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt


  reply	other threads:[~2026-09-16  9:01 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-08-31  5:51 [PATCH v2] crypto: sa2ul - Fix stack overflow in sa_prepare_iopads Siddharth Vadapalli
2026-09-16  9:00 ` Herbert Xu [this message]
2026-09-22 13:03   ` Siddharth Vadapalli
2026-09-23  5:16     ` Eric Biggers

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=aqpawGagrSvRkpTi@gondor.apana.org.au \
    --to=herbert@gondor.apana.org.au \
    --cc=davem@davemloft.net \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-crypto@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=s-vadapalli@ti.com \
    --cc=srk@ti.com \
    --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