From patchwork Wed May 17 23:03:20 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Joseph Myers X-Patchwork-Id: 1782998 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=sourceware.org (client-ip=2620:52:3:1:0:246e:9693:128c; helo=sourceware.org; envelope-from=libc-alpha-bounces+incoming=patchwork.ozlabs.org@sourceware.org; receiver=) Received: from sourceware.org (server2.sourceware.org [IPv6:2620:52:3:1:0:246e:9693:128c]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-384) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4QM7vG5NbGz20dv for ; Thu, 18 May 2023 09:03:38 +1000 (AEST) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 603A93854160 for ; Wed, 17 May 2023 23:03:36 +0000 (GMT) X-Original-To: libc-alpha@sourceware.org Delivered-To: libc-alpha@sourceware.org Received: from esa1.mentor.iphmx.com (esa1.mentor.iphmx.com [68.232.129.153]) by sourceware.org (Postfix) with ESMTPS id CB7C93858C5F for ; Wed, 17 May 2023 23:03:26 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org CB7C93858C5F Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=codesourcery.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=mentor.com X-IronPort-AV: E=Sophos;i="5.99,283,1677571200"; d="scan'208";a="6383245" Received: from orw-gwy-01-in.mentorg.com ([192.94.38.165]) by esa1.mentor.iphmx.com with ESMTP; 17 May 2023 15:03:25 -0800 IronPort-SDR: DpgKFEgj62QgwOuP+cMVs92tYTWW6ZmU6PAt7bZYdQNhE+qJh6k8KrKAis3hQXpFoiwPnh2ZeW VB4ykDzWWtke9OM3IOzh1AJiWGV4Vp+Gdoo3ma7FQohpeHk51mR1n6tyPBU3TlVoFNqak8vVMd 7Mh3KekoZryKbjqVIuqLaQ+1PgROKcLygN3vocQq2mbDFrOMDHpVnaLJBVkuwY2jFO25uFQkRK qw3tf56Hp1mKlLYMnv6ht0y8Wf4qOYbMx5sZKqIM9dFS6Ey+LJs2UZutFCmvcM7/G5ZPzWUZXE ZIg= Date: Wed, 17 May 2023 23:03:20 +0000 From: Joseph Myers To: Subject: Add MFD_NOEXEC_SEAL, MFD_EXEC from Linux 6.3 to bits/mman-shared.h Message-ID: MIME-Version: 1.0 X-Originating-IP: [137.202.0.90] X-ClientProxiedBy: svr-ies-mbx-13.mgc.mentorg.com (139.181.222.13) To svr-ies-mbx-10.mgc.mentorg.com (139.181.222.10) X-Spam-Status: No, score=-3112.7 required=5.0 tests=BAYES_00, GIT_PATCH_0, HEADER_FROM_DIFFERENT_DOMAINS, KAM_DMARC_STATUS, SPF_HELO_PASS, SPF_PASS, TXREP, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org X-BeenThere: libc-alpha@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Libc-alpha mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: libc-alpha-bounces+incoming=patchwork.ozlabs.org@sourceware.org Sender: "Libc-alpha" Linux 6.3 adds new constants MFD_NOEXEC_SEAL and MFD_EXEC. Add these to bits/mman-shared.h (conditional on MFD_NOEXEC_SEAL not already being defined, similar to the existing conditional on the older MFD_* macros). Tested for x86_64. diff --git a/sysdeps/unix/sysv/linux/bits/mman-shared.h b/sysdeps/unix/sysv/linux/bits/mman-shared.h index 91f2cad00f..6684a84a26 100644 --- a/sysdeps/unix/sysv/linux/bits/mman-shared.h +++ b/sysdeps/unix/sysv/linux/bits/mman-shared.h @@ -32,6 +32,10 @@ # define MFD_ALLOW_SEALING 2U # define MFD_HUGETLB 4U # endif +# ifndef MFD_NOEXEC_SEAL +# define MFD_NOEXEC_SEAL 8U +# define MFD_EXEC 0x10U +# endif /* Flags for mlock2. */ # ifndef MLOCK_ONFAULT