From patchwork Thu Oct 19 09:40:43 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: tip-bot2 for Thomas Gleixner X-Patchwork-Id: 155407 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:612c:2010:b0:403:3b70:6f57 with SMTP id fe16csp264616vqb; Thu, 19 Oct 2023 02:41:39 -0700 (PDT) X-Google-Smtp-Source: AGHT+IEkNKqPVnhJH8Hqs29aIA6QBY6itBfINPb9OWJZNVEhvdbe/Rg33pK7LRmd1+BSrVBvVPot X-Received: by 2002:a25:76d3:0:b0:d81:754a:7cb8 with SMTP id r202-20020a2576d3000000b00d81754a7cb8mr1690633ybc.65.1697708498825; Thu, 19 Oct 2023 02:41:38 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1697708498; cv=none; d=google.com; s=arc-20160816; b=t1yAnGhuf8+fxFIyu3ks7u5hfbXt7PvAYAFfsSncNiPEhhpqUXUvTAaRslhDdFUery EOTFAK9Ouv7nYFK+zwPntdqZPqFngHFfYDMWZe2zqPF8M6dPs3jF2XeLcDV/Rtoojnpf iwZVr/uQIpCRSlVM7GqmVWzuj3bAa0KGnjEWn4uV/D0U9MLSA411FY7tErgbfpH/INMT h5PQMVuy0zrw0zH3KjkVx+RvZAGQaDtfNmASxD6R525wQqT70kDvAEOZyGqDbUsIllHw H0ARsHD+72fESawRVX1EBfnCJfVQ6fpDbtZCLmzSwAc7na3OcHuwAhv8kSLSF7FRB9ze Sk5A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:robot-unsubscribe :robot-id:message-id:mime-version:references:in-reply-to:cc:subject :to:reply-to:sender:from:dkim-signature:dkim-signature:date; bh=oVvf4IZfAG/kVntUqjLXAm4xY2Be5dfXjuNFxnML5Eo=; fh=eK2OGrsWfkvwkXXTuz7q8gH7b94nYsFVthULcQ+rLdM=; b=EmX0uBgAHUYiXytyUX1VBOom/kZsDiMAcuwDHV3kKMHouBs7Rbfqk8/tgb8fUTs54K MVc5kpd3dTi6Q/n9h3zXg3Uxf1f5b3gjmN6HXKbgy3wdUW7cR9qKAsS/3VlqsC4gUE6J AZW/Fq+YoNyWee8hN7NWIg1aR5AmAJ638XRLhsF35sN/3zN454jzabXXYSJ70OHqxZ3l td7BNYI61TyC9BIOjDXuRxkOr18dG08XhpgC9RRnmTuTKfNlW25KqakJxPkJ1F2F7Yvb ljfRU0RMSL6YHNzX8wpc1+1ypzW92SOAf/BckfZvzQ5aM+XoZFMJo6k4YUPbqFh/JbLF g/MQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=bT4zmeB3; dkim=neutral (no key) header.i=@linutronix.de; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.32 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de Received: from agentk.vger.email (agentk.vger.email. [23.128.96.32]) by mx.google.com with ESMTPS id 142-20020a630294000000b005b83bc299dcsi2372923pgc.538.2023.10.19.02.41.38 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 19 Oct 2023 02:41:38 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.32 as permitted sender) client-ip=23.128.96.32; Authentication-Results: mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=bT4zmeB3; dkim=neutral (no key) header.i=@linutronix.de; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.32 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by agentk.vger.email (Postfix) with ESMTP id 4DD528097E5D; Thu, 19 Oct 2023 02:41:02 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at agentk.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1345017AbjJSJkv (ORCPT + 24 others); Thu, 19 Oct 2023 05:40:51 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53266 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229473AbjJSJks (ORCPT ); Thu, 19 Oct 2023 05:40:48 -0400 Received: from galois.linutronix.de (Galois.linutronix.de [IPv6:2a0a:51c0:0:12e:550::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5BC0E106; Thu, 19 Oct 2023 02:40:46 -0700 (PDT) Date: Thu, 19 Oct 2023 09:40:43 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1697708444; h=from:from:sender:sender:reply-to:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=oVvf4IZfAG/kVntUqjLXAm4xY2Be5dfXjuNFxnML5Eo=; b=bT4zmeB3ff6jv54U6GrVtsRadIxzg1As6Ply5BYKa1gTCSutgK83f9nVyodHIxO6x+OarV rqI+ss6sgMlGmYTkf9WQNP67WN+Xc52YlIolE2vffdJzVhQOcPmnZu+kW+B3w6LV6XbBRR QyNJGOVWUvC+Ks1PkiTvUYD6ainEbOMFcfTeTXoKF6WX7f7gUY/QdY8ZJF1nAoJnhlUTuz Tqamh6olyIEF12UEzUZ89hz4imKaxsJ69hetVYiJql2SCUCdfAf4v/Rq0yWUWIX5npKjo3 amDSVHb2ZAV/4V6PXuS/wUuskf+EoWpPM1JvJIGUrRLVLtzqF1ABts/VD4sCSw== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1697708444; h=from:from:sender:sender:reply-to:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=oVvf4IZfAG/kVntUqjLXAm4xY2Be5dfXjuNFxnML5Eo=; b=hq52O4YsMZP/S2cgmTJitAsPWwQXZpQSMttdBbpHFwgptSxmFyZwM9FTXDd/0NvyD2UMF/ MN1gdg13qOUmsCDg== From: "tip-bot2 for Borislav Petkov (AMD)" Sender: tip-bot2@linutronix.de Reply-to: linux-kernel@vger.kernel.org To: linux-tip-commits@vger.kernel.org Subject: [tip: x86/bugs] Revert "x86/retpoline: Ensure default return thunk isn't used at runtime" Cc: "Borislav Petkov (AMD)" , David Kaplan , x86@kernel.org, linux-kernel@vger.kernel.org In-Reply-To: <20231018175531.GEZTAcE2p92U1AuVp1@fat_crate.local> References: <20231018175531.GEZTAcE2p92U1AuVp1@fat_crate.local> MIME-Version: 1.0 Message-ID: <169770844376.3135.9436969789797102205.tip-bot2@tip-bot2> Robot-ID: Robot-Unsubscribe: Contact to get blacklisted from these emails X-Spam-Status: No, score=-0.8 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on agentk.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (agentk.vger.email [0.0.0.0]); Thu, 19 Oct 2023 02:41:02 -0700 (PDT) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1780176386827652338 X-GMAIL-MSGID: 1780176386827652338 The following commit has been merged into the x86/bugs branch of tip: Commit-ID: 08ec7e82c1e3ebcd79ab8d2d0d11faad0f07e71c Gitweb: https://git.kernel.org/tip/08ec7e82c1e3ebcd79ab8d2d0d11faad0f07e71c Author: Borislav Petkov (AMD) AuthorDate: Thu, 19 Oct 2023 11:04:27 +02:00 Committer: Borislav Petkov (AMD) CommitterDate: Thu, 19 Oct 2023 11:08:22 +02:00 Revert "x86/retpoline: Ensure default return thunk isn't used at runtime" This reverts commit 91174087dcc7565d8bf0d576544e42d5b1de6f39. It turns out that raising an undefined opcode exception due to unpatched return thunks is not visible to users in every possible scenario (not being able to catch dmesg, slow console, etc.). Thus, it is not very friendly to them when the box explodes without even saying why. Revert for now until a better solution has been devised. Signed-off-by: Borislav Petkov (AMD) Cc: David Kaplan Link: https://lore.kernel.org/r/20231018175531.GEZTAcE2p92U1AuVp1@fat_crate.local --- arch/x86/lib/retpoline.S | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/arch/x86/lib/retpoline.S b/arch/x86/lib/retpoline.S index fe05c13..6376d01 100644 --- a/arch/x86/lib/retpoline.S +++ b/arch/x86/lib/retpoline.S @@ -356,17 +356,15 @@ SYM_FUNC_END(call_depth_return_thunk) * This function name is magical and is used by -mfunction-return=thunk-extern * for the compiler to generate JMPs to it. * - * This code is only used during kernel boot. All + * This code is only used during kernel boot or module init. All * 'JMP __x86_return_thunk' sites are changed to something else by * apply_returns(). - * - * This thunk is turned into a ud2 to ensure it is never used at runtime. - * Alternative instructions are applied after apply_returns(). */ SYM_CODE_START(__x86_return_thunk) UNWIND_HINT_FUNC ANNOTATE_NOENDBR - ALTERNATIVE __stringify(ANNOTATE_UNRET_SAFE;ret),"ud2", X86_FEATURE_ALWAYS + ANNOTATE_UNRET_SAFE + ret int3 SYM_CODE_END(__x86_return_thunk) EXPORT_SYMBOL(__x86_return_thunk)