Message ID | 167933036157.5837.4212334925051081519.tip-bot2@tip-bot2 |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:604a:0:0:0:0:0 with SMTP id j10csp1321970wrt; Mon, 20 Mar 2023 09:53:47 -0700 (PDT) X-Google-Smtp-Source: AK7set/3p9RKWefx5TR88HY4NrcLCcJKDB0DsOvLoQ+U4TZAeuoL1yDbTGP4rC8bZyUrpk9dWgxx X-Received: by 2002:a17:903:28c5:b0:1a1:cc0c:a5c2 with SMTP id kv5-20020a17090328c500b001a1cc0ca5c2mr4909057plb.62.1679331226923; Mon, 20 Mar 2023 09:53:46 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1679331226; cv=none; d=google.com; s=arc-20160816; b=llKs5KbhY8FWMgrhN8Qt/ow1RcMYXC/3diS7+LCOnwxQvUb76DpT8i8X1RBHRNK0WD A427VgnA1nEIW6LVuw278jN3bLOs0oNQlpQcK5URB3u2v0erhay4qvlHvkXPDAF0mUPo drV3TPzrxg9WXrIZUHz8C95kp8uiMREGBM+TPstFyjK3+tYnYGiReVQPF47L3vU+C/H4 8ABH3YCqPCPGVmMZwepVYRWq4+g3K3doSuDMk4mgcP1l/vqypKf4cZ1Bn6Y4BD0GwkR9 RrER4TxrzYCKQ6dBiJ3Hgl9Myy/Fhxa+roPce3ItoSXrTI3a4iTp2O7zhKJltVslH5d2 F5Ew== 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=AoePcgwjK4gIoR9kptsuLDAiE+CnpWMdx9JDibyAAl0=; b=zNFjC1AeojnGze164blAczZc0NuvX0ZVqxqbZXaOYXVhHH5XGTPf1AB/uoHHylRVvT 0pDa9JzrhbBVJoV0H4phlbaAqaTuFLIFk4vRfjqOgNSECilUZQQvvqXPDdpeCVe3TfM5 ejdU+xeARxmFM/nC+f/QyCitkAcJFLEY3LpIvl7czyiCV/5Z25IPqUDMMdpEkvzWszkE JaeaENbbkMC5t5DdxLlJepjC5d/YxMAB1TOoBnxrS6C1IfsPKJThJ+zVxZOA9bcZV/eR QX5KZx8maIIBSKN+CxSylddsKlVut1xffo3uXS99sVaIwX+2zUOxQr+fJYncdjNaykQ+ y8PQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b="aNkfGxM/"; dkim=neutral (no key) header.i=@linutronix.de header.s=2020e header.b=+DHSHHZv; 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 j12-20020a170903024c00b0019f27fd7cb1si11398258plh.150.2023.03.20.09.53.33; Mon, 20 Mar 2023 09:53:46 -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="aNkfGxM/"; dkim=neutral (no key) header.i=@linutronix.de header.s=2020e header.b=+DHSHHZv; 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 S229949AbjCTQpv (ORCPT <rfc822;pusanteemu@gmail.com> + 99 others); Mon, 20 Mar 2023 12:45:51 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41478 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233176AbjCTQpA (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Mon, 20 Mar 2023 12:45:00 -0400 Received: from galois.linutronix.de (Galois.linutronix.de [193.142.43.55]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E96B419B0; Mon, 20 Mar 2023 09:39:51 -0700 (PDT) Date: Mon, 20 Mar 2023 16:39:21 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1679330361; 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=AoePcgwjK4gIoR9kptsuLDAiE+CnpWMdx9JDibyAAl0=; b=aNkfGxM//rzqWxWcKjYd3+E00mizKEmeUcjtTip7tuRYQ1Fq+bB4Vvj0j2Y6YUqm58PAee tzBYw9WuyAw9wJAY48kZp/fi2NCPf9Udr+EXZ/02qvoTAsk/26XjJhcoB0PC25SrYU8Rfn gU/cp1q8jlANvqi1EsJwbqcKIC2rvILy7gET4J3OrWCBV2ln548jq+X3mIN4ISkSrjp3AR 2vA7XjhDpSR0qgTeQuKtsa/NOvOa40Eu3FINvCu+CJZik73qL+u44gmaxuBpcrCfKj7M4d ginSFFwnTQclB0+Y9kitK0pa/89STsNYsAVyfjvrMSOSLRJ0rpOLr7R4e5N0GQ== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1679330361; 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=AoePcgwjK4gIoR9kptsuLDAiE+CnpWMdx9JDibyAAl0=; b=+DHSHHZv7exM26VABmTEsSdDdDIVZHL4seZ4owZ9Wu9/Z5pTi9XdHoinifnh/4DbOcByPl HWaupIb+ZCYa4pDw== From: "tip-bot2 for Rick Edgecombe" <tip-bot2@linutronix.de> Sender: tip-bot2@linutronix.de Reply-to: linux-kernel@vger.kernel.org To: linux-tip-commits@vger.kernel.org Subject: [tip: x86/shstk] x86/shstk: Wire in shadow stack interface Cc: Rick Edgecombe <rick.p.edgecombe@intel.com>, Dave Hansen <dave.hansen@linux.intel.com>, "Borislav Petkov (AMD)" <bp@alien8.de>, Kees Cook <keescook@chromium.org>, "Mike Rapoport (IBM)" <rppt@kernel.org>, Pengfei Xu <pengfei.xu@intel.com>, John Allen <john.allen@amd.com>, x86@kernel.org, linux-kernel@vger.kernel.org MIME-Version: 1.0 Message-ID: <167933036157.5837.4212334925051081519.tip-bot2@tip-bot2> Robot-ID: <tip-bot2@linutronix.de> Robot-Unsubscribe: Contact <mailto:tglx@linutronix.de> to get blacklisted from these emails Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED,SPF_HELO_NONE, SPF_PASS 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: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1760906420773172304?= X-GMAIL-MSGID: =?utf-8?q?1760906420773172304?= |
Series |
[tip:,x86/shstk] x86/shstk: Wire in shadow stack interface
|
|
Commit Message
tip-bot2 for Thomas Gleixner
March 20, 2023, 4:39 p.m. UTC
The following commit has been merged into the x86/shstk branch of tip: Commit-ID: a7c17fd7d85646d2e1b59384e5d567dc4b228aad Gitweb: https://git.kernel.org/tip/a7c17fd7d85646d2e1b59384e5d567dc4b228aad Author: Rick Edgecombe <rick.p.edgecombe@intel.com> AuthorDate: Sat, 18 Mar 2023 17:15:31 -07:00 Committer: Dave Hansen <dave.hansen@linux.intel.com> CommitterDate: Mon, 20 Mar 2023 09:01:12 -07:00 x86/shstk: Wire in shadow stack interface The kernel now has the main shadow stack functionality to support applications. Wire in the WRSS and shadow stack enable/disable functions into the existing shadow stack API skeleton. Signed-off-by: Rick Edgecombe <rick.p.edgecombe@intel.com> Signed-off-by: Dave Hansen <dave.hansen@linux.intel.com> Reviewed-by: Borislav Petkov (AMD) <bp@alien8.de> Reviewed-by: Kees Cook <keescook@chromium.org> Acked-by: Mike Rapoport (IBM) <rppt@kernel.org> Tested-by: Pengfei Xu <pengfei.xu@intel.com> Tested-by: John Allen <john.allen@amd.com> Tested-by: Kees Cook <keescook@chromium.org> Link: https://lore.kernel.org/all/20230319001535.23210-37-rick.p.edgecombe%40intel.com --- arch/x86/kernel/shstk.c | 8 ++++++++ 1 file changed, 8 insertions(+)
diff --git a/arch/x86/kernel/shstk.c b/arch/x86/kernel/shstk.c index 01b4566..ee89c42 100644 --- a/arch/x86/kernel/shstk.c +++ b/arch/x86/kernel/shstk.c @@ -472,9 +472,17 @@ long shstk_prctl(struct task_struct *task, int option, unsigned long features) return -EINVAL; if (option == ARCH_SHSTK_DISABLE) { + if (features & ARCH_SHSTK_WRSS) + return wrss_control(false); + if (features & ARCH_SHSTK_SHSTK) + return shstk_disable(); return -EINVAL; } /* Handle ARCH_SHSTK_ENABLE */ + if (features & ARCH_SHSTK_SHSTK) + return shstk_setup(); + if (features & ARCH_SHSTK_WRSS) + return wrss_control(true); return -EINVAL; }