From nobody Sun Feb 8 17:04:26 2026 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 4DC78EB64D8 for ; Fri, 16 Jun 2023 19:18:29 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1345976AbjFPTS1 (ORCPT ); Fri, 16 Jun 2023 15:18:27 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48116 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1345949AbjFPTRE (ORCPT ); Fri, 16 Jun 2023 15:17:04 -0400 Received: from galois.linutronix.de (Galois.linutronix.de [193.142.43.55]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 149863AA4; Fri, 16 Jun 2023 12:17:02 -0700 (PDT) Date: Fri, 16 Jun 2023 19:17:00 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1686943020; 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=lEavE7KzI6HFgILgkppc2+zKlgu3cU9oGtjf05hXZiI=; b=T/wl2KxqdGaA9sp6tQSlUzgVPtt58NZMGYSW2KlPg0RgldgtqfWqResDNeFMfaxJXiypyR +9LDA9n0nvZNDXcidXo4Xnw9KstyIEhykg80AQVmjzwDDK8qKpuIoAzXV43u589WHLe4aH 6nC9x4evSBVywLIUfKSYaOgkwfvbwv2SicwdgGNCPEDU1PQKIP7rqMj6xdd0+dSNxwk9ad zyknQ4V4pzV5Q/B0BP6ld3GO7Lnw2jz5nQd5fJZ8JRamBPKU4Lavg0zgfUVvPhQgsu9E01 snwUlOiIDSuXCma6BQtv7KefEYN0lMtGy1Efo7C+p9nMWK6wIWJvNnl6GCWvQg== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1686943020; 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=lEavE7KzI6HFgILgkppc2+zKlgu3cU9oGtjf05hXZiI=; b=NvKB0d/aVj7dCLxSUY8eliIwz8diaGzzEexKcdvXQ/rBKFR5RPj1khLHv39NfKW2sOnfoJ Y7Y6HmUX7O7XwvBg== From: "tip-bot2 for Rick Edgecombe" Sender: tip-bot2@linutronix.de Reply-to: linux-kernel@vger.kernel.org To: linux-tip-commits@vger.kernel.org Subject: [tip: x86/shstk] mm/mmap: Add shadow stack pages to memory accounting Cc: "Yu-cheng Yu" , Rick Edgecombe , Dave Hansen , "Borislav Petkov (AMD)" , Kees Cook , "Mike Rapoport (IBM)" , David Hildenbrand , Pengfei Xu , John Allen , x86@kernel.org, linux-kernel@vger.kernel.org MIME-Version: 1.0 Message-ID: <168694302024.404.10992834029172607426.tip-bot2@tip-bot2> Robot-ID: Robot-Unsubscribe: Contact to get blacklisted from these emails Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The following commit has been merged into the x86/shstk branch of tip: Commit-ID: 6538963ccabd17c61265a8fb497c76727f6bc638 Gitweb: https://git.kernel.org/tip/6538963ccabd17c61265a8fb497c76727= f6bc638 Author: Rick Edgecombe AuthorDate: Mon, 12 Jun 2023 17:10:45 -07:00 Committer: Dave Hansen CommitterDate: Thu, 15 Jun 2023 16:31:33 -07:00 mm/mmap: Add shadow stack pages to memory accounting The x86 Control-flow Enforcement Technology (CET) feature includes a new type of memory called shadow stack. This shadow stack memory has some unusual properties, which requires some core mm changes to function properly. Co-developed-by: Yu-cheng Yu Signed-off-by: Yu-cheng Yu Signed-off-by: Rick Edgecombe Signed-off-by: Dave Hansen Reviewed-by: Borislav Petkov (AMD) Reviewed-by: Kees Cook Acked-by: Mike Rapoport (IBM) Acked-by: David Hildenbrand Tested-by: Pengfei Xu Tested-by: John Allen Tested-by: Kees Cook Link: https://lore.kernel.org/all/20230613001108.3040476-20-rick.p.edgecomb= e%40intel.com --- mm/internal.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/mm/internal.h b/mm/internal.h index 68410c6..dd2ded3 100644 --- a/mm/internal.h +++ b/mm/internal.h @@ -535,14 +535,14 @@ static inline bool is_exec_mapping(vm_flags_t flags) } =20 /* - * 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) =3D=3D VM_STACK; + return ((flags & VM_STACK) =3D=3D VM_STACK) || (flags & VM_SHADOW_STACK); } =20 /*