[PATCH] fixup! lib: add stackprotector support

Ahmad Fatoum a.fatoum at pengutronix.de
Thu Sep 21 01:52:19 PDT 2023


lib: stackprot: annotate stackprot_randomize_guard with __no_stack_protector

stackprot_randomize_guard() changes the stack protector, so it's
important that it can't make use of the stackprotector itself.

Signed-off-by: Ahmad Fatoum <a.fatoum at pengutronix.de>
---
Not a problem in practice unless we use stackprotector-all, which we
don't.
---
 lib/stackprot.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lib/stackprot.c b/lib/stackprot.c
index ca89b37d9042..aa0e88603aae 100644
--- a/lib/stackprot.c
+++ b/lib/stackprot.c
@@ -25,7 +25,7 @@ noinstr void __stack_chk_fail(void)
 }
 EXPORT_SYMBOL(__stack_chk_fail);
 
-static int stackprot_randomize_guard(void)
+static __no_stack_protector int stackprot_randomize_guard(void)
 {
 	return get_crypto_bytes(&__stack_chk_guard, sizeof(__stack_chk_guard));
 }
-- 
2.39.2




More information about the barebox mailing list