summaryrefslogtreecommitdiffstats
path: root/arch/powerpc/kernel/module.c
diff options
context:
space:
mode:
authorMichal Suchanek <msuchanek@suse.de>2018-04-24 06:15:56 +0200
committerMichael Ellerman <mpe@ellerman.id.au>2018-06-03 12:43:44 +0200
commit815069ca57c142eb71d27439bc27f41a433a67b3 (patch)
tree776b7b8a934e55dd4aaab3e52051b8e8d895dd2d /arch/powerpc/kernel/module.c
parentpowerpc/64s: Add support for ori barrier_nospec patching (diff)
downloadlinux-815069ca57c142eb71d27439bc27f41a433a67b3.tar.xz
linux-815069ca57c142eb71d27439bc27f41a433a67b3.zip
powerpc/64s: Patch barrier_nospec in modules
Note that unlike RFI which is patched only in kernel the nospec state reflects settings at the time the module was loaded. Iterating all modules and re-patching every time the settings change is not implemented. Based on lwsync patching. Signed-off-by: Michal Suchanek <msuchanek@suse.de> Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Diffstat (limited to 'arch/powerpc/kernel/module.c')
-rw-r--r--arch/powerpc/kernel/module.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/arch/powerpc/kernel/module.c b/arch/powerpc/kernel/module.c
index 3f7ba0f5bf29..1b3c6835e730 100644
--- a/arch/powerpc/kernel/module.c
+++ b/arch/powerpc/kernel/module.c
@@ -72,6 +72,12 @@ int module_finalize(const Elf_Ehdr *hdr,
do_feature_fixups(powerpc_firmware_features,
(void *)sect->sh_addr,
(void *)sect->sh_addr + sect->sh_size);
+
+ sect = find_section(hdr, sechdrs, "__spec_barrier_fixup");
+ if (sect != NULL)
+ do_barrier_nospec_fixups_range(barrier_nospec_enabled,
+ (void *)sect->sh_addr,
+ (void *)sect->sh_addr + sect->sh_size);
#endif
sect = find_section(hdr, sechdrs, "__lwsync_fixup");