Received: by 2002:a05:7412:d8a:b0:e2:908c:2ebd with SMTP id b10csp4056261rdg; Wed, 18 Oct 2023 13:40:57 -0700 (PDT) X-Google-Smtp-Source: AGHT+IEvwPdHt/BIzG7CuCYyHDqljyNSVjZz4NgTmGjY6nHc42dHra6ZNrHm1L6yQesXryXC2vcN X-Received: by 2002:a05:6a00:1993:b0:690:c75e:25c8 with SMTP id d19-20020a056a00199300b00690c75e25c8mr224286pfl.7.1697661656883; Wed, 18 Oct 2023 13:40:56 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1697661656; cv=none; d=google.com; s=arc-20160816; b=jeyzQu3xwR/IT9Ut58oXkSTBRpeO4pqbo3iOBeHtqmraFC6qGPPsnoG7/0DG3tPrY0 MRHLB78Tht7evDsezyFM6qaZkV9Vi5hCZyyl6D2KSATqdK4BfnuBYm8LoMKEJK9rVvdU nLSPA2xgWhnLAHYFF966QlpZkqTXD/V8CLQWSii+xgBhzgB6OvBgQ02k7nhQAUUU8an+ //wcuXMp3Vc7JuoLg3nEbLpieDrmfsJ/z3/2u1OqUD7JVa8aG2ADWMj8mFAaRMKi0713 jKwSDYholyRq1PAfh2dXw3Ng0vFH7kxadqR0bljfl3x0962qCdq9BG6SlL6/QE0tf2yt 1+SQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:message-id:date:content-transfer-encoding :mime-version:comments:references:in-reply-to:subject:cc:to:from :dkim-signature; bh=04N1pinL4rnzpUOq6D3vak2UBdms648WjiAnrPMcgKE=; fh=XawaZNKIhj+XyF8y9eDDJCMyIb9alj5Vaq3nt9vY/ts=; b=BucU2urwCeL1LEv4RkthDGHK5dYPhz8fQuo+il+q5Q10XgDYDgsAZqzQWzLFB8nVOK culGMQcYdU5PMBALy8WTxQxRQSsdY0itAMz9NR6HSyejMk0E6GU3m739SnMYib9AFn8Y KDuxi8oPipvEKbJokk2J1D3CITSTtdIjJ+28zl5vDtqkRfiDXZHVqX437UmNMzQ+jBYH bO4HpymdlFa4rCsZoWmb7vd108592YoVwhSRP333FuX+7WrFPaEZvs/EPhFBXfCyJWWN s5gNlPgWCb38A5lPn+D9Qv+7gWQSMlNIFHWeOVYeUWcVDqrpz9GEiTwsR4MXmlUhVFby 0Ohw== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@openbsd.org header.s=selector1 header.b=ZQX3DGaS; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.33 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from lipwig.vger.email (lipwig.vger.email. [23.128.96.33]) by mx.google.com with ESMTPS id g8-20020aa79f08000000b006bd360e70edsi4546004pfr.103.2023.10.18.13.40.42 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 18 Oct 2023 13:40:56 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.33 as permitted sender) client-ip=23.128.96.33; Authentication-Results: mx.google.com; dkim=fail header.i=@openbsd.org header.s=selector1 header.b=ZQX3DGaS; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.33 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by lipwig.vger.email (Postfix) with ESMTP id F12BD807D9AD; Wed, 18 Oct 2023 13:40:08 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at lipwig.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232373AbjJRUgV (ORCPT + 99 others); Wed, 18 Oct 2023 16:36:21 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53994 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231986AbjJRUgT (ORCPT ); Wed, 18 Oct 2023 16:36:19 -0400 Received: from cvs.openbsd.org (cvs.openbsd.org [199.185.137.3]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C760E9F; Wed, 18 Oct 2023 13:36:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; s=selector1; bh=QWshJ3q0CW z66rkm4YqP7BTMbsMVrEYYbR/yILapp8Q=; h=date:references:in-reply-to: subject:cc:to:from; d=openbsd.org; b=ZQX3DGaSR+jOPuhULTujDPgl6aQpN9KuN gkvVNbu/uJzrcaVSBOPHJ6dvubIemeu4UDb7Lz4jF9Xxgu0aYinyXtirWEjOpnIn6eYy7W LdYoAlcHB28FhisY6YPTtKjbgfs16deat7bmpxb8RQYqu18SAa/XEuW4yqilS7oyycVzh4 4ZnQPden+AqQCDDCbKPo5vkMNkrQN/bfHbJzjkc+kwZbUzhlabKs6r622pTPH1p3QoQHx+ oLEzpQ+VIfeFw1AXzvqe4JsvLglRoDkc6FGrcvBBsEQivtO8T0yA9JL72qY4VIj/v6gCMx +hK54KiqMvQIZIeJKJk6cfh7eXZAA== Received: from cvs.openbsd.org (localhost [127.0.0.1]) by cvs.openbsd.org (OpenSMTPD) with ESMTP id 681028d6; Wed, 18 Oct 2023 14:36:13 -0600 (MDT) From: "Theo de Raadt" To: Jeff Xu cc: Matthew Wilcox , Linus Torvalds , jeffxu@chromium.org, akpm@linux-foundation.org, keescook@chromium.org, sroettger@google.com, 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, 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 Subject: Re: [RFC PATCH v1 0/8] Introduce mseal() syscall In-reply-to: References: <20231016143828.647848-1-jeffxu@chromium.org> <55960.1697566804@cvs.openbsd.org> <95482.1697587015@cvs.openbsd.org> Comments: In-reply-to Jeff Xu message dated "Wed, 18 Oct 2023 11:54:22 -0700." MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Date: Wed, 18 Oct 2023 14:36:13 -0600 Message-ID: <7071.1697661373@cvs.openbsd.org> X-Spam-Status: No, score=-0.6 required=5.0 tests=DKIM_INVALID,DKIM_SIGNED, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lipwig.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 (lipwig.vger.email [0.0.0.0]); Wed, 18 Oct 2023 13:40:09 -0700 (PDT) Jeff Xu wrote: > On Wed, Oct 18, 2023 at 8:17=E2=80=AFAM Matthew Wilcox wrote: > > > > Let's start with the purpose. The point of mimmutable/mseal/whatever is > > to fix the mapping of an address range to its underlying object, be it > > a particular file mapping or anonymous memory. After the call succeeds, > > it must not be possible to make any address in that virtual range point > > into any other object. > > > > The secondary purpose is to lock down permissions on that range. > > Possibly to fix them where they are, possibly to allow RW->RO transitio= ns. > > > > With those purposes in mind, you should be able to deduce for any sysca= ll > > or any madvise(), ... whether it should be allowed. > > > I got it. >=20 > IMO: The approaches mimmutable() and mseal() took are different, but > we all want to seal the memory from attackers and make the linux > application safer. I think you are building mseal for chrome, and chrome alone. I do not think this will work out for the rest of the application space because 1) it is too complicated 2) experience with mimmutable() says that applications don't do any of it themselves, it is all in execve(), libc initialization, and ld.so. You don't strike me as an execve, libc, or ld.so developer.