]> git.hungrycats.org Git - linux/commit
s390: correct module section names for expoline code revert
authorMartin Schwidefsky <schwidefsky@de.ibm.com>
Wed, 23 May 2018 16:22:23 +0000 (18:22 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 25 May 2018 14:46:07 +0000 (16:46 +0200)
commit5997d61ea7f9b7ebe6d44f4d1406a70f2e9c0bfd
tree0fac1d0ab5055267dd118bf5ac13bab00902d7d9
parentac8523574f17df2682ad060ca0783c8f5d3c597f
s390: correct module section names for expoline code revert

[ Upstream commit 6cf09958f32b9667bb3ebadf74367c791112771b ]

The main linker script vmlinux.lds.S for the kernel image merges
the expoline code patch tables into two section ".nospec_call_table"
and ".nospec_return_table". This is *not* done for the modules,
there the sections retain their original names as generated by gcc:
".s390_indirect_call", ".s390_return_mem" and ".s390_return_reg".

The module_finalize code has to check for the compiler generated
section names, otherwise no code patching is done. This slows down
the module code in case of "spectre_v2=off".

Cc: stable@vger.kernel.org # 4.16
Fixes: f19fbd5ed6 ("s390: introduce execute-trampolines for branches")
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
arch/s390/kernel/module.c