Skip to contentSkip to conversation

arm64: make runtime const not usable by modules

PATCH Applied Jisheng Zhang 2 participants 2 messages Feb 21 – Mar 4 arm64

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 arm64: make runtime const not usable by modules

Similar as commit 284922f4c563 ("x86: uaccess: don't use runtime-const rewriting in modules") does, make arm64's runtime const not usable by modules too, to "make sure this doesn't get forgotten the next time somebody wants to do runtime constant optimizations". The reason is well explained in the above commit: "The runtime-const infrastructure was never designed to handle the modular case, because the constant fixup is only done at boot time for core kernel code."

---
 arch/arm64/include/asm/runtime-const.h | 4 ++++
 1 file changed, 4 insertions(+)
arch/arm64/include/asm/runtime-const.h +4 -0
index be5915669d23..c3dbd3ae68f6 100644
@@ -2,6 +2,10 @@
 #ifndef _ASM_RUNTIME_CONST_H
 #define _ASM_RUNTIME_CONST_H
 
+#ifdef MODULE
+  #error "Cannot use runtime-const infrastructure from modules"
+#endif
+
 #include <asm/cacheflush.h>
 
 /* Sigh. You can still run arm64 in BE mode */
Signature · 1 line
2.51.0
maintainer Applied
#1 lore raw
Quoted 9 lines · Jisheng Zhang

Similar as commit 284922f4c563 ("x86: uaccess: don't use runtime-const rewriting in modules") does, make arm64's runtime const not usable by modules too, to "make sure this doesn't get forgotten the next time somebody wants to do runtime constant optimizations". The reason is well explained in the above commit: "The runtime-const infrastructure was never designed to handle the modular case, because the constant fixup is only done at boot time for core kernel code."

[...]

Applied to arm64 (for-next/fixes), thanks!

[1/1] arm64: make runtime const not usable by modules

      https://git.kernel.org/arm64/c/0100e495cdf0

Cheers,

Signature · 5 lines
Will

https://fixes.arm64.dev
https://next.arm64.dev
https://will.arm64.dev