Received: by 2002:ac0:a594:0:0:0:0:0 with SMTP id m20-v6csp1954416imm; Thu, 24 May 2018 03:32:44 -0700 (PDT) X-Google-Smtp-Source: AB8JxZro0+wPVsz1/vQWARQ1i7YUwWo0CyNExnlkKyDMYBu0y3Q9nVCzPO0GtVMp/f+6aXkvU6Sq X-Received: by 2002:a17:902:8a87:: with SMTP id p7-v6mr6680401plo.278.1527157964276; Thu, 24 May 2018 03:32:44 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1527157964; cv=none; d=google.com; s=arc-20160816; b=kKr7+e0NCKaZ9hpwtHCQZLMopCv7epJ6hMMtKP8VcCeX7qxBkUSq7hywSTy9lWJNv8 iu8RxazsqQbXXYzYOiCyQfxnZOHW/nIp6BROZQGkQLwaQZZDqbrwRH/WeC9wIEKog8eD DSMuLEw5pkGyKdiY0VpgXp8EyKf5rk/1rBUuD4wD4Tjt9dy0uNC3UyMj1IuNeiXH7R7n ecGIL6HbuHDetzb5PWCrVYWl+U3X+8dxMY19KbpAnuCa//iNwjfBQqp90jjMPH9RSbkP /e0sAPZ5NNHCeYtn01B129B2lC5z38BEmE/BS4onSRrdh6Vw77hqMDD/sPrAjyeDBK7Y Vt7w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:references :in-reply-to:message-id:date:subject:cc:to:from:dkim-signature :arc-authentication-results; bh=ag7CwEJGAIJKLPZNmqvQoMd6jvUMFN1kVNSmyPWqHxc=; b=Mdv9itO6Zx9qiTUBgMufpa4T2ZEMzVZzdDkTk82fDEoYJasQjh8Gd+aZZZIKX+EFRe mptlf5vBfxDcx4uCHCfmwTKlwudFF9lyt2ZFJP25ed7Cdrod/Kdik8HO4GUiQfMYXhN8 CKPQ5kX5cmXo+opw1N/0+KbcdFidExCuLsu/WjRlE6K4PuWWIcMF5wUcNcJyT6+m/ex8 wBxqvHwA4QGIWcddo3gl7IZPmPRFbS5rW2UAFvFqxvdvmUV/3RI2/3HEHHanIoohOcLe ugc16b4+IUj9oEWepPJYLH+HqZMwB1fcm0M0UlidRdVSXpELZyai9ZArV1au19gyxF0Q VI3w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=2hz2PCDo; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id b14-v6si16401725pgv.279.2018.05.24.03.32.29; Thu, 24 May 2018 03:32:44 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=2hz2PCDo; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1032157AbeEXKag (ORCPT + 99 others); Thu, 24 May 2018 06:30:36 -0400 Received: from mail.kernel.org ([198.145.29.99]:46640 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1030879AbeEXKBU (ORCPT ); Thu, 24 May 2018 06:01:20 -0400 Received: from localhost (LFbn-1-12247-202.w90-92.abo.wanadoo.fr [90.92.61.202]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 7093320890; Thu, 24 May 2018 10:01:19 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1527156079; bh=fciEvAjMi1ymU91LK0oDYXFstLjpOz6Det/18i7gaNg=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=2hz2PCDodBfKWr8ciC4F/QsyINc02tXHlTz3sBRt+F0M/gYFIGkGgbArWwIfCNdiB 1dwm3/9LtTML6qaDfZ8pCE1m+INBueZwciKfFGTqm/lgB/AtaVLc+sLHr2sb0+vfPw UW1g8J9fNCvW69cAvF0twRr3SBiWRXBzoBQ6vHBg= 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 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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); }