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=-2.5 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_PASS,USER_AGENT_MUTT autolearn=unavailable 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 2F343C4360F for ; Tue, 12 Mar 2019 13:53:34 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 0C9F6214AE for ; Tue, 12 Mar 2019 13:53:33 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726834AbfCLNxd (ORCPT ); Tue, 12 Mar 2019 09:53:33 -0400 Received: from mx0b-001b2d01.pphosted.com ([148.163.158.5]:44478 "EHLO mx0a-001b2d01.pphosted.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1725894AbfCLNxc (ORCPT ); Tue, 12 Mar 2019 09:53:32 -0400 Received: from pps.filterd (m0098416.ppops.net [127.0.0.1]) by mx0b-001b2d01.pphosted.com (8.16.0.27/8.16.0.27) with SMTP id x2CDYss4040859 for ; Tue, 12 Mar 2019 09:53:31 -0400 Received: from e06smtp02.uk.ibm.com (e06smtp02.uk.ibm.com [195.75.94.98]) by mx0b-001b2d01.pphosted.com with ESMTP id 2r6dgsthfh-1 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=NOT) for ; Tue, 12 Mar 2019 09:53:30 -0400 Received: from localhost by e06smtp02.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Tue, 12 Mar 2019 13:53:28 -0000 Received: from b06cxnps4076.portsmouth.uk.ibm.com (9.149.109.198) by e06smtp02.uk.ibm.com (192.168.101.132) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; (version=TLSv1/SSLv3 cipher=AES256-GCM-SHA384 bits=256/256) Tue, 12 Mar 2019 13:53:21 -0000 Received: from d06av23.portsmouth.uk.ibm.com (d06av23.portsmouth.uk.ibm.com [9.149.105.59]) by b06cxnps4076.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id x2CDrKpf31588396 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL); Tue, 12 Mar 2019 13:53:20 GMT Received: from d06av23.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 72642A4059; Tue, 12 Mar 2019 13:53:20 +0000 (GMT) Received: from d06av23.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id C2510A4053; Tue, 12 Mar 2019 13:53:18 +0000 (GMT) Received: from rapoport-lnx (unknown [9.148.8.84]) by d06av23.portsmouth.uk.ibm.com (Postfix) with ESMTPS; Tue, 12 Mar 2019 13:53:18 +0000 (GMT) Date: Tue, 12 Mar 2019 15:53:17 +0200 From: Mike Rapoport To: Peter Xu Cc: linux-kernel@vger.kernel.org, Paolo Bonzini , Hugh Dickins , Luis Chamberlain , Maxime Coquelin , kvm@vger.kernel.org, Jerome Glisse , Pavel Emelyanov , Johannes Weiner , Martin Cracauer , Denis Plotnikov , linux-mm@kvack.org, Marty McFadden , Maya Gokhale , Mike Kravetz , Andrea Arcangeli , Mike Rapoport , Kees Cook , Mel Gorman , "Kirill A . Shutemov" , linux-fsdevel@vger.kernel.org, "Dr . David Alan Gilbert" , Andrew Morton Subject: Re: [PATCH 1/3] userfaultfd/sysctl: introduce unprivileged_userfaultfd References: <20190311093701.15734-1-peterx@redhat.com> <20190311093701.15734-2-peterx@redhat.com> <20190312065830.GB9497@rapoport-lnx> <20190312122633.GE14108@xz-x1> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20190312122633.GE14108@xz-x1> User-Agent: Mutt/1.5.24 (2015-08-30) X-TM-AS-GCONF: 00 x-cbid: 19031213-0008-0000-0000-000002CBB02B X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 19031213-0009-0000-0000-00002237D009 Message-Id: <20190312135316.GA22990@rapoport-lnx> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:,, definitions=2019-03-12_07:,, signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 priorityscore=1501 malwarescore=0 suspectscore=0 phishscore=0 bulkscore=0 spamscore=0 clxscore=1015 lowpriorityscore=0 mlxscore=0 impostorscore=0 mlxlogscore=866 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1810050000 definitions=main-1903120097 Sender: linux-fsdevel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-fsdevel@vger.kernel.org On Tue, Mar 12, 2019 at 08:26:33PM +0800, Peter Xu wrote: > On Tue, Mar 12, 2019 at 08:58:30AM +0200, Mike Rapoport wrote: > > [...] > > > > +config USERFAULTFD_UNPRIVILEGED_DEFAULT > > > + string "Default behavior for unprivileged userfault syscalls" > > > + depends on USERFAULTFD > > > + default "disabled" > > > + help > > > + Set this to "enabled" to allow userfaultfd syscalls from > > > + unprivileged users. Set this to "disabled" to forbid > > > + userfaultfd syscalls from unprivileged users. Set this to > > > + "kvm" to forbid unpriviledged users but still allow users > > > + who had enough permission to open /dev/kvm. > > > > I'd phrase it a bit differently: > > > > This option controls privilege level required to execute userfaultfd > ^ > +---- add " the default"? > > > system call. > > > > Set this to "enabled" to allow userfaultfd system call from unprivileged > > users. > > Set this to "disabled" to allow userfaultfd system call only for users who > > have ptrace capability. > > Set this to "kvm" to restrict userfaultfd system call usage to users with > ^ > add " who have ptrace capability, or" -------+ > > > permissions to open "/dev/kvm". > > I think your version is better than mine, but I'd like to confirm > about above two extra changes before I squash them into the patch. :) I like your changes. > Thanks! > > -- > Peter Xu > -- Sincerely yours, Mike.