From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Google-Smtp-Source: AB8JxZr/mPl4MkwdPfQUscqDn8V4GcPEWOS+8KMwM70mJ1Q7z8/7l0e4HKLF67m+CT3GsAcyEVup ARC-Seal: i=1; a=rsa-sha256; t=1527156080; cv=none; d=google.com; s=arc-20160816; b=WNYxT8LwcLo006wGX8gKCqJ73uNErol7Ojq4kcqFIUBBe4x6mQwXNK72ZJGoF3S/it 1jykVPi+9Jt0EdE8nbCPrvuYnl7rKrxtlLjQguujlgBqae9peOs6I86dc1w0g2sCYpP+ wcrmah1L8GHkiDODoFYbziLNoYnSfEq6fOG8+E4P4VG6VMBODTBDNF8vuBnLakmaB8lO X3jz3be+o7O5jJiuWbootvFw+PLQjHvPWNfOwz5b4r8J2oB9D2eLVZ81PqUC5B5xKGIZ wwEaHV9JRqU2/WKou/j5ogwiW9hZQia+fjJcT9bgak0FtyTAZmj6jp4GyJLMS6KMWrDx k8lQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=mime-version:user-agent:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature:arc-authentication-results; bh=ag7CwEJGAIJKLPZNmqvQoMd6jvUMFN1kVNSmyPWqHxc=; b=SxI0dwnEvfvZc4fv2AmRAdAtxtx3vwQWhYOrylEIvWED8EcoYNb88pdVM5rB1sNBUO tUmkRtIC7NL33RL7xN7hePQ67EKAZAEKk5x6pCd9slsHl3WOJ3uDF+of6Pdwwf3h2G9O WxnY/orqcuuQJqAeaq1oszKz2uOBYcxpl/VtWhripwgirFdwzLKl4WgMqEXcr5t1hlmV vcGlS7FxmJNtqvD/iwV3t5Es4ezF5UKvzHLqXFXmKJ9CdYp8TjIqQrjD015OXSa1o4va qfxp+xFzpeu8AbaXhP04rMm5xcvS5tZRplUzHls9SuMuuvRz3jP/zxDdYqBBicu3n8hT ZNOg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=2hz2PCDo; spf=pass (google.com: domain of srs0=we5z=il=linuxfoundation.org=gregkh@kernel.org designates 198.145.29.99 as permitted sender) smtp.mailfrom=SRS0=We5Z=IL=linuxfoundation.org=gregkh@kernel.org Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=2hz2PCDo; spf=pass (google.com: domain of srs0=we5z=il=linuxfoundation.org=gregkh@kernel.org designates 198.145.29.99 as permitted sender) smtp.mailfrom=SRS0=We5Z=IL=linuxfoundation.org=gregkh@kernel.org From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: Greg Kroah-Hartman , Martin Schwidefsky Subject: [PATCH 4.16 055/161] s390: correct module section names for expoline code revert Date: Thu, 24 May 2018 11:38:00 +0200 Message-Id: <20180524093025.041710235@linuxfoundation.org> X-Mailer: git-send-email 2.17.0 In-Reply-To: <20180524093018.331893860@linuxfoundation.org> References: <20180524093018.331893860@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-LABELS: =?utf-8?b?IlxcU2VudCI=?= X-GMAIL-THRID: =?utf-8?q?1601339214188556824?= X-GMAIL-MSGID: =?utf-8?q?1601339214188556824?= X-Mailing-List: linux-kernel@vger.kernel.org List-ID: 4.16-stable review patch. If anyone has any objections, please let me know. ------------------ From: Martin Schwidefsky [ 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 Signed-off-by: Greg Kroah-Hartman --- arch/s390/kernel/module.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) --- a/arch/s390/kernel/module.c +++ b/arch/s390/kernel/module.c @@ -465,11 +465,11 @@ int module_finalize(const Elf_Ehdr *hdr, apply_alternatives(aseg, aseg + s->sh_size); if (IS_ENABLED(CONFIG_EXPOLINE) && - (!strcmp(".nospec_call_table", secname))) + (!strncmp(".s390_indirect", secname, 14))) nospec_revert(aseg, aseg + s->sh_size); if (IS_ENABLED(CONFIG_EXPOLINE) && - (!strcmp(".nospec_return_table", secname))) + (!strncmp(".s390_return", secname, 12))) nospec_revert(aseg, aseg + s->sh_size); }