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 D4F4BCCA47C for ; Mon, 13 Jun 2022 21:55:49 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S244914AbiFMVzs (ORCPT ); Mon, 13 Jun 2022 17:55:48 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34630 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230254AbiFMVzp (ORCPT ); Mon, 13 Jun 2022 17:55:45 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 74FDF20BDC; Mon, 13 Jun 2022 14:55:44 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id 07F8BB8160E; Mon, 13 Jun 2022 21:55:43 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id F3BCAC34114; Mon, 13 Jun 2022 21:55:40 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linux-foundation.org; s=korg; t=1655157341; bh=AF0PJZhUcs0mBF42nPc3xhzkjbqEMjUTmXKOM9WAw0w=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=gp1jX8WfBHjFifwdWq/r3rM+5ff1PyLfsrvNPCjL/KEoA5z0WY0FtNdKvktKG0/H1 OB+hODIpwiz5HZLXvMhRq56RlFjgs5LTz+/hue49mnCAYI6yqm1CSfpP6KU4dZUWQ/ m3cc6+SIkl7LrNXdoQsOBT4vqiuz9nkbOs5BVJN8= Date: Mon, 13 Jun 2022 14:55:40 -0700 From: Andrew Morton To: Axel Rasmussen Cc: 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 , Peter Xu , 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: <20220613145540.1c9f7750092911bae1332b92@linux-foundation.org> In-Reply-To: <20220601210951.3916598-3-axelrasmussen@google.com> References: <20220601210951.3916598-1-axelrasmussen@google.com> <20220601210951.3916598-3-axelrasmussen@google.com> X-Mailer: Sylpheed 3.7.0 (GTK+ 2.24.33; x86_64-redhat-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-fsdevel@vger.kernel.org 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?