linux-crypto.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] lib/crypto: tests: Annotate worker to be on stack
@ 2025-07-21 23:19 Guenter Roeck
  2025-07-22  0:05 ` Ard Biesheuvel
  2025-07-22  3:16 ` Eric Biggers
  0 siblings, 2 replies; 8+ messages in thread
From: Guenter Roeck @ 2025-07-21 23:19 UTC (permalink / raw)
  To: Eric Biggers
  Cc: Jason A . Donenfeld, Ard Biesheuvel, linux-crypto, linux-kernel,
	Guenter Roeck

The following warning traceback is seen if object debugging is enabled
with the new crypto test code.

ODEBUG: object 9000000106237c50 is on stack 9000000106234000, but NOT annotated.
------------[ cut here ]------------
WARNING: lib/debugobjects.c:655 at lookup_object_or_alloc.part.0+0x19c/0x1f4, CPU#0: kunit_try_catch/468
...

This also results in a boot stall when running the code in qemu:loongarch.

Initializing the worker with INIT_WORK_ONSTACK() fixes the problem.

Cc: Eric Biggers <ebiggers@kernel.org>
Fixes: 950a81224e8b ("lib/crypto: tests: Add hash-test-template.h and gen-hash-testvecs.py")
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
---
 lib/crypto/tests/hash-test-template.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lib/crypto/tests/hash-test-template.h b/lib/crypto/tests/hash-test-template.h
index ffee1741a1b3..f437a0a9ac6c 100644
--- a/lib/crypto/tests/hash-test-template.h
+++ b/lib/crypto/tests/hash-test-template.h
@@ -398,7 +398,7 @@ static void run_irq_test(struct kunit *test, bool (*func)(void *),
 	 */
 	hrtimer_setup_on_stack(&state.timer, hash_irq_test_timer_func,
 			       CLOCK_MONOTONIC, HRTIMER_MODE_REL_HARD);
-	INIT_WORK(&state.bh_work, hash_irq_test_bh_work_func);
+	INIT_WORK_ONSTACK(&state.bh_work, hash_irq_test_bh_work_func);
 
 	/* Run for up to max_iterations or 1 second, whichever comes first. */
 	end_jiffies = jiffies + HZ;
-- 
2.45.2


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

end of thread, other threads:[~2025-07-24 18:30 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-07-21 23:19 [PATCH] lib/crypto: tests: Annotate worker to be on stack Guenter Roeck
2025-07-22  0:05 ` Ard Biesheuvel
2025-07-22  3:16 ` Eric Biggers
2025-07-24 14:19   ` Guenter Roeck
2025-07-24 16:26     ` Eric Biggers
2025-07-24 17:03       ` Guenter Roeck
2025-07-24 17:36         ` Eric Biggers
2025-07-24 18:29           ` Guenter Roeck

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).