From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Google-Smtp-Source: AB8JxZofrN1uIhLvsyGNmLb7nrNLsAkcmnYb7Nu/cZLR0VY5LbCG9GNX/8q2FVNcxDzjRla2C+rs ARC-Seal: i=1; a=rsa-sha256; t=1524837869; cv=none; d=google.com; s=arc-20160816; b=f7ZLjGZQZzz8nZaQESg+Y8KbJaPU6XzfU1ZcZsqjsm18JvKgQCU+xeRgtlmqCH6/20 +i5wkyGAf/BQPZFOEL33FQ3OQ9j+jc/e+bNnn92A10uRe0zeLgNeyAlEgeNxHcj+l2Wp 9BEjTbjkmHWTrciufb9OxXtHs9wJ1korfMgK145qIWwpqYBT0Yu6s8QWBN9nJyYr84vE m0znrfWxCsoVdiF976oEhbxWYO+PHrgx06puyYIZ1IO7UNZxbCJQRo31ZuyonQTl4skj fMfHz6+Nej3UJjoHr7V1OVlsWfnFj3O0+9x7sXnpgTDPzgo/xemV/Mfete1csD98nN78 +Ndw== 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:dmarc-filter:arc-authentication-results; bh=fAjquTd8M09qYGrcyWVm6p2mCNMyrNozt+LwnyRUMTM=; b=0rjlQOTAz/aN6P0TC6TRHRitVj2uYbINv0VKUcj5nAeSuEK9dOB2tMow+WWI7U+5M2 RgNs1SSzG4KIkBWQkDMlj7XP6fDTWxAiCnvlZHQalcm6lv5KnqnZA8LDFxU3y2cF/b+K gwiPvS/vl0YeGNF70109yKbIJ1DuNXni/wN7O2gOCpBncMGuD9/K8xN8+hTnef3yQ8dG rOVyCOelqW09ZWZ/rur/TRQebxycbtgMqikm7GgDAzObFd4OCrfz48ysYW117ucuyduJ 8/hdMSUBf6VXeTYuOQo4gMyC6wzN7VnZVAinxSVcY+s/5nfFQEpBZyZqVsLdMATy1hq3 n9Ag== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of srs0=4/0d=hq=linuxfoundation.org=gregkh@kernel.org designates 198.145.29.99 as permitted sender) smtp.mailfrom=SRS0=4/0d=HQ=linuxfoundation.org=gregkh@kernel.org Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of srs0=4/0d=hq=linuxfoundation.org=gregkh@kernel.org designates 198.145.29.99 as permitted sender) smtp.mailfrom=SRS0=4/0d=HQ=linuxfoundation.org=gregkh@kernel.org DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 20FB821890 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=linuxfoundation.org Authentication-Results: mail.kernel.org; spf=fail smtp.mailfrom=gregkh@linuxfoundation.org From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Martin Schwidefsky Subject: [PATCH 4.9 46/74] s390: correct module section names for expoline code revert Date: Fri, 27 Apr 2018 15:58:36 +0200 Message-Id: <20180427135711.834437440@linuxfoundation.org> X-Mailer: git-send-email 2.17.0 In-Reply-To: <20180427135709.899303463@linuxfoundation.org> References: <20180427135709.899303463@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?1598908200609195840?= X-GMAIL-MSGID: =?utf-8?q?1598908393276368015?= X-Mailing-List: linux-kernel@vger.kernel.org List-ID: 4.9-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 @@ -477,11 +477,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); }