Message ID | 20221203003606.6838-35-rick.p.edgecombe@intel.com (mailing list archive) |
---|---|
State | New |
Headers | show
Return-Path: <owner-linux-mm@kvack.org> X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id B62FAC47088 for <linux-mm@archiver.kernel.org>; Sat, 3 Dec 2022 00:37:46 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 342AA6B0085; Fri, 2 Dec 2022 19:37:46 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 2FE5E6B0083; Fri, 2 Dec 2022 19:37:46 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 11BA76B0085; Fri, 2 Dec 2022 19:37:46 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0017.hostedemail.com [216.40.44.17]) by kanga.kvack.org (Postfix) with ESMTP id EE1596B0082 for <linux-mm@kvack.org>; Fri, 2 Dec 2022 19:37:45 -0500 (EST) Received: from smtpin19.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay06.hostedemail.com (Postfix) with ESMTP id D02B8AB7BD for <linux-mm@kvack.org>; Sat, 3 Dec 2022 00:37:45 +0000 (UTC) X-FDA: 80199132090.19.5FCB7B0 Received: from mga11.intel.com (mga11.intel.com [192.55.52.93]) by imf12.hostedemail.com (Postfix) with ESMTP id 3B86640005 for <linux-mm@kvack.org>; Sat, 3 Dec 2022 00:37:45 +0000 (UTC) Authentication-Results: imf12.hostedemail.com; dkim=pass header.d=intel.com header.s=Intel header.b=K0hkIfHH; spf=pass (imf12.hostedemail.com: domain of rick.p.edgecombe@intel.com designates 192.55.52.93 as permitted sender) smtp.mailfrom=rick.p.edgecombe@intel.com; dmarc=pass (policy=none) header.from=intel.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1670027865; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:content-type: content-transfer-encoding:in-reply-to:in-reply-to: references:references:dkim-signature; bh=uvxv1iubneua9nCs2uvSGpfhBBq803f1R3WCljoUdUo=; b=cTVE16Gi92SBKrQb2MqGoaypXY43GtyCojmOa5E4wxcQwGw4tHwcgRICg1kE3qHzdP+B6A oKUaJCEQ4GtwFOqsCo23708nmghQW1SPtJNiNNzeuuU9n4tdXKOQlkjlqGAZmucrDz+5Aw UuLpvPjPdJz4ERRM/tqlGkgh5UTNwpI= ARC-Authentication-Results: i=1; imf12.hostedemail.com; dkim=pass header.d=intel.com header.s=Intel header.b=K0hkIfHH; spf=pass (imf12.hostedemail.com: domain of rick.p.edgecombe@intel.com designates 192.55.52.93 as permitted sender) smtp.mailfrom=rick.p.edgecombe@intel.com; dmarc=pass (policy=none) header.from=intel.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1670027865; a=rsa-sha256; cv=none; b=lnVuE7n2OAKC3lHR+TyFf6prgLHadjM6G4Pj+1EXncuR+hsZEGtA87r+iYK0mUfqyZQSQ5 MqYTrwyzi2skYOpweRp+BxqORqRyv7jsEVePlhDlo1TPK/+Wt2P1zol3z6fH2K6py14iDO QfAc6HiRtJnbdikaIwb6n4qB0JF/Fio= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1670027865; x=1701563865; h=from:to:cc:subject:date:message-id:in-reply-to: references; bh=tLQzvtFCG7gPr37x5ob+Amj80mPdYmHi/Bjvakhw+Z8=; b=K0hkIfHHJdPdSz0RWNOtRqnYl+XRcJsvlMcIShKXrE/vddPZvFmC/NlO nHSYSJe4jmFnvFghsKukCfb3f+nRamuS/poiv49x6VnbdtYOWlwlo0GEQ 6904oWA/i00x70jDAGOQG7xWTdlPnu9UtCGX5AOae3orzw+tVxv3Bj8dv xnDT+/bMhOpGEFNtlD+3TTsSjvhqn/oLSsbM3GX99wycIdI3kSYMZhYlG NESrAjwtQq3a0YTmG1Xfo0y1DzGIHTl9JPErgE/cAwbBsoAguZX1HuQx1 wisMIjcP1mrG4UY7woNFYVn1H0hChZiAUfLhCJVw7tFErK/wbOJiPg+tI g==; X-IronPort-AV: E=McAfee;i="6500,9779,10549"; a="313711542" X-IronPort-AV: E=Sophos;i="5.96,213,1665471600"; d="scan'208";a="313711542" Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by fmsmga102.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 02 Dec 2022 16:37:44 -0800 X-IronPort-AV: E=McAfee;i="6500,9779,10549"; a="787480020" X-IronPort-AV: E=Sophos;i="5.96,213,1665471600"; d="scan'208";a="787480020" Received: from bgordon1-mobl1.amr.corp.intel.com (HELO rpedgeco-desk.amr.corp.intel.com) ([10.212.211.211]) by fmsmga001-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 02 Dec 2022 16:37:42 -0800 From: Rick Edgecombe <rick.p.edgecombe@intel.com> To: x86@kernel.org, "H . Peter Anvin" <hpa@zytor.com>, Thomas Gleixner <tglx@linutronix.de>, Ingo Molnar <mingo@redhat.com>, linux-kernel@vger.kernel.org, linux-doc@vger.kernel.org, linux-mm@kvack.org, linux-arch@vger.kernel.org, linux-api@vger.kernel.org, Arnd Bergmann <arnd@arndb.de>, Andy Lutomirski <luto@kernel.org>, Balbir Singh <bsingharora@gmail.com>, Borislav Petkov <bp@alien8.de>, Cyrill Gorcunov <gorcunov@gmail.com>, Dave Hansen <dave.hansen@linux.intel.com>, Eugene Syromiatnikov <esyr@redhat.com>, Florian Weimer <fweimer@redhat.com>, "H . J . Lu" <hjl.tools@gmail.com>, Jann Horn <jannh@google.com>, Jonathan Corbet <corbet@lwn.net>, Kees Cook <keescook@chromium.org>, Mike Kravetz <mike.kravetz@oracle.com>, Nadav Amit <nadav.amit@gmail.com>, Oleg Nesterov <oleg@redhat.com>, Pavel Machek <pavel@ucw.cz>, Peter Zijlstra <peterz@infradead.org>, Randy Dunlap <rdunlap@infradead.org>, Weijiang Yang <weijiang.yang@intel.com>, "Kirill A . Shutemov" <kirill.shutemov@linux.intel.com>, John Allen <john.allen@amd.com>, kcc@google.com, eranian@google.com, rppt@kernel.org, jamorris@linux.microsoft.com, dethoma@microsoft.com, akpm@linux-foundation.org, Andrew.Cooper3@citrix.com, christina.schimpe@intel.com Cc: rick.p.edgecombe@intel.com Subject: [PATCH v4 34/39] x86/shstk: Wire in shadow stack interface Date: Fri, 2 Dec 2022 16:36:01 -0800 Message-Id: <20221203003606.6838-35-rick.p.edgecombe@intel.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20221203003606.6838-1-rick.p.edgecombe@intel.com> References: <20221203003606.6838-1-rick.p.edgecombe@intel.com> X-Stat-Signature: i9gmdpfruy71u37dyofy9qf7c7omrsun X-Rspam-User: X-Spamd-Result: default: False [-3.75 / 9.00]; BAYES_HAM(-5.35)[98.56%]; SUSPICIOUS_RECIPS(1.50)[]; MID_CONTAINS_FROM(1.00)[]; DMARC_POLICY_ALLOW(-0.50)[intel.com,none]; R_SPF_ALLOW(-0.20)[+ip4:192.55.52.93/32:c]; R_DKIM_ALLOW(-0.20)[intel.com:s=Intel]; MIME_GOOD(-0.10)[text/plain]; RCVD_NO_TLS_LAST(0.10)[]; MIME_TRACE(0.00)[0:+]; FROM_EQ_ENVFROM(0.00)[]; RCPT_COUNT_TWELVE(0.00)[39]; TO_MATCH_ENVRCPT_SOME(0.00)[]; RCVD_COUNT_THREE(0.00)[3]; FROM_HAS_DN(0.00)[]; DKIM_TRACE(0.00)[intel.com:+]; TO_DN_SOME(0.00)[]; ARC_SIGNED(0.00)[hostedemail.com:s=arc-20220608:i=1]; TAGGED_RCPT(0.00)[]; ARC_NA(0.00)[] X-Rspamd-Queue-Id: 3B86640005 X-Rspamd-Server: rspam06 X-HE-Tag: 1670027865-428266 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: <linux-mm.kvack.org> |
Series |
Shadow stacks for userspace
|
expand
|
diff --git a/arch/x86/kernel/shstk.c b/arch/x86/kernel/shstk.c index 3a7bcc01d985..5d91e653f77a 100644 --- a/arch/x86/kernel/shstk.c +++ b/arch/x86/kernel/shstk.c @@ -468,9 +468,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; }