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 5D18DC5DF60 for ; Tue, 5 Nov 2019 15:55:57 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 144E6217F5 for ; Tue, 5 Nov 2019 15:55:57 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b="uv+lqTeL" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 144E6217F5 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 B90FA6B000D; Tue, 5 Nov 2019 10:55:56 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id B67E66B000E; Tue, 5 Nov 2019 10:55:56 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id AA57A6B0010; Tue, 5 Nov 2019 10:55:56 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0253.hostedemail.com [216.40.44.253]) by kanga.kvack.org (Postfix) with ESMTP id 962F16B000D for ; Tue, 5 Nov 2019 10:55:56 -0500 (EST) Received: from smtpin22.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay04.hostedemail.com (Postfix) with SMTP id 60366282D for ; Tue, 5 Nov 2019 15:55:56 +0000 (UTC) X-FDA: 76122674712.22.geese03_33c716eb07909 X-HE-Tag: geese03_33c716eb07909 X-Filterd-Recvd-Size: 3634 Received: from mail-lj1-f193.google.com (mail-lj1-f193.google.com [209.85.208.193]) by imf31.hostedemail.com (Postfix) with ESMTP for ; Tue, 5 Nov 2019 15:55:55 +0000 (UTC) Received: by mail-lj1-f193.google.com with SMTP id m9so22401368ljh.8 for ; Tue, 05 Nov 2019 07:55: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=JBjPVawkw1D9alty2gxLh6X6OcB+iTnvmGu5mIHwLJg=; b=uv+lqTeLWQdQa3Az+claLZ2Why5fQC8C3uqj/IVPZrAu/WNR4AVwgyjksYefYB//Lb 6MQfsmN9eqwJC8gCdiVTJqA6uNqBe3y3dmPqF2me9g9Jg33v8hzZBWCT0tt+bHnA8HIk almprJnYwnBhBEVLwEWJtGqpKDYAKJfmY3cssi4VAasH8tZfn/UgUFxJyhyVkwD0hVwX bUskZyfPEsz8sxqVqdaGQ0g7EVvRetUYPr0XpAxLBuWk2VppC53JYQ4cvvyw/Tk32c3g Y48KJDS8SIgYst++jQrQDEExvG07MbUpzJPdRNXfXVIYCsNtIBzk+7qIeQIMKt5h1aU5 x0/A== 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=JBjPVawkw1D9alty2gxLh6X6OcB+iTnvmGu5mIHwLJg=; b=V5V8q3S6cbNvLyTRqZhbctgV5dX3Q37qNd2I8kQxlGB1fj88xGaoZ+YARk5PBvUYAk ZGpG3d1YVBc/9Ly9FcTu2BWJV77WGunlt5QeU2m5JO0My7s1tHR/70mj5tk2hOP50eL+ HkGOSQgmMkd4yDyxjlgB9le3q9LJufyuvpKOaHekfrBY6/rRiywgK9z3ugeu3foZ+B7N mwYWbUdoXyCc+GK95H4BLc6VbELnoho+CvUB1IvYWUKi1/JsQp11sEHOteLrnAjnB1jy JvQepcYlR2M7Y8fD2DfkJIslerIXiRtBVe2FCM3q5x/Jsq1ZFUCLU/U07InkAkf3zqXQ gTkA== X-Gm-Message-State: APjAAAU8D/O/dq2nb5HCS0y3LMGeYpO3QxaQos/9Tw300cIz/gdfzxA5 EQRqIHGUHWa1GHPMG+4RDDqMWfyekvr5PKE970ltYg== X-Google-Smtp-Source: APXvYqxzXAYCCtN4vYGeUwBs7NzYo7aq+jmkHe7kRaIoNYXrHcoEVfLgw9HeYSsNg1dpsk5d7gY8SOAg2C6mzEQPfuY= X-Received: by 2002:a2e:b4aa:: with SMTP id q10mr19425669ljm.250.1572969353779; Tue, 05 Nov 2019 07:55:53 -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> In-Reply-To: <1572967777-8812-2-git-send-email-rppt@linux.ibm.com> From: Daniel Colascione Date: Tue, 5 Nov 2019 07:55:17 -0800 Message-ID: Subject: Re: [PATCH 1/1] userfaultfd: require CAP_SYS_PTRACE for UFFD_FEATURE_EVENT_FORK To: Mike Rapoport Cc: linux-kernel , Andrea Arcangeli , Andrew Morton , Andy Lutomirski , 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 7:29 AM Mike Rapoport wrote: > > Current implementation of UFFD_FEATURE_EVENT_FORK modifies the file > descriptor table from the read() implementation of uffd, which may have > security implications for unprivileged use of the userfaultfd. > > Limit availability of UFFD_FEATURE_EVENT_FORK only for callers that have > CAP_SYS_PTRACE. Thanks. But shouldn't we be doing the capability check at userfaultfd(2) time (when we do the other permission checks), not later, in the API ioctl?