From patchwork Mon Jul 10 08:13:58 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: 117709 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:9f45:0:b0:3ea:f831:8777 with SMTP id v5csp4873213vqx; Mon, 10 Jul 2023 01:36:27 -0700 (PDT) X-Google-Smtp-Source: APBJJlE1h0rUAdRr3nezOJGTaBWYfMLkJiWmK7O16GUrcYjjUyqIBWJGZpy7ig1ZLNcVYloardTK X-Received: by 2002:ac2:498e:0:b0:4f8:6abe:5249 with SMTP id f14-20020ac2498e000000b004f86abe5249mr8804860lfl.3.1688978187190; Mon, 10 Jul 2023 01:36:27 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1688978187; cv=none; d=google.com; s=arc-20160816; b=Xp/QAr81IBdSkm1ai0/otXQohqAvgzFJals127AEs7RYGPRqGTFCBlUCMlzxW35pFo NTWYcoglMfreMZ30gV7u3H7q5dBjpKMhqVbf439PicZsAVFN4JHPvBBbMpzCn99QSHGP CoaEzOWbt9G3yYWuXiWha7rsghkA2WGytzpOjq54ATA3+vpjqGYJ7YgipNmZpeXt4hyM y/DAJBSYW5VbXimQJkyUHHOlO53lIBK9lXYyFT8plcxG1Sm7jT8JMBdFglBHBMoSvEOj 85qXJ6shu3xY49YC/kdDavTCoPmJ/awbTFA38CVSATM4qB/8lVW9UQ4EWUWcqfu+qz/L WEXw== 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:cc:subject:to:reply-to:sender:from :dkim-signature:dkim-signature:date; bh=kbBlRYtDCHZkO48Xq/c2gicY7m6ZLit+ZxrtxvK05ak=; fh=WrTkmvbUhUL1JAx9opISSeuQ7s/DaIYzBSQVdB2wGU4=; b=TWDN7JQi34r6+KF9b77wi93PcqkYiupESYpXS/ogOKsjU9j/LzsN9W2+25G8iUK5yh B20oMX/5o/trl08FwuXRLxnW5djSbEpTOWBujIKugLjEQNvNG1nf7nLMIJCbICYU6sq+ P52G1llRg61kQ0riLSh/Ql6LXJHjKNrhLtskCH/y43YfwyeqiLAea6y6x5Bcuz+2b47U tEmcJc+zxcm4GUr5soX1ZB86L7cbwFk83X4awDTjctp+Fc1nKvqqLQK1/5OtJg6nxdAZ k/y9swG4cveA6bKfwSfuY2yqfmkcfTGt7kIguMxogsqW+o7jMjt9XJj2uk1O3Hq5usg8 99BA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=1IHDsNXN; dkim=neutral (no key) header.i=@linutronix.de header.b=P5MI63yb; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 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 (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id q18-20020a170906361200b0098655fb6608si8703850ejb.158.2023.07.10.01.36.03; Mon, 10 Jul 2023 01:36:27 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=1IHDsNXN; dkim=neutral (no key) header.i=@linutronix.de header.b=P5MI63yb; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232957AbjGJIP1 (ORCPT + 99 others); Mon, 10 Jul 2023 04:15:27 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38618 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229805AbjGJIOY (ORCPT ); Mon, 10 Jul 2023 04:14:24 -0400 Received: from galois.linutronix.de (Galois.linutronix.de [193.142.43.55]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 88242118; Mon, 10 Jul 2023 01:14:00 -0700 (PDT) Date: Mon, 10 Jul 2023 08:13:58 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1688976839; 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; bh=kbBlRYtDCHZkO48Xq/c2gicY7m6ZLit+ZxrtxvK05ak=; b=1IHDsNXN3CQage9sR5uyMDyyPha040tcxmrkF5k75Xr84nm0ersv3gkiav+rScPCpF0Ga1 qI9XV08eg56YHuZ4YC/AlkPCjmQIDS6Z6PDhzrBILF0F4mR6wbYd81hdCQnDGbVHo0FpCY rYpuTPhlC13Z1rzDndUOgikXs1r2RKVw/VTUO3ybE0riSak7GqfjPpc6sQecm5G4+wbaE9 8ntfXPlFunzTq2knXROQRJZq3J1M2Sv4DbWy3dE8T4t1wlk94WyNlvghS3ff2DR2BUDcI8 KpgGLdJWKOyKfxnMSC0nuTv+xqu1A9vBprnIb/H3QVaT6AMBoJAPR2ObRn9dGQ== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1688976839; 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; bh=kbBlRYtDCHZkO48Xq/c2gicY7m6ZLit+ZxrtxvK05ak=; b=P5MI63ybiMlI45LbveuPELNkQDAbbpYHcGN/+sOeAq9Sr2KdAUNeKKKMjzT+nfSd2GZFJv pmRZNZcAfrWMNjCg== From: "tip-bot2 for Peter Zijlstra" Sender: tip-bot2@linutronix.de Reply-to: linux-kernel@vger.kernel.org To: linux-tip-commits@vger.kernel.org Subject: [tip: x86/urgent] x86/cfi: Extend {JMP,CAKK}_NOSPEC comment Cc: "Peter Zijlstra (Intel)" , Kees Cook , Sami Tolvanen , x86@kernel.org, linux-kernel@vger.kernel.org MIME-Version: 1.0 Message-ID: <168897683854.404.12338449674612649088.tip-bot2@tip-bot2> Robot-ID: Robot-Unsubscribe: Contact to get blacklisted from these emails X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_BLOCKED, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1771021991181333359 X-GMAIL-MSGID: 1771021991181333359 The following commit has been merged into the x86/urgent branch of tip: Commit-ID: 0479a42d4c15bd554f54d89d12bf68218e3e70da Gitweb: https://git.kernel.org/tip/0479a42d4c15bd554f54d89d12bf68218e3e70da Author: Peter Zijlstra AuthorDate: Thu, 22 Jun 2023 16:27:13 +02:00 Committer: Peter Zijlstra CommitterDate: Mon, 10 Jul 2023 09:52:23 +02:00 x86/cfi: Extend {JMP,CAKK}_NOSPEC comment With the introduction of kCFI these helpers are no longer equivalent to C indirect calls and should be used with care. Signed-off-by: Peter Zijlstra (Intel) Reviewed-by: Kees Cook Reviewed-by: Sami Tolvanen Link: https://lkml.kernel.org/r/20230622144321.360957723%40infradead.org --- arch/x86/include/asm/nospec-branch.h | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/arch/x86/include/asm/nospec-branch.h b/arch/x86/include/asm/nospec-branch.h index 55388c9..1a65cf4 100644 --- a/arch/x86/include/asm/nospec-branch.h +++ b/arch/x86/include/asm/nospec-branch.h @@ -234,6 +234,10 @@ * JMP_NOSPEC and CALL_NOSPEC macros can be used instead of a simple * indirect jmp/call which may be susceptible to the Spectre variant 2 * attack. + * + * NOTE: these do not take kCFI into account and are thus not comparable to C + * indirect calls, take care when using. The target of these should be an ENDBR + * instruction irrespective of kCFI. */ .macro JMP_NOSPEC reg:req #ifdef CONFIG_RETPOLINE