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 kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id 07996C433EF for ; Mon, 13 Jun 2022 22:29:36 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 387538D01EA; Mon, 13 Jun 2022 18:29:36 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 30E258D01E9; Mon, 13 Jun 2022 18:29:36 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 189D78D01EA; Mon, 13 Jun 2022 18:29:36 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0017.hostedemail.com [216.40.44.17]) by kanga.kvack.org (Postfix) with ESMTP id 036228D01E9 for ; Mon, 13 Jun 2022 18:29:36 -0400 (EDT) Received: from smtpin06.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay02.hostedemail.com (Postfix) with ESMTP id C4255339F7 for ; Mon, 13 Jun 2022 22:29:35 +0000 (UTC) X-FDA: 79574655510.06.29D5246 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by imf26.hostedemail.com (Postfix) with ESMTP id CC934140085 for ; Mon, 13 Jun 2022 22:29:34 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1655159372; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=N9slvxSG8yuHf5LjsS6/OHnxn9VuKQYSBmJtKIsodrQ=; b=TjRM9LR4WC3YlE8PD2X3jJdNx1EnExzaqP037+4HgLHzVT0fByLT7mBbeNJbK2KZCQYPnB a6u/c/eS9OByf40OaHNmIRQ59ZD7Z+Ev4SX/dULjLP9mNr+13qdW9PfCDrhGG9TR1lAFsm rXhJ8r5f6WO1JLpyryJ+6zzrQCraH1U= Received: from mail-io1-f70.google.com (mail-io1-f70.google.com [209.85.166.70]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-185-0p-vB_euOimcrpPXrbjqwA-1; Mon, 13 Jun 2022 18:29:31 -0400 X-MC-Unique: 0p-vB_euOimcrpPXrbjqwA-1 Received: by mail-io1-f70.google.com with SMTP id l3-20020a05660227c300b0065a8c141580so3376594ios.19 for ; Mon, 13 Jun 2022 15:29:31 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=N9slvxSG8yuHf5LjsS6/OHnxn9VuKQYSBmJtKIsodrQ=; b=14++MBxkMsH50zS8iASNTP2q8v7dYmQRtBJgsQ1/EYWwN/fOY3Kfq/F/SbFbr0wnk5 x915zg7KA65gPVekN6r0GyFgo97kbbGeLOqfiP3ppA4FbG9xiQy9JKdFLnGnXjrtdV9v Z6S3707kG8F3c00y2Q60DDs6T29GbPIACz8D9rEVd4A3Mqwm0tolsBxiLjUITJN0+SFE aG5RV6XE7uAAUT4PTAiRkVO5Hi3lK7F4DPHvNLjYoWRoEAZpON9aRHNxviIgJKDUSR4G 0SL3jPuY5xICS6YrXdBlJ+YmLNXFUs9oklDbaligNzYuvix2YXNPQ3j+pWMwECgk9An7 ysZg== X-Gm-Message-State: AOAM5332jOwDMjfzh1qBuJWkBgfnCVm8UIqxD9kRHwJuiWZcb/qJUiDj XlSxv+sco9i0YF0MBc4n9qauAtaYnKwVeSmybWFf02YkL2Gf9UC0wENxjfiid5kOQ3e/1EwatI2 dN7E/mRnZAYc= X-Received: by 2002:a05:6602:2d0e:b0:64f:d1ff:ac9c with SMTP id c14-20020a0566022d0e00b0064fd1ffac9cmr999347iow.41.1655159370947; Mon, 13 Jun 2022 15:29:30 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzYuLiEIgEbDCMpfZ5G5MofdrV4wPXivgDYQrkwahKK9C4xyx5BABua4comPb9o8kU9eTD8mQ== X-Received: by 2002:a05:6602:2d0e:b0:64f:d1ff:ac9c with SMTP id c14-20020a0566022d0e00b0064fd1ffac9cmr999316iow.41.1655159370649; Mon, 13 Jun 2022 15:29:30 -0700 (PDT) Received: from xz-m1.local (cpec09435e3e0ee-cmc09435e3e0ec.cpe.net.cable.rogers.com. [99.241.198.116]) by smtp.gmail.com with ESMTPSA id k26-20020a02661a000000b0032e22496addsm4041331jac.139.2022.06.13.15.29.28 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 13 Jun 2022 15:29:29 -0700 (PDT) Date: Mon, 13 Jun 2022 18:29:27 -0400 From: Peter Xu To: Andrew Morton Cc: Axel Rasmussen , Alexander Viro , Charan Teja Reddy , Dave Hansen , "Dmitry V . Levin" , Gleb Fotengauer-Malinovskiy , Hugh Dickins , Jan Kara , Jonathan Corbet , Mel Gorman , Mike Kravetz , Mike Rapoport , Nadav Amit , Shuah Khan , Suren Baghdasaryan , Vlastimil Babka , zhangyi , linux-doc@vger.kernel.org, linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, linux-mm@kvack.org, linux-kselftest@vger.kernel.org Subject: Re: [PATCH v3 2/6] userfaultfd: add /dev/userfaultfd for fine grained access control Message-ID: References: <20220601210951.3916598-1-axelrasmussen@google.com> <20220601210951.3916598-3-axelrasmussen@google.com> <20220613145540.1c9f7750092911bae1332b92@linux-foundation.org> MIME-Version: 1.0 In-Reply-To: <20220613145540.1c9f7750092911bae1332b92@linux-foundation.org> X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset=utf-8 Content-Disposition: inline ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1655159375; a=rsa-sha256; cv=none; b=Av0BoIRDlhGCj1WvgCB/p1ynbWQ480dtfNQP0jffXeJBTyEbkgd0pdYsaBD1VlOcGnQKrP +ihT5vbbpjPc64/fNzBePXD+NL6A92Dzq+Ygb4vLJEjInkxuyHiV6isWWI2m8mXzkkWea2 LiiNoedO9xqH2dnMN3KBEH5JFNKL7U4= ARC-Authentication-Results: i=1; imf26.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b=TjRM9LR4; spf=none (imf26.hostedemail.com: domain of peterx@redhat.com has no SPF policy when checking 170.10.129.124) smtp.mailfrom=peterx@redhat.com; dmarc=pass (policy=none) header.from=redhat.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1655159375; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=N9slvxSG8yuHf5LjsS6/OHnxn9VuKQYSBmJtKIsodrQ=; b=FiqI5tbyytD3dsNyMAHi+vb6oV30N9r5b9l73dfLYFSKsbMrVKxotcrNgJ1EhwNAidP6z7 dbnu5S+B9yvICAIf3GsqC21vMM4ilsvUJsi6soxH1wySu6idGrMyIkYtqSXr6xh7ll6iel Cqq0d24DM9GC5aenbNwumInWTTuiSXo= X-Stat-Signature: 4z4nfqsi67tsr8n644yrzcz4pfdcaddj X-Rspamd-Queue-Id: CC934140085 Authentication-Results: imf26.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b=TjRM9LR4; spf=none (imf26.hostedemail.com: domain of peterx@redhat.com has no SPF policy when checking 170.10.129.124) smtp.mailfrom=peterx@redhat.com; dmarc=pass (policy=none) header.from=redhat.com X-Rspamd-Server: rspam07 X-Rspam-User: X-HE-Tag: 1655159374-843723 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: On Mon, Jun 13, 2022 at 02:55:40PM -0700, Andrew Morton wrote: > On Wed, 1 Jun 2022 14:09:47 -0700 Axel Rasmussen wrote: > > > To achieve this, add a /dev/userfaultfd misc device. This device > > provides an alternative to the userfaultfd(2) syscall for the creation > > of new userfaultfds. The idea is, any userfaultfds created this way will > > be able to handle kernel faults, without the caller having any special > > capabilities. Access to this mechanism is instead restricted using e.g. > > standard filesystem permissions. > > The use of a /dev node isn't pretty. Why can't this be done by > tweaking sys_userfaultfd() or by adding a sys_userfaultfd2()? > > Peter, will you be completing review of this patchset? Sorry to not have reviewed it proactively.. I think it's because I never had a good picture/understanding of what should be the best security model for uffd, meanwhile I am (it seems) just seeing more and more ways to "provide a safer uffd" by different people using different ways.. and I never had time (and probably capability too..) to figure out the correct approach if not to accept all options provided. I think I'll just assume the whole thing is acked already from you generally, then I'll read at least the implementation before the end of tomorrow. Thanks, -- Peter Xu