Received: by 2002:a05:7412:251c:b0:e2:908c:2ebd with SMTP id w28csp1796044rda; Tue, 24 Oct 2023 03:43:32 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFHxgd45TG1JGA/iZECqA0PPe5IUbyWfAVXOQ7Cn+m3HYNTvJqe3vl0fKQCnXLsV4Z9PCtN X-Received: by 2002:a05:6a00:1749:b0:692:b6e8:ce88 with SMTP id j9-20020a056a00174900b00692b6e8ce88mr10198522pfc.17.1698144212288; Tue, 24 Oct 2023 03:43:32 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1698144212; cv=none; d=google.com; s=arc-20160816; b=BmY3rKGssfH2ujHsluY6Wk6STubfMVG6UK5XLuuqT98hcENvKBvQjUaZECC67+tTT3 O+q6wPUPQjGSKvjevBRWjfylKqfNUkfScuVKr/g+yeqpj8cN8Lf8sZ6DCF5wTmXtZcZE hP9pGSSbCH0gk+QWOJKQW+vJWx9R/fzaQUDNnV+R94TYlX02bH1lFjWtC8VoEp3sbe0L X6c8a0jIf3R9kLv9H0PPpVH/QsSB4JopSQjHeAtB+sl+BUnsrX4XbuwlLaNlIhxrumYw Ztfl7v4Bm3jIzUGjXxcmP94ypa07RRnIunaBaQW7KNyFgHcWZ0XtcjMBT7xH1P122FTT mZ5g== 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=0JCVys/L3dAwInWgyH87mogxdMk4hZM7oxK6GzpJSdY=; fh=u4mlEzLs1A6ZvmGow9wp5Ca4l2OrCS6ReSphCBNFdg0=; b=MiUektzsSu79tJaL3BcnfHZ7slG2prMbpJKAfMsPDIKxI1ndfOWCHsneXsHv0mUZk2 8hdoqTOI8ymJBE5nbadm9rvd7ASZ/Ps7wpXt1yCXGLL0YT68L+DSy4cQ+gFnLcxbYQ5z K/a+mqMnrELcR+UjeBOfyBYhnxcdyKQyk+x5gjh/VTnmm6yjCsCGdHejuNfAQDKYTMaJ beXtqb1N/qdKZs26cCKJPbBT4y/xdb9w1v6mhOlxTjndF93wFjzcv5o+0SH9h8kaMSgd PmN1TQxcgPbi43eTMWC5p02aqZ5C6Qr3h/MsHor0SgtGmkpqne2PnyOWX0kml3cPUZkT cmxQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20230601 header.b=30UREe7q; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:4 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 howler.vger.email (howler.vger.email. [2620:137:e000::3:4]) by mx.google.com with ESMTPS id t1-20020a63dd01000000b005b7d939c3d9si8580627pgg.651.2023.10.24.03.43.31 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 24 Oct 2023 03:43:32 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:4 as permitted sender) client-ip=2620:137:e000::3:4; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20230601 header.b=30UREe7q; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:4 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 howler.vger.email (Postfix) with ESMTP id 3415E804A489; Tue, 24 Oct 2023 03:43:29 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at howler.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232825AbjJXKnV (ORCPT + 99 others); Tue, 24 Oct 2023 06:43:21 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35348 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232042AbjJXKnT (ORCPT ); Tue, 24 Oct 2023 06:43:19 -0400 Received: from mail-ej1-x630.google.com (mail-ej1-x630.google.com [IPv6:2a00:1450:4864:20::630]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 898CCE5 for ; Tue, 24 Oct 2023 03:43:17 -0700 (PDT) Received: by mail-ej1-x630.google.com with SMTP id a640c23a62f3a-9adb9fa7200so900806066b.0 for ; Tue, 24 Oct 2023 03:43:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1698144196; x=1698748996; 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=0JCVys/L3dAwInWgyH87mogxdMk4hZM7oxK6GzpJSdY=; b=30UREe7qSmiqTjFuix/XththlK7V6IxJcUWxPEsytxl0W/uVRJpLSfd2ZjnfC6+x6Q LQ7R+Xoq98aJ3fZ8j02fgckDRg5YPwHhog2IcalW/pC9sRRYLgtp/FVaRdn+maGbzL4Q 5AXaorFXGTV8a/3q1EqrBgKBH6TtD44p82XcTf330UciCAlENmRpffv7NNnpxNdembGl YYghGjs+evXFBhHuXV54sNYEcB0jgB+4alEaEDFK5zayef4eZqvWcBNZqN+QcZuOfYQ2 qmWW8pqZI9R31sM6lfVfyNRrQWhjpAysmNWqyZlDncf9Thx7ME/N6I7F99p1LWgGe+ik 9pTg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1698144196; x=1698748996; 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=0JCVys/L3dAwInWgyH87mogxdMk4hZM7oxK6GzpJSdY=; b=hYu1ve6T8iOBdD05UIC/hndhnE19r71srfmNSvojD3YQP3F8QkEteKmMvYQz9AdIJr 6p/N4vK05Tf3qbLuMacD38CvrepaPfXhlQz+WMPK6omYHHeOYOHBSnBBUWvPpXf5w+8L kYnV+xTlRA/gCt9tSO71zy0pF6zGb0v+EMs50x/XWRaPlaPQa/ryIpbBrmGfeF9SibhP xIf0yDzEAurxdGc4VztxzQt3ag7pmZij4AQKxrqzhE0e5XoEBX4N7RpBLt8DsrJb8zJv dMCb4q83pCqIpZfDzIz+BjX3m/0gxJ6pPTcnXoW1SNpTRPq9DYqwFmfloLe946jxobVx 09OA== X-Gm-Message-State: AOJu0YxYfHhbHxNcandhY76sNbmoiBNgjsb8w7eWSTts+zI2zQBn7s9V hu9WJ+r+CUvWFS+ntwA0qNZPgbsf9qhPpV2/fnR9IA== X-Received: by 2002:a17:907:d15:b0:9bd:bdfd:e17a with SMTP id gn21-20020a1709070d1500b009bdbdfde17amr11002254ejc.6.1698144195749; Tue, 24 Oct 2023 03:43:15 -0700 (PDT) MIME-Version: 1.0 References: <20231016143828.647848-1-jeffxu@chromium.org> <55960.1697566804@cvs.openbsd.org> <33724.1697819251@cvs.openbsd.org> In-Reply-To: <33724.1697819251@cvs.openbsd.org> From: =?UTF-8?Q?Stephen_R=C3=B6ttger?= Date: Tue, 24 Oct 2023 12:42:59 +0200 Message-ID: Subject: Re: [RFC PATCH v1 0/8] Introduce mseal() syscall To: Theo de Raadt Cc: Linus Torvalds , 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="000000000000992a11060874013c" 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 howler.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 (howler.vger.email [0.0.0.0]); Tue, 24 Oct 2023 03:43:29 -0700 (PDT) --000000000000992a11060874013c Content-Type: text/plain; charset="UTF-8" > The problem you seem to have with fully locked mseal() in chrome seems > to be here: > > > about permission changes but sometimes we do need to mprotect data only > > pages. > > Does that data have to be in the same region? Can your allocator not > put the non-code pieces of the JIT elsewhere, with a different > permission, fully immutable / msealed -- and perhaps even managed with a > different PKEY if neccessary? No we can't. We investigated this extensively since this also poses some difficulties on MacOS. We implemented different approaches but any such change to the allocator introduces too much of a performance impact. --000000000000992a11060874013c 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 ggz7MIIEtjCCA56gAwIBAgIQeAMYYHb81ngUVR0WyMTzqzANBgkqhkiG9w0BAQsFADBMMSAwHgYD VQQLExdHbG9iYWxTaWduIFJvb3QgQ0EgLSBSMzETMBE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