Received: by 2002:a05:7412:f690:b0:e2:908c:2ebd with SMTP id ej16csp187531rdb; Thu, 19 Oct 2023 01:01:03 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFvvhgjbafXqPtPMwqCnqsCi/AtnWA5sjN3MpS+47XPIg2io2DWmJR6a8nUM9Yy1GZpAihx X-Received: by 2002:a92:cc0d:0:b0:34c:bc10:2573 with SMTP id s13-20020a92cc0d000000b0034cbc102573mr1607922ilp.3.1697702463335; Thu, 19 Oct 2023 01:01:03 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1697702463; cv=none; d=google.com; s=arc-20160816; b=kuXGAbzoLgLlGbIR2j/dNe+xoZmGvlWAHv0zL3gp8gD+miFoQrH6AfraE4+suVfatb Xa5EHPF2iYOyaQyYM5QquFJRJUtBmFdd1OOwdPpwkDY1abkzOFFPgJc4UzMflIL/R+3K FlDxtHgxwfmeSJOyY+dPTrhUH7e70jelN0CVWOcGAXYK4s2uFNT/9XGmcF6j/3rQHXlC VJix69UtGsaqTfgAftZAzzmAC/UZr30EaDWlYhvpMCZxQM6TgNCEKdQhcXBdTRG7Mjaa 7xUu8erVfhychcNhJbmhsEx0aqaclEMRSIzTcAywvkNDM3SAGiUwRBSo3WUIKsMqXmoe xdMg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=zzYQdttvG9czqkBaq4b4PXThZL9krcFidpTeUsDgElI=; fh=pmfcYTFXkw4eGNKs2iIElzG8y1y3z1jPcEwWkVHOurQ=; b=gMFyvrcoIolBt2ZxPPh4c09hWG1bhAaaMe0K9RjArmgE65I9r4IsyRD1Kog0/g/kMB r1XE+ZleMOauL604sM/sUtn6GQDYKpLmXPsatRSSz8hSvZBErdc9Js9n9sNcyi5YvBH2 fpsIqKe1p08ADM0/WZCknsa2zAnEqagvuTFfe5Rha8bD0VNMd23SiTIzDlYAQeheNzXz lWVc5F8AqAibqz5gROQvC2lgz0Gzemmd51+yXEYP7Wy4gLW6A/uGBpMq4RoAtdK9TlmO 1KQrES+Pqoo7/5YOQgQ1EIL664qsJOlTTJs+lauRMdZ6WhhusTsQ5WyqBEG7azwd2crQ dPKQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20230601 header.b=Dzirx8Eb; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:5 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from groat.vger.email (groat.vger.email. [2620:137:e000::3:5]) by mx.google.com with ESMTPS id a8-20020a63e408000000b005859cd26197si3770678pgi.455.2023.10.19.01.01.02 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 19 Oct 2023 01:01:03 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:5 as permitted sender) client-ip=2620:137:e000::3:5; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20230601 header.b=Dzirx8Eb; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:5 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by groat.vger.email (Postfix) with ESMTP id 70AAC80295E0; Thu, 19 Oct 2023 01:01:00 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at groat.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232850AbjJSIAy (ORCPT + 99 others); Thu, 19 Oct 2023 04:00:54 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41704 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230297AbjJSIAw (ORCPT ); Thu, 19 Oct 2023 04:00:52 -0400 Received: from mail-ej1-x62d.google.com (mail-ej1-x62d.google.com [IPv6:2a00:1450:4864:20::62d]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 343A3121 for ; Thu, 19 Oct 2023 01:00:49 -0700 (PDT) Received: by mail-ej1-x62d.google.com with SMTP id a640c23a62f3a-9bf0ac97fdeso762677966b.2 for ; Thu, 19 Oct 2023 01:00:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1697702447; x=1698307247; darn=vger.kernel.org; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=zzYQdttvG9czqkBaq4b4PXThZL9krcFidpTeUsDgElI=; b=Dzirx8EbmhKtsZ6R10YyxzcB/lePoVxUpOkQCfoEGuaZmyuCD5iZOKP41MA1RK/5h0 bsLXpu5bckSEvhzfzAwCmcb4shL524EpzjzTzge3agKlN4Ra8OAzBKTnhXnr/siEziXh G+NIFWog8upu7/1U2VC/v54obIex0TReND6bX0chflGOjUVqwrsRroOFH4DHUvRoHw/2 tUQFEzFmWmID4+CfR5hP1zfxzYKvtMwym+LoLCWC5DVZUhn/28/NnWEUds1x9SBqb2bI Dg86AXICzKi0ZCJbSlQOSkwWWErMY/RNtoFlQT6rKps9237vdtMyxZBhqEHB/zb/Yeu5 2Tew== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1697702447; x=1698307247; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=zzYQdttvG9czqkBaq4b4PXThZL9krcFidpTeUsDgElI=; b=kzkAugb9Fft0ZX92sL2Cqmt+gycu13r8YrYEdDJUM4/JlGHIZAIdyWQVwTFRXPEA+B bXsb74GQAghE5ypxXr/G1syc3AbljlYzTT30BLqourvsgbwmLa85h/tzUtUnEdJkNYOn IuzizrJszG90rTE4MShwOie9s4vBxsHvdWoYMA2RkRyoiSEamFWrUVfOgP2SoarlaRZE wUMptpBMu1NraHu2iLL97EEYQD9bSFksMAjjBEhymKaUrHGbw4kxled2RJ99jFVtFqMT dDHYP61gvmFjYvb48y3POyMcnLkWGbgh6BUdqtuYY7Lw8+CpXwIT29D7LxAxeHXWOJ6S M82w== X-Gm-Message-State: AOJu0Yy+SP64cCzAt18/AdymnEHh+p48ay9VfA3qeR1h4zDzCeIi80Fe J0qmMFVSMGsJMKPJkDehvGFi8VkN5QHWvTrtrV2zBg== X-Received: by 2002:a17:907:786:b0:9be:834a:f80b with SMTP id xd6-20020a170907078600b009be834af80bmr1206934ejb.75.1697702447293; Thu, 19 Oct 2023 01:00:47 -0700 (PDT) MIME-Version: 1.0 References: <20231016143828.647848-1-jeffxu@chromium.org> <55960.1697566804@cvs.openbsd.org> In-Reply-To: From: =?UTF-8?Q?Stephen_R=C3=B6ttger?= Date: Thu, 19 Oct 2023 10:00:33 +0200 Message-ID: Subject: Re: [RFC PATCH v1 0/8] Introduce mseal() syscall To: Linus Torvalds Cc: Theo de Raadt , Jeff Xu , jeffxu@chromium.org, akpm@linux-foundation.org, keescook@chromium.org, jorgelo@chromium.org, groeck@chromium.org, linux-kernel@vger.kernel.org, linux-kselftest@vger.kernel.org, linux-mm@kvack.org, jannh@google.com, surenb@google.com, alex.sierra@amd.com, apopple@nvidia.com, aneesh.kumar@linux.ibm.com, axelrasmussen@google.com, ben@decadent.org.uk, catalin.marinas@arm.com, david@redhat.com, dwmw@amazon.co.uk, ying.huang@intel.com, hughd@google.com, joey.gouly@arm.com, corbet@lwn.net, wangkefeng.wang@huawei.com, Liam.Howlett@oracle.com, lstoakes@gmail.com, willy@infradead.org, mawupeng1@huawei.com, linmiaohe@huawei.com, namit@vmware.com, peterx@redhat.com, peterz@infradead.org, ryan.roberts@arm.com, shr@devkernel.io, vbabka@suse.cz, xiujianfeng@huawei.com, yu.ma@intel.com, zhangpeng362@huawei.com, dave.hansen@intel.com, luto@kernel.org, linux-hardening@vger.kernel.org Content-Type: multipart/signed; protocol="application/pkcs7-signature"; micalg=sha-256; boundary="00000000000056a62e06080d27a1" X-Spam-Status: No, score=-8.4 required=5.0 tests=DKIMWL_WL_MED,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_IN_DEF_DKIM_WL autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on groat.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (groat.vger.email [0.0.0.0]); Thu, 19 Oct 2023 01:01:00 -0700 (PDT) --00000000000056a62e06080d27a1 Content-Type: text/plain; charset="UTF-8" > I do like us starting with just "mimmutable()", since it already > exists. Particularly if chrome already knows how to use it. > > Maybe add a flag field (require it to be zero initially) just to allow > any future expansion. Maybe the chrome team has *wanted* to have some > finer granularity thing and currently doesn't use mimmutable() in some > case? Yes, we do have a use case in Chrome to split the sealing into unmap and mprotect which will allow us to seal additional pages that we can't seal with pure mimmutable(). For example, we have pkey-tagged RWX memory that we want to seal. Since the memory is already RWX and the pkey controls write access, we don't care about permission changes but sometimes we do need to mprotect data only pages. But the munmap sealing will provide protection against implicit changes of the pkey in this case which would happen if a page gets unmapped and another mapped in its place. --00000000000056a62e06080d27a1 Content-Type: application/pkcs7-signature; name="smime.p7s" Content-Transfer-Encoding: base64 Content-Disposition: attachment; filename="smime.p7s" Content-Description: S/MIME Cryptographic Signature MIIPoQYJKoZIhvcNAQcCoIIPkjCCD44CAQExDzANBglghkgBZQMEAgEFADALBgkqhkiG9w0BBwGg ggz7MIIEtjCCA56gAwIBAgIQeAMYYHb81ngUVR0WyMTzqzANBgkqhkiG9w0BAQsFADBMMSAwHg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