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 20F15C433EF for ; Wed, 20 Jul 2022 02:32:47 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S238203AbiGTCco (ORCPT ); Tue, 19 Jul 2022 22:32:44 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36322 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237456AbiGTCck (ORCPT ); Tue, 19 Jul 2022 22:32:40 -0400 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 3C945481E3 for ; Tue, 19 Jul 2022 19:32:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1658284356; 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: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=3uZbjgFMHeKFjmyd0QEm1xCO2NChsIABolYNiKdJ7Gg=; b=Lz3rNC3gm2RxiSMnzRywtItuGcEy7lBka8MLsVW9d2c7D7eXvO/cjcMVdJVdjtKwpr6xyS ioXinnEcA7gZ4oZfYW8xA0DAxo7vfr14QcTXV0Jt3B5HYyPQjRIrEEsX9ZTLXElRH6n7gu xOZDfXKHaBjTtawbw9ZRL9zflFLnsTg= Received: from mail-qk1-f198.google.com (mail-qk1-f198.google.com [209.85.222.198]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-45-AbPxVteUPYSJKRXWsoKmsA-1; Tue, 19 Jul 2022 22:32:35 -0400 X-MC-Unique: AbPxVteUPYSJKRXWsoKmsA-1 Received: by mail-qk1-f198.google.com with SMTP id t203-20020a3746d4000000b006af1d3e8068so13185834qka.0 for ; Tue, 19 Jul 2022 19:32:35 -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:content-transfer-encoding :in-reply-to; bh=3uZbjgFMHeKFjmyd0QEm1xCO2NChsIABolYNiKdJ7Gg=; b=Xc0zCYvXozlYURHiG2VJl3ir4OPFSBHkriFkQSct/0kJHaZG/l1qdEsUrO9P0rJ3Uy JBnEiVkU4yfjM4/ClwOEfzC9ecswIK/qZfkVoVsOGHbnpKwP3iMuCUf3gX4AK8jNEGFN 1esNXz7K0lr6a9og29pa7HJuiU9J7c4/3pODNNq1M6+XwjpdwYKF8Zuhn0MKEVdZinZN cxPNC/PoJGlW4QSPinrfBMTK/D5TzaszVdob0vESAiI9VAgAnwffowKVTeLh1pNsrfzm kO3oQKgjdxmgdEzHMvU2nTacjJqtMk1z0dBLm2dH4DSF+qItsrQcq8iuQVgZ8gsD4KjA euNA== X-Gm-Message-State: AJIora9j5YTC+w55tj+CGKpK4DClri2mdTvzA4xU19guC3p/smRxL7Ia WsnZGmil/U4VOpUq8aktUpJE4WiOfeglhMCkx8TGSFEFRRW01TzhO4a+vGQaTGqCp78cgmKVRor GQU/ekEmXZ2ehbBh6h9j1DaUA X-Received: by 2002:a05:6214:e41:b0:473:915c:3efe with SMTP id o1-20020a0562140e4100b00473915c3efemr27335403qvc.10.1658284355255; Tue, 19 Jul 2022 19:32:35 -0700 (PDT) X-Google-Smtp-Source: AGRyM1sqsBhXFhvJemKV/jwgAt84OQwS2X59Z2eXZUwYSIfKumUaM4t252ZCPnvZ1VuTZhBaV0SNdQ== X-Received: by 2002:a05:6214:e41:b0:473:915c:3efe with SMTP id o1-20020a0562140e4100b00473915c3efemr27335384qvc.10.1658284354992; Tue, 19 Jul 2022 19:32:34 -0700 (PDT) Received: from xz-m1.local (bras-base-aurron9127w-grc-37-74-12-30-48.dsl.bell.ca. [74.12.30.48]) by smtp.gmail.com with ESMTPSA id s11-20020a05620a0bcb00b006b5c5987ff2sm14701779qki.96.2022.07.19.19.32.33 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 19 Jul 2022 19:32:34 -0700 (PDT) Date: Tue, 19 Jul 2022 22:32:32 -0400 From: Peter Xu To: Nadav Amit Cc: Axel Rasmussen , Alexander Viro , Andrew Morton , Dave Hansen , "Dmitry V . Levin" , Gleb Fotengauer-Malinovskiy , Hugh Dickins , Jan Kara , Jonathan Corbet , Mel Gorman , Mike Kravetz , Mike Rapoport , Shuah Khan , Suren Baghdasaryan , Vlastimil Babka , zhangyi , "linux-doc@vger.kernel.org" , linux-fsdevel , LKML , Linux MM , "linux-kselftest@vger.kernel.org" Subject: Re: [PATCH v4 2/5] userfaultfd: add /dev/userfaultfd for fine grained access control Message-ID: References: <20220719195628.3415852-1-axelrasmussen@google.com> <20220719195628.3415852-3-axelrasmussen@google.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Jul 19, 2022 at 11:55:21PM +0000, Nadav Amit wrote: > Anyhow, I do want to clarify a bit about the “cross-process support” > userfaultfd situation. Basically, you can already get cross-process support > today, by using calling userfaultfd() on the controlled process and calling > pidfd_open() from another process. It does work and I do not remember any > issues that it introduced (in contrast, for instance, to io-uring, that > would break if you use userfaultfd+iouring+fork today). Do you mean to base it on pidof_getfd()? Just want to mention that this will still need collaboration of the target process as userfaultfd needs to be created explicitly there. From that POV it's still more similar to general SCM_RIGHTS trick to pass over the fd but just to pass it in a different way. IMHO the core change about having /proc/pid/userfaultfd is skipping that only last step to create the handle. -- Peter Xu