]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
powerpc/vdso: Mark the vDSO code read-only after init
authorChristophe Leroy <christophe.leroy@csgroup.eu>
Sat, 14 Dec 2024 11:09:31 +0000 (12:09 +0100)
committerMadhavan Srinivasan <maddy@linux.ibm.com>
Wed, 18 Dec 2024 08:16:38 +0000 (13:46 +0530)
VDSO text is fixed-up during init so it can't be const,
but it can be read-only after init.

Do the same as x86 in commit 018ef8dcf3de ("x86/vdso: Mark the vDSO
code read-only after init") and arm in commit 11bf9b865898 ("ARM/vdso:
Mark the vDSO code read-only after init"), move it into
ro_after_init section.

Signed-off-by: Christophe Leroy <christophe.leroy@csgroup.eu>
Signed-off-by: Madhavan Srinivasan <maddy@linux.ibm.com>
Link: https://patch.msgid.link/e9892d288b646cbdfeef0b2b73edbaf6d3c6cabe.1734174500.git.christophe.leroy@csgroup.eu
arch/powerpc/kernel/vdso32_wrapper.S
arch/powerpc/kernel/vdso64_wrapper.S

index 10f92f265d511b030e96f89ad5571d2ac3690f0d..20bca3548b44d3e8d44a444cd103ad53cf736ec3 100644 (file)
@@ -2,7 +2,7 @@
 #include <linux/linkage.h>
 #include <asm/page.h>
 
-       __PAGE_ALIGNED_DATA
+       .section ".data..ro_after_init", "aw"
 
        .globl vdso32_start, vdso32_end
        .balign PAGE_SIZE
index 839d1a61411d6fc3af9b88fe4dd448cf07f954e7..1912936fa227e66d1f5da8afb1344b1a65568f1d 100644 (file)
@@ -2,7 +2,7 @@
 #include <linux/linkage.h>
 #include <asm/page.h>
 
-       __PAGE_ALIGNED_DATA
+       .section ".data..ro_after_init", "aw"
 
        .globl vdso64_start, vdso64_end
        .balign PAGE_SIZE