From nobody Sun Feb 8 13:53:34 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 C45B3C001DE for ; Wed, 19 Jul 2023 22:49:14 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231339AbjGSWtN (ORCPT ); Wed, 19 Jul 2023 18:49:13 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42624 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231151AbjGSWrv (ORCPT ); Wed, 19 Jul 2023 18:47:51 -0400 Received: from galois.linutronix.de (Galois.linutronix.de [IPv6:2a0a:51c0:0:12e:550::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 56CB22135; Wed, 19 Jul 2023 15:47:38 -0700 (PDT) Date: Wed, 19 Jul 2023 22:47:35 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1689806856; 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=om13jL7O3l4YcuKziXRHIegrg+cbxJkA71mYNJPzON4=; b=t9bVuNO9bZzacbOkHO2yZm1GLciWDX5vkiomGwK9NpvP30y0hydDFsRG2pV3gqeKc9R3GS mXTFDj3udXwEhEAc+fbuEbpwY3IYa4ltgA6QvLxHuM1MWaW1/hbA+zdwgJ6Bt4J//9QImr IDhG+WcVwknujkR+Dcvxp+zzQ4Dsv1z4fO3BHdwz2g2U0HF+9K+MCUacTHfquA1M2H98Xe xq/diKFA8hyfvs6CbDA90T7B1fqU17MC3ENXKI41Qeb+adP+0OvoZLvxFehjH3WLvCHuv4 fKkmmuFrmDDy3n5h0urG/FOX9htwlnRTfShQGBUUZGgAY3Tgm5H0vwTH4TalQg== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1689806856; 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=om13jL7O3l4YcuKziXRHIegrg+cbxJkA71mYNJPzON4=; b=AQy3D+cCKZr/dZuaP4GDR2HDNNDCkUBeXeBlviuDvNapa8yJZIeQvsaiTBBy7ZrzNZc8+T 6AN1lbzmLLsJsUCw== 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: <168980685594.28540.7546277412646689186.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: 00547ef73ff282eea59cd33b8952f1dcbb4bd4b8 Gitweb: https://git.kernel.org/tip/00547ef73ff282eea59cd33b8952f1dcb= b4bd4b8 Author: Rick Edgecombe AuthorDate: Mon, 12 Jun 2023 17:10:45 -07:00 Committer: Rick Edgecombe CommitterDate: Tue, 11 Jul 2023 14:12:19 -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 a7d9e98..018f5c3 100644 --- a/mm/internal.h +++ b/mm/internal.h @@ -538,14 +538,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 /*