Received: by 2002:a25:31c3:0:0:0:0:0 with SMTP id x186csp1000192ybx; Tue, 5 Nov 2019 08:44:07 -0800 (PST) X-Google-Smtp-Source: APXvYqylNTprp0VLBG9m6ujW9m0rzjoJy7jslIE2mbzUmZFe/1O+X7q6dyuJpd7cmaGTbSrwobcx X-Received: by 2002:aa7:d483:: with SMTP id b3mr36530641edr.178.1572972247743; Tue, 05 Nov 2019 08:44:07 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1572972247; cv=none; d=google.com; s=arc-20160816; b=CqG/OQ/OFoW+DvSutYflflRjLNVcK6IR5q1PoRLw99g+mZIou681/E9/CjMJnd1ms0 ZEu11TU3st+JFEy726lu9Ieva9LdCWmbmlO0t1erFooiU1yzU6+ar54hGE+SfFqDjAub gX9LNvYcrlnvW2edgjNva9rlsWtJ/R3BYEabpXz7oqfNWECvlks1gTpeRhpYVI3X0sxP eCVwVpAGLMMa/cRLoMc0xWeA84qXZ5KB7iEKzV/b46KaZwbfUHsgoIYtm+Deyywy+/kz VwrVJc8V5zG0DykotDqGnpm5s1ZrbikxZHn2t6ucvtKqYuZp99WAoqdFRVagwuTjizpC bgqQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=CPAWoJPOWFI9tZt+Z9WZhKGPSIvelnJJqs8XUy+V46k=; b=FGhFMGMyaGcNESedbbLQ5BwMq2w9VMXGEzgFIOUR4FyVSvhTB8kXX15SbQGGHgvFBG RABzruwZdirxDxTCUrdgbR6pukG306l0ajPgvGm7afhlpY6D8CnQNv6DIPXXZP/m5apN jCrzg3Aq+cdfKXS0ZapSJ/FaVAu2MiPkRmYOEyzhsswNQtNyO6FXaAGTceOU2d5IVotr tBl9VCBgtdBneD+I3j9GGYb3hMk5EKwXBkfpVaqoFyjdm5RyuKImiPHb2KRkLDAK+Uvi sIeNJkc0tG4NkX1hAmo7hnKdUqOBtAcnb+s6+/4SPADXyd8waQSF8tRq0meKG6PMAZNJ fviw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=CbGKKPGg; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id o16si10605585edi.158.2019.11.05.08.43.43; Tue, 05 Nov 2019 08:44:07 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=CbGKKPGg; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2390209AbfKEQl5 (ORCPT + 99 others); Tue, 5 Nov 2019 11:41:57 -0500 Received: from mail-lj1-f194.google.com ([209.85.208.194]:41238 "EHLO mail-lj1-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2390123AbfKEQl5 (ORCPT ); Tue, 5 Nov 2019 11:41:57 -0500 Received: by mail-lj1-f194.google.com with SMTP id m9so22590279ljh.8 for ; Tue, 05 Nov 2019 08:41:55 -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=ECh7Rp48axmaiJuR0LKCgunu+dhFf4qTmVqmDbshuIthoZvY95Q6aldmV9deRcEOu8 jK9dXbJ68T/MEjMj6r2f+RHkw6yhA97nZI/+7awUrv2jC+YOOEXrrlFtBvkJhTfVtGOs CwVFjd9KjmSb1zXZtz/MMXr3qY9/UzHiVqkDZ/neZzj6bHWGeMLeAXH/GguWsxysiDoy Lexde4VcaTagrQqjfQLK+wNwu5ptB4Uy8xrX4qFGBxPQ0U5oF2KgTKt/u8MvDtyCmK9G PkYZ9ukjTkXmeR5XZncCNQQQUYV21LStagp4POf6URtB/IQ8ZIXcdnZO/rPKY8O88Rkn Knpg== X-Gm-Message-State: APjAAAWAWeVtyt4sdlTZEqSRmaAXRME40jWUChT34gg9aY4QaIlKFN9j Dn98QpLVbK67XIIMiOlk4z4sT/u2kD79MLXWt5VBiA== 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" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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.