public inbox for linux-crypto@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] crypto: wp512: disable kmsan checks in wp512_process_buffer()
@ 2022-12-15 16:29 Arnd Bergmann
  2022-12-16 16:08 ` Alexander Potapenko
  2022-12-30 15:14 ` Herbert Xu
  0 siblings, 2 replies; 4+ messages in thread
From: Arnd Bergmann @ 2022-12-15 16:29 UTC (permalink / raw)
  To: Herbert Xu, David S. Miller; +Cc: Arnd Bergmann, linux-crypto, linux-kernel

From: Arnd Bergmann <arnd@arndb.de>

The memory sanitizer causes excessive register spills in this function:

crypto/wp512.c:782:13: error: stack frame size (2104) exceeds limit (2048) in 'wp512_process_buffer' [-Werror,-Wframe-larger-than]

Assume that this one is safe, and mark it as needing no checks to
get the stack usage back down to the normal level.

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
---
 crypto/wp512.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/crypto/wp512.c b/crypto/wp512.c
index 5e820afa3c78..07994e5ebf4e 100644
--- a/crypto/wp512.c
+++ b/crypto/wp512.c
@@ -779,7 +779,7 @@ static const u64 rc[WHIRLPOOL_ROUNDS] = {
  * The core Whirlpool transform.
  */
 
-static void wp512_process_buffer(struct wp512_ctx *wctx) {
+static __no_kmsan_checks void wp512_process_buffer(struct wp512_ctx *wctx) {
 	int i, r;
 	u64 K[8];        /* the round key */
 	u64 block[8];    /* mu(buffer) */
-- 
2.35.1


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH] crypto: wp512: disable kmsan checks in wp512_process_buffer()
  2022-12-15 16:29 [PATCH] crypto: wp512: disable kmsan checks in wp512_process_buffer() Arnd Bergmann
@ 2022-12-16 16:08 ` Alexander Potapenko
  2022-12-16 18:29   ` Arnd Bergmann
  2022-12-30 15:14 ` Herbert Xu
  1 sibling, 1 reply; 4+ messages in thread
From: Alexander Potapenko @ 2022-12-16 16:08 UTC (permalink / raw)
  To: arnd; +Cc: arnd, davem, herbert, linux-crypto, linux-kernel

> The memory sanitizer causes excessive register spills in this function:

> crypto/wp512.c:782:13: error: stack frame size (2104) exceeds limit (2048) in 'wp512_process_buffer' [-Werror,-Wframe-larger-than]

> Assume that this one is safe, and mark it as needing no checks to
> get the stack usage back down to the normal level.

KMSAN indeed bloats the stack frames heavily.
Wouldn't it be more preferable to further increase KMSAN's -Wframe-larger-than limit instead?
It is not intended for production anyway, and detecting a runtime stack overflow in the debug mode should not be a problem.

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] crypto: wp512: disable kmsan checks in wp512_process_buffer()
  2022-12-16 16:08 ` Alexander Potapenko
@ 2022-12-16 18:29   ` Arnd Bergmann
  0 siblings, 0 replies; 4+ messages in thread
From: Arnd Bergmann @ 2022-12-16 18:29 UTC (permalink / raw)
  To: Alexander Potapenko, Arnd Bergmann
  Cc: David S . Miller, Herbert Xu, linux-crypto, linux-kernel

On Fri, Dec 16, 2022, at 17:08, Alexander Potapenko wrote:
>> The memory sanitizer causes excessive register spills in this function:
>
>> crypto/wp512.c:782:13: error: stack frame size (2104) exceeds limit (2048) in 'wp512_process_buffer' [-Werror,-Wframe-larger-than]
>
>> Assume that this one is safe, and mark it as needing no checks to
>> get the stack usage back down to the normal level.
>
> KMSAN indeed bloats the stack frames heavily.
> Wouldn't it be more preferable to further increase KMSAN's 
> -Wframe-larger-than limit instead?
> It is not intended for production anyway, and detecting a runtime stack 
> overflow in the debug mode should not be a problem.

I don't actually see a lot of compiler warnings with KMSAN
hitting the limit, I think we can deal with them individually.

I'd rather not raise the limit more, as that makes it harder
to identify functions that use more stack than they should.

    Arnd

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] crypto: wp512: disable kmsan checks in wp512_process_buffer()
  2022-12-15 16:29 [PATCH] crypto: wp512: disable kmsan checks in wp512_process_buffer() Arnd Bergmann
  2022-12-16 16:08 ` Alexander Potapenko
@ 2022-12-30 15:14 ` Herbert Xu
  1 sibling, 0 replies; 4+ messages in thread
From: Herbert Xu @ 2022-12-30 15:14 UTC (permalink / raw)
  To: Arnd Bergmann; +Cc: David S. Miller, Arnd Bergmann, linux-crypto, linux-kernel

On Thu, Dec 15, 2022 at 05:29:38PM +0100, Arnd Bergmann wrote:
> From: Arnd Bergmann <arnd@arndb.de>
> 
> The memory sanitizer causes excessive register spills in this function:
> 
> crypto/wp512.c:782:13: error: stack frame size (2104) exceeds limit (2048) in 'wp512_process_buffer' [-Werror,-Wframe-larger-than]
> 
> Assume that this one is safe, and mark it as needing no checks to
> get the stack usage back down to the normal level.
> 
> Signed-off-by: Arnd Bergmann <arnd@arndb.de>
> ---
>  crypto/wp512.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)

Patch applied.  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

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2022-12-30 15:14 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-12-15 16:29 [PATCH] crypto: wp512: disable kmsan checks in wp512_process_buffer() Arnd Bergmann
2022-12-16 16:08 ` Alexander Potapenko
2022-12-16 18:29   ` Arnd Bergmann
2022-12-30 15:14 ` Herbert Xu

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox