From mboxrd@z Thu Jan 1 00:00:00 1970 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 BD0C9CDB47E for ; Wed, 18 Oct 2023 20:39:51 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232438AbjJRUgW (ORCPT ); Wed, 18 Oct 2023 16:36:22 -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> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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.