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 X-Spam-Level: X-Spam-Status: No, score=-8.4 required=3.0 tests=DKIMWL_WL_MED,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,USER_IN_DEF_DKIM_WL autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 3982BC5DF60 for ; Tue, 5 Nov 2019 16:41:58 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id EFD6820650 for ; Tue, 5 Nov 2019 16:41:57 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b="CbGKKPGg" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org EFD6820650 Authentication-Results: mail.kernel.org; dmarc=fail (p=reject dis=none) header.from=google.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 9C1E76B0008; Tue, 5 Nov 2019 11:41:57 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 94A976B000A; Tue, 5 Nov 2019 11:41:57 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 7EAED6B000C; Tue, 5 Nov 2019 11:41:57 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0212.hostedemail.com [216.40.44.212]) by kanga.kvack.org (Postfix) with ESMTP id 64C746B0008 for ; Tue, 5 Nov 2019 11:41:57 -0500 (EST) Received: from smtpin14.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay02.hostedemail.com (Postfix) with SMTP id 21A8A3499 for ; Tue, 5 Nov 2019 16:41:57 +0000 (UTC) X-FDA: 76122790674.14.aunt58_10f92f2224c52 X-HE-Tag: aunt58_10f92f2224c52 X-Filterd-Recvd-Size: 3731 Received: from mail-lj1-f193.google.com (mail-lj1-f193.google.com [209.85.208.193]) by imf21.hostedemail.com (Postfix) with ESMTP for ; Tue, 5 Nov 2019 16:41:56 +0000 (UTC) Received: by mail-lj1-f193.google.com with SMTP id k15so10509350lja.3 for ; Tue, 05 Nov 2019 08:41:56 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=CPAWoJPOWFI9tZt+Z9WZhKGPSIvelnJJqs8XUy+V46k=; b=CbGKKPGgaC64y9p1BQq2+o8j3eZeZ9xzHn8JM0uVa/q2Dp+fcmnbfaSGvPUxtlWjOS ynZSdksFstX3dfMBSBg9tio5MZWnxRY6E7meZbkdx/z1h07ghzvK3IuvI1rXj14LMx+A 3PsnudVi44KqkoSJSpfg66RMkDWNbjEBwkW8KDptiEdJzM5ryLb72MooGxElnni7OIKe zx9XJ0wui53vXA58fv5HWJnIk+ltmjQZ8JsgFM6ipJSqo7wifvmA4eEw1JObeYBkkXSH Ffb7hexTfsnPXuxAufhBpC0ii8o0VzIJ7yjyvhHtQ1CwosO8muSP1sgfcpjtqOgt3GeT 8FuA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=CPAWoJPOWFI9tZt+Z9WZhKGPSIvelnJJqs8XUy+V46k=; b=Bu8YXYsgqW94v4Q1TXIEXEhsLuLepUB+NEwYOxniT2e02AVC16B1oDyxaYU4WFum33 Ospaton2mEK2JGDEs+rpEU93H0zkDOtnRb9PLmwb25XFeNOTwT9f04qu6zCdNyTy61LI T54jBbawgUFRr729PMrQ1jQPwbr0PvtChxWeNGsW4l/zCcf1/AGmFadC4fh1/B8KvnHY Ca5gHXq+hTwzl9BjlRpIygiLGHJX7j30hClw5Ma81pqeLv97XinXAvjq3QRGHUki6I6z 4B2hYCnqN40NP4tj8BPmQaPkGj4MrIeBcCT4y1wUBTPPA1QPapobvDiL8dW2GmZfru9A BcFQ== X-Gm-Message-State: APjAAAXATmXM8hrmFdQ+H1bytqHuYL7Texkl57rNvCnmmzHsbdv1tfXH x/6nEYdqbJ7aNMqKjdXywtYjROLCVSJcxarC8sgc0g== X-Google-Smtp-Source: APXvYqzJhVMjwxTvLIsbgfPh/CEzKCXdjh4ZL0tYyqLClkvm34sCnU8o9OP8Jjv4YmS1doxJFXVAsqkHWRlEyPnswzU= X-Received: by 2002:a2e:3111:: with SMTP id x17mr23711544ljx.146.1572972114631; Tue, 05 Nov 2019 08:41:54 -0800 (PST) MIME-Version: 1.0 References: <1572967777-8812-1-git-send-email-rppt@linux.ibm.com> <1572967777-8812-2-git-send-email-rppt@linux.ibm.com> <20191105162424.GH30717@redhat.com> In-Reply-To: <20191105162424.GH30717@redhat.com> From: Daniel Colascione Date: Tue, 5 Nov 2019 08:41:18 -0800 Message-ID: Subject: Re: [PATCH 1/1] userfaultfd: require CAP_SYS_PTRACE for UFFD_FEATURE_EVENT_FORK To: Andrea Arcangeli Cc: Andy Lutomirski , Mike Rapoport , linux-kernel , Andrew Morton , Jann Horn , Linus Torvalds , Lokesh Gidra , Nick Kralevich , Nosh Minwalla , Pavel Emelyanov , Tim Murray , Linux API , linux-mm Content-Type: text/plain; charset="UTF-8" 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 Tue, Nov 5, 2019 at 8:24 AM Andrea Arcangeli wrote: > The long term plan is to introduce UFFD_FEATURE_EVENT_FORK2 feature > flag that uses the ioctl to receive the child uffd, it'll consume more > CPU, but it wouldn't require the PTRACE privilege anymore. Why not just have callers retrieve FDs using recvmsg? This way, you retrieve the message packet and the file descriptor at the same time and you don't need any appreciable extra CPU use.