Received: by 2002:a05:6500:1b45:b0:1f5:f2ab:c469 with SMTP id cz5csp740143lqb; Wed, 17 Apr 2024 09:20:57 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCX/u3QZT/nAvuC5EHskFtyUZDvM0XJjdWrpc1PNIDsiVl3t+D/BcYG/vRD3VzGU9T6q82vgk+9IuD/N/qsgOSmzgkHZ0P6D0ZYa+vSlNg== X-Google-Smtp-Source: AGHT+IF3DceltBNvPWFGh3sgaPv4RZpkB1C4OR3ZJTn53oQtFH9JkdAH5oSRMjXFyAQL67FOT/VJ X-Received: by 2002:a05:620a:40d3:b0:78e:e2e2:92a3 with SMTP id g19-20020a05620a40d300b0078ee2e292a3mr13459930qko.17.1713370856988; Wed, 17 Apr 2024 09:20:56 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1713370856; cv=pass; d=google.com; s=arc-20160816; b=Hj0rVz7DasLDmsT1y0FVm4w5ZlJ+ZFxpCre5if9yezZdUIHxRNhcKCLco/WQtmBGJW MpEgXRp9vgIe1ef6jF7+h4YHQiPJq2KDPJWa8VY799APFyKKjzIF1DZS7VMaYg1uDUWF OAlzRSBprkCE/ZghMe0mtHz1zPb0Sj7SAumt8KirbAVKyOhomMECYv1hlQ0cGHQEc38H yAI45sWxGk68Hwi7axrhLIPxBi3kktISXhBkzcpkXr2K3Jz5GAvqRIvZE5Dl+MBFaVEX HK6FcjPjNmPsMN0vgwmTX0HJZXbZ4n4+cVEowFwoHuimFDcx+nlo7PUJnqfDy753ybS1 6xzQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:precedence:robot-unsubscribe:robot-id :message-id:mime-version:list-unsubscribe:list-subscribe:list-id :precedence:references:in-reply-to:cc:subject:to:reply-to:sender :from:dkim-signature:dkim-signature:date; bh=kwzTSJdCNy24smZLpTE4WljCedgTHM2JpxAfIkTwyt4=; fh=hSP08BQMoYAio5BcN0f0CC03yZcvvqnjtI9EHvyvfv0=; b=eioxJpTt1tZBJg+VZsMGr9PPihbw6QvKR354SHTjjcuaZfaChC1MpCMfnHX79mJ5ai +wMs82p4r80RQRCapA7UAJv0X2gmpoQfTYFcxaMk0T+TL6Cp58KycczdLUu+hLY0DLHT IvIRAAKQtIfyTQ4GgcRgOF4fOxjQqr1e833IeF5Eu9rITneBsh/hjVZDgc2nW6GbgzUL 1mLqq5X0VpsN/0lumSVcFzLgkjl0Lq2sjEwDDjKPHndOjQ/QFwrryBSTbkbfSiVkMRNS E3bgpUzYTlw2etpjkHVcx/rs5G7El0rcQUGuoRAo0SuUvrwogf6YHQgEmt5/+mof0Jql 4z8g==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b="dhjPI/0V"; dkim=neutral (no key) header.i=@linutronix.de header.s=2020e; arc=pass (i=1 spf=pass spfdomain=linutronix.de dkim=pass dkdomain=linutronix.de dmarc=pass fromdomain=linutronix.de); spf=pass (google.com: domain of linux-kernel+bounces-148897-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-148897-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [147.75.199.223]) by mx.google.com with ESMTPS id t20-20020a05620a0b1400b0078e8cf3fc80si14900838qkg.175.2024.04.17.09.20.56 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 17 Apr 2024 09:20:56 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-148897-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) client-ip=147.75.199.223; Authentication-Results: mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b="dhjPI/0V"; dkim=neutral (no key) header.i=@linutronix.de header.s=2020e; arc=pass (i=1 spf=pass spfdomain=linutronix.de dkim=pass dkdomain=linutronix.de dmarc=pass fromdomain=linutronix.de); spf=pass (google.com: domain of linux-kernel+bounces-148897-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-148897-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ny.mirrors.kernel.org (Postfix) with ESMTPS id B20AA1C210FA for ; Wed, 17 Apr 2024 16:20:56 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 39549148842; Wed, 17 Apr 2024 16:20:46 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="dhjPI/0V"; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="+gOervJP" Received: from galois.linutronix.de (Galois.linutronix.de [193.142.43.55]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id E52E81411E5; Wed, 17 Apr 2024 16:20:43 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=193.142.43.55 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713370845; cv=none; b=WW1CDiQ7s/z7CklUkMuYbwxcX0tQgVYJMDaIko+fvh5Dkm7tw20lsA3ufxadPqjcOsT0NYX7qK5UvXUBd3LgtFqW+kxMiMSedMm7KPRuOuqAhWeY4/5RijfjdIAU0DHGRgqY253S/2W7Izt7abQK+mhZmFQ7uvvigdIU7AW7dfU= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713370845; c=relaxed/simple; bh=WvRqDAOGM1jvsBeaH6GT/HasZDYxKW3jTSqaapCeaOc=; h=Date:From:To:Subject:Cc:In-Reply-To:References:MIME-Version: Message-ID:Content-Type; b=QJ9JD8V64PdkkgL7JQzKOHmU9DPuc9syXxBv7mJGxZwuV4onEGjMzUer2EldVoGWJtNIl6OjU2kCAgqqx05fg8wqjNrLkbjJwOOztLKKkv0IBGWSbnPrpr/05j4t81xoqZM+GQ4KEoFHjGilWgwYRFpcYf3iiEnqODEO2beC1EE= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linutronix.de; spf=pass smtp.mailfrom=linutronix.de; dkim=pass (2048-bit key) header.d=linutronix.de header.i=@linutronix.de header.b=dhjPI/0V; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b=+gOervJP; arc=none smtp.client-ip=193.142.43.55 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linutronix.de Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linutronix.de Date: Wed, 17 Apr 2024 16:20:40 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1713370842; 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=kwzTSJdCNy24smZLpTE4WljCedgTHM2JpxAfIkTwyt4=; b=dhjPI/0VMdBSkBl5XfFat0CCFcC2C7scN+JK4fOhgFkYZ0zMSbgBQ4nRPo4Yf9UUUUsz4O kA6URHBuae14lTdrU6fxY0HWnQQ7g+YHj+eJQy5T0PLHvh3WBUk/H8nt0IcNhA1uBU5K+j dvPxcW7esf6UN0riWxiAHY3oNliUfofRAP9jINefZdwbdHa5WBjIJUiQgtvg22IgKCyhkO ZOhSXjIOooA+/BS1YS+5nB5wzrpgHBxu61GIjRFc5I8uAv4hEicYYE1mlnSIx3x8FsfViG 603m0MUCwJ481c96FnuYfU1VTVZ/0a/SKnzyC89RVuEdBEYbxy5tnWbBMkVoSw== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1713370842; 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=kwzTSJdCNy24smZLpTE4WljCedgTHM2JpxAfIkTwyt4=; b=+gOervJPalJBHPT1qUYoVzl4s1Niik0HwXr76RGPGP/ibokO7i6Q3yEFXIV4sHGwl1AQ6E tYIizffTqQS7ctBA== 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/urgent] x86/retpolines: Enable the default thunk warning only on relevant configs Cc: Klara Modin , Erhard Furtner , "Borislav Petkov (AMD)" , x86@kernel.org, linux-kernel@vger.kernel.org In-Reply-To: <78e0d19c-b77a-4169-a80f-2eef91f4a1d6@gmail.com> References: <78e0d19c-b77a-4169-a80f-2eef91f4a1d6@gmail.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-ID: <171337084085.10875.15469076883683682514.tip-bot2@tip-bot2> Robot-ID: Robot-Unsubscribe: Contact to get blacklisted from these emails Precedence: bulk Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit The following commit has been merged into the x86/urgent branch of tip: Commit-ID: 6376306adde5b252ee7c73572e35d13fb13f6f18 Gitweb: https://git.kernel.org/tip/6376306adde5b252ee7c73572e35d13fb13f6f18 Author: Borislav Petkov (AMD) AuthorDate: Mon, 15 Apr 2024 18:15:43 +02:00 Committer: Borislav Petkov (AMD) CommitterDate: Wed, 17 Apr 2024 18:02:05 +02:00 x86/retpolines: Enable the default thunk warning only on relevant configs The using-default-thunk warning check makes sense only with configurations which actually enable the special return thunks. Otherwise, it fires on unrelated 32-bit configs on which the special return thunks won't even work (they're 64-bit only) and, what is more, those configs even go off into the weeds when booting in the alternatives patching code, leading to a dead machine. Fixes: 4461438a8405 ("x86/retpoline: Ensure default return thunk isn't used at runtime") Reported-by: Klara Modin Reported-by: Erhard Furtner Signed-off-by: Borislav Petkov (AMD) Tested-by: Klara Modin Link: https://lore.kernel.org/r/78e0d19c-b77a-4169-a80f-2eef91f4a1d6@gmail.com Link: https://lore.kernel.org/r/20240413024956.488d474e@yea --- arch/x86/lib/retpoline.S | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/arch/x86/lib/retpoline.S b/arch/x86/lib/retpoline.S index e674ccf..391059b 100644 --- a/arch/x86/lib/retpoline.S +++ b/arch/x86/lib/retpoline.S @@ -382,8 +382,15 @@ SYM_FUNC_END(call_depth_return_thunk) SYM_CODE_START(__x86_return_thunk) UNWIND_HINT_FUNC ANNOTATE_NOENDBR +#if defined(CONFIG_MITIGATION_UNRET_ENTRY) || \ + defined(CONFIG_MITIGATION_SRSO) || \ + defined(CONFIG_MITIGATION_CALL_DEPTH_TRACKING) ALTERNATIVE __stringify(ANNOTATE_UNRET_SAFE; ret), \ "jmp warn_thunk_thunk", X86_FEATURE_ALWAYS +#else + ANNOTATE_UNRET_SAFE + ret +#endif int3 SYM_CODE_END(__x86_return_thunk) EXPORT_SYMBOL(__x86_return_thunk)