Received: by 2002:a25:868d:0:0:0:0:0 with SMTP id z13csp873148ybk; Wed, 20 May 2020 14:20:57 -0700 (PDT) X-Google-Smtp-Source: ABdhPJza7k7F7MGQH/HruZ+YN3ix04OjWMNBCAdK3g+LwKNeV9JesyubJnG1sWp232W6iqAzE+UX X-Received: by 2002:a17:906:ce39:: with SMTP id sd25mr905833ejb.482.1590009657388; Wed, 20 May 2020 14:20:57 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1590009657; cv=none; d=google.com; s=arc-20160816; b=eXsYcwP2IyLa9XMFq4U/pScUMuOlrcFzJkLH/kGT/oYOc90TbnZ2ZWNz1N7Nacbw80 Z5pnswTyhk2GH8h0i7B+DompzexiELbUNCdLEtJzZSbISsMzBQLP7eywjLEY9cDWoE1j Wpp+ZNBOvc2DUWf1tXSUuR2t9BOAEkWmMsfti96j8SFz6gDha1OgGG6I60ebWjrfDhkg IJoOpymn6iO3sZfQFvTTLRQwby41Fj8FUF/68WBOuyvrT1+SrvGFarZZYavAyUjASB19 73MGlwYsAqWEmSDIwY+33gANhFdDj2BG43WPf/MWHue6q1osEkUi3r9YVPMWlLJgi7Pf I/TA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=66Hol5qyCUFMxPkUsApvxi2EbBWIVzL0cKnQXWEPmBk=; b=WXJvYwI1RWI+9a2K98W8P8++Kvuo2PWs3Vtd2chcOodZ+nLFybJafi94psOYHz4SVs xjvd6DrogWq54BsA1agffQKqas0ETdvCRE3dwt36bcwqGC8RtFMs+oEBGZW0RDVWUyU6 qIK0eq6z4iRtBB6W6/GjtZRNUFHeoPvx0Xl69dBt9eZ0nBdOwSTOs9ZIGt1/84gEBnmO Sos1I7R1zkdePd8xvl5n2y9Ha4sk859BPsroo0X3zuQCbJwExfrYW5792vLjuZT9eZZD aB2Dk5ysViLsfSgO7lDcURy/8s4eE0fAdyToHJ1eNMJqWJyzH/Qvd6oMZlqeMRFaq4wF ksgw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=M706xbrC; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id gr5si2184056ejb.509.2020.05.20.14.20.31; Wed, 20 May 2020 14:20:57 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=M706xbrC; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728294AbgETVQu (ORCPT + 99 others); Wed, 20 May 2020 17:16:50 -0400 Received: from us-smtp-delivery-1.mimecast.com ([207.211.31.120]:49110 "EHLO us-smtp-1.mimecast.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726892AbgETVQu (ORCPT ); Wed, 20 May 2020 17:16:50 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1590009409; 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: in-reply-to:in-reply-to:references:references; bh=66Hol5qyCUFMxPkUsApvxi2EbBWIVzL0cKnQXWEPmBk=; b=M706xbrCDKav3vmcVTiClJS21YEAkJlL8m56NZxUbHjuOrWlNwmlii85+hzEJDqLglSvLT cZ4A4ZWQsBwCJqUMTkua8yIWkAtl4w3CBeXAv/tYx43+ts9SnK5NFYu08KCE0unoUZPWyK eIEbx8VjTBzjqaCW3L0D1GIcwNWFYgo= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-451-SbZPDIEGM3GaELLT19_jZw-1; Wed, 20 May 2020 17:16:45 -0400 X-MC-Unique: SbZPDIEGM3GaELLT19_jZw-1 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id C2281A0BD9; Wed, 20 May 2020 21:16:41 +0000 (UTC) Received: from mail (ovpn-112-106.rdu2.redhat.com [10.10.112.106]) by smtp.corp.redhat.com (Postfix) with ESMTPS id A7B0870879; Wed, 20 May 2020 21:16:35 +0000 (UTC) Date: Wed, 20 May 2020 17:16:34 -0400 From: Andrea Arcangeli To: Lokesh Gidra Cc: Suren Baghdasaryan , Kees Cook , "Michael S. Tsirkin" , Daniel Colascione , Jonathan Corbet , Alexander Viro , Luis Chamberlain , Iurii Zaikin , Mauro Carvalho Chehab , Andrew Morton , Andy Shevchenko , Vlastimil Babka , Mel Gorman , Sebastian Andrzej Siewior , Peter Xu , Mike Rapoport , Jerome Glisse , Shaohua Li , linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, linux-fsdevel@vger.kernel.org, Tim Murray , Minchan Kim , Sandeep Patil , kernel@android.com Subject: Re: [PATCH 2/2] Add a new sysctl knob: unprivileged_userfaultfd_user_mode_only Message-ID: <20200520211634.GL26186@redhat.com> References: <20200423002632.224776-1-dancol@google.com> <20200423002632.224776-3-dancol@google.com> <20200508125054-mutt-send-email-mst@kernel.org> <20200508125314-mutt-send-email-mst@kernel.org> <20200520045938.GC26186@redhat.com> <202005200921.2BD5A0ADD@keescook> <20200520194804.GJ26186@redhat.com> <20200520195134.GK26186@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.14.0 (2020-05-02) X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, May 20, 2020 at 01:17:20PM -0700, Lokesh Gidra wrote: > Adding the Android kernel team in the discussion. Unless I'm mistaken that you can already enforce bit 1 of the second parameter of the userfaultfd syscall to be set with seccomp-bpf, this would be more a question to the Android userland team. The question would be: does it ever happen that a seccomp filter isn't already applied to unprivileged software running without SYS_CAP_PTRACE capability? If answer is "no" the behavior of the new sysctl in patch 2/2 (in subject) should be enforceable with minor changes to the BPF assembly. Otherwise it'd require more changes. Thanks! Andrea