Message ID | 20230613001108.3040476-20-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 8381DCA9EA2 for <linux-mm@archiver.kernel.org>; Tue, 13 Jun 2023 00:12:57 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 845338E0014; Mon, 12 Jun 2023 20:12:28 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 7CCCE8E000B; Mon, 12 Jun 2023 20:12:28 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 55C3D8E0014; Mon, 12 Jun 2023 20:12:28 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0016.hostedemail.com [216.40.44.16]) by kanga.kvack.org (Postfix) with ESMTP id 358BB8E000B for <linux-mm@kvack.org>; Mon, 12 Jun 2023 20:12:28 -0400 (EDT) Received: from smtpin18.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay02.hostedemail.com (Postfix) with ESMTP id EB4521203A3 for <linux-mm@kvack.org>; Tue, 13 Jun 2023 00:12:27 +0000 (UTC) X-FDA: 80895797934.18.F8ED8A5 Received: from mga03.intel.com (mga03.intel.com [134.134.136.65]) by imf01.hostedemail.com (Postfix) with ESMTP id D57D94000B for <linux-mm@kvack.org>; Tue, 13 Jun 2023 00:12:25 +0000 (UTC) Authentication-Results: imf01.hostedemail.com; dkim=pass header.d=intel.com header.s=Intel header.b=M8hE4MuI; dmarc=pass (policy=none) header.from=intel.com; spf=pass (imf01.hostedemail.com: domain of rick.p.edgecombe@intel.com designates 134.134.136.65 as permitted sender) smtp.mailfrom=rick.p.edgecombe@intel.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1686615146; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=JK9+ERy4F36GfmVdpqghccuIPuJ16HTtI5Wly0MCYFI=; b=dPomzj7BUnprQiU3VcIZtKcMS65uOtb7rRluPs9EVtyvAV2CqhEYOuNI06GyJELsxVwu0p eb4nW7o7Imvh1+pKwEdemg/Xn6MrqMG1aSU1LFZzXOw0cR989osJM84201b5sd0lCSpB0x ER1FNOcwZB5cAD0lkKnfaQIsWfKIhxE= ARC-Authentication-Results: i=1; imf01.hostedemail.com; dkim=pass header.d=intel.com header.s=Intel header.b=M8hE4MuI; dmarc=pass (policy=none) header.from=intel.com; spf=pass (imf01.hostedemail.com: domain of rick.p.edgecombe@intel.com designates 134.134.136.65 as permitted sender) smtp.mailfrom=rick.p.edgecombe@intel.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1686615146; a=rsa-sha256; cv=none; b=lV2Esk8Ycu6szVkJZzOv7oSXf3HW5RS7/ZkRSwtebGuL7RRrSdYcwYHf1SHSM0wAAes6pn H9Df+OhVuNuM0Gln6apN0Lp3mtQDyRusKzouhtJ6gsmvuO5hyUa41rro8zRiYQDQ5MieRD +kWmi/7UfnQhs4Bn6ZrKDL3zOQIFgZ8= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1686615146; x=1718151146; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=0w0eM3eQB07Ass1qJGPwxV0mmwv4IZmjBMBIbi82ENo=; b=M8hE4MuIYDYGWzsfUHcrDSkj+IAl5g8+jYV1VKdduJa3fWngXvbPkoOj 9TqQY2/qjBaF8tM4WKdJOe4tjOekFLTbUx7cfrEafHXE2VIRFOrs75GLd MYUKe8JmKatGeY/PLGBz3Ov0QdmpN6qduIFJak29hAsRNFMj5D6ZEi8LB l/uJ3ZdLr6LIQWHTRNY7k3b207CeCzrq4Uyr7ZsXaN0nYcrvA2SDvhZX4 25NLS+rlxd3DXk+eJqMzbFNRCu7qvuR/lJvVTldOSNZ5IatXXqrr0JUlq ValndaW/kKjD+K1YK45b1r1Frz82/Ohft+yK2ydg3arnKSSt+3oQrWGFg w==; X-IronPort-AV: E=McAfee;i="6600,9927,10739"; a="361557104" X-IronPort-AV: E=Sophos;i="6.00,238,1681196400"; d="scan'208";a="361557104" Received: from orsmga004.jf.intel.com ([10.7.209.38]) by orsmga103.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 12 Jun 2023 17:12:24 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10739"; a="835671045" X-IronPort-AV: E=Sophos;i="6.00,238,1681196400"; d="scan'208";a="835671045" Received: from almeisch-mobl1.amr.corp.intel.com (HELO rpedgeco-desk4.amr.corp.intel.com) ([10.209.42.242]) by orsmga004-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 12 Jun 2023 17:12:23 -0700 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, david@redhat.com, debug@rivosinc.com, szabolcs.nagy@arm.com, torvalds@linux-foundation.org, broonie@kernel.org Cc: rick.p.edgecombe@intel.com, Yu-cheng Yu <yu-cheng.yu@intel.com>, Pengfei Xu <pengfei.xu@intel.com> Subject: [PATCH v9 19/42] mm/mmap: Add shadow stack pages to memory accounting Date: Mon, 12 Jun 2023 17:10:45 -0700 Message-Id: <20230613001108.3040476-20-rick.p.edgecombe@intel.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230613001108.3040476-1-rick.p.edgecombe@intel.com> References: <20230613001108.3040476-1-rick.p.edgecombe@intel.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Rspamd-Server: rspam09 X-Rspamd-Queue-Id: D57D94000B X-Stat-Signature: u4k8nhia3ta36qb11g4nbf8yeati5jk5 X-Rspam-User: X-HE-Tag: 1686615145-444143 X-HE-Meta: U2FsdGVkX1/hMVcmQJMCw8aArlYKvTT8ojAloik7N3qptzc4HSzzbTD9H3YwfgiAdWX0oJMGWQNGs3izhgnhdlsazHAST8X+6wUlQe9aIHFVzACdrMZ4AOU0L8BM4zd+gGflZRF0W6dHRmnvwVc93RicokoGSHeotZx2QVBo+Wn6xgUewSToYVfnR+vbWl5h/t2FeHQJ/ecc6BBf0gLdCYG/Jb2h/QAh9rTF55104DgeRnXm5n6FRB1nv9p8fYOTUk2HxXi56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WKg4AGkBEJHNFRXHOdibCZHFQsb7KsjZnV+bXlC0= 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/mm/internal.h b/mm/internal.h index 68410c6d97ac..dd2ded32d3d5 100644 --- a/mm/internal.h +++ b/mm/internal.h @@ -535,14 +535,14 @@ static inline bool is_exec_mapping(vm_flags_t flags) } /* - * Stack area - automatically grows in one direction + * Stack area (including shadow stacks) * * VM_GROWSUP / VM_GROWSDOWN VMAs are always private anonymous: * do_mmap() forbids all other combinations. */ static inline bool is_stack_mapping(vm_flags_t flags) { - return (flags & VM_STACK) == VM_STACK; + return ((flags & VM_STACK) == VM_STACK) || (flags & VM_SHADOW_STACK); } /*