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=-11.4 required=3.0 tests=BAYES_00,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 5B0E5C433DF for ; Fri, 21 Aug 2020 03:49:08 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 3606720714 for ; Fri, 21 Aug 2020 03:49:08 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b="Aq+MFU9K" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727924AbgHUDtH (ORCPT ); Thu, 20 Aug 2020 23:49:07 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57740 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727074AbgHUDtF (ORCPT ); Thu, 20 Aug 2020 23:49:05 -0400 Received: from mail-io1-xd44.google.com (mail-io1-xd44.google.com [IPv6:2607:f8b0:4864:20::d44]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1D583C061385 for ; Thu, 20 Aug 2020 20:49:05 -0700 (PDT) Received: by mail-io1-xd44.google.com with SMTP id t15so474545iob.3 for ; Thu, 20 Aug 2020 20:49:05 -0700 (PDT) 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=YD6EeTnsT2wy78rPM62cWU7iNSgM0HOqIQD7wF0JrbY=; b=Aq+MFU9KfwsZ6o2zwcEjbLvshHLnaZ6+vHTfx0cyGPVPvcdPDwWcejYGYyDqS3xjHG McomnkZUutkTmLbcxfQyj/9Da7L6YBAqC3T/66zupxF23Yvl/gjon8spfexymNQ7S1px iSStKpkFx0XXuhE79pL51BmzeTXHk+JpFXgaGli36qLoxMCyzzLpP0FZS+iNL5ZdUC2x xMnP0ex12um7i+J6B9RgoAtiZzv0bvjkzB5GaNC9TccJNFCnfnZMTsKBrSE5u+jdN7yI B4PsPDzSC31jiX+amsUT7YPuPBq+uS50qXN5DIZ+mHEs9kbz+ElK6ekebmV8mEMH6F5O R1Ug== 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=YD6EeTnsT2wy78rPM62cWU7iNSgM0HOqIQD7wF0JrbY=; b=J5zAuG8mkxypyA8XSVKn9kSbcy5Wwhmlsr1zRspfPdIvZUm/LjLATFLb4w2WteZddf tRDgI6E14LUytk0XOhELSwsgNJJ+VP5V3TV/FnANzenrk7LldZyrAHc4BKwLBkcXT/nC J1a3BeaIeeoD6hR3uN9rzNODGkZZp9AUqpD8fKXml+kAu3wM8IOaHKD/JIrD2VpZo+Ce Nc0crJW0gVVG7at8tK0hKp5oSviQd6nJ79P2fzWFu2+oCurf58GjGsw9WSArhJIXDjLg T5JKSYHZJ3FjdHKVG/RHaIpV3IZ/wkS2o1YnCiAiAGTgVeyv0eoSjNx+433SExyXL7eF csJg== X-Gm-Message-State: AOAM5306YuhbXVgQnsftX/pIozrosJ7SjxzKU0LnS8kSx/m81OXrTpM5 +MwBsremCZzu1rFWkooGOzZxULdJO8Abx3ZpJ+j5/A== X-Google-Smtp-Source: ABdhPJxsfUIfpYKTijmSzZMn/3bzl+PiJKaMjoCHFOVRg+kLNgbYqegwT2dpCaQupytAQ40v4lUIluDFJfph+PDjmzo= X-Received: by 2002:a05:6602:45a:: with SMTP id e26mr880042iov.168.1597981744082; Thu, 20 Aug 2020 20:49:04 -0700 (PDT) MIME-Version: 1.0 References: <20200807224941.3440722-1-lokeshgidra@google.com> In-Reply-To: From: Lokesh Gidra Date: Thu, 20 Aug 2020 20:48:52 -0700 Message-ID: Subject: Re: [PATCH v6 0/3] SELinux support for anonymous inodes and UFFD To: James Morris Cc: Alexander Viro , Stephen Smalley , Casey Schaufler , Eric Biggers , "Serge E. Hallyn" , Paul Moore , Eric Paris , Daniel Colascione , Kees Cook , "Eric W. Biederman" , KP Singh , David Howells , Thomas Cedeno , Anders Roxell , Sami Tolvanen , Matthew Garrett , Aaron Goidel , Randy Dunlap , "Joel Fernandes (Google)" , YueHaibing , Christian Brauner , Alexei Starovoitov , Alexey Budankov , Adrian Reber , Aleksa Sarai , Linux FS Devel , linux-kernel , LSM List , SElinux list , Kalesh Singh , Calin Juravle , Suren Baghdasaryan , Nick Kralevich , Jeffrey Vander Stoep , kernel-team@android.com 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 Thu, Aug 20, 2020 at 11:36 AM James Morris wrote: > > On Fri, 7 Aug 2020, Lokesh Gidra wrote: > > > Userfaultfd in unprivileged contexts could be potentially very > > useful. We'd like to harden userfaultfd to make such unprivileged use > > less risky. This patch series allows SELinux to manage userfaultfd > > file descriptors and in the future, other kinds of > > anonymous-inode-based file descriptor. SELinux policy authors can > > apply policy types to anonymous inodes by providing name-based > > transition rules keyed off the anonymous inode internal name ( > > "[userfaultfd]" in the case of userfaultfd(2) file descriptors) and > > applying policy to the new SIDs thus produced. > > Can you expand more on why this would be useful, e.g. use-cases? > With SELinux managed userfaultfd file descriptors, an administrator can control creation and movement of them. In particular, handling of a userfaultfd descriptor by a different process is essentially a ptrace access into the process, without any of the corresponding security_ptrace_access_check() checks. For privacy, the admin may want to deny such accesses, which is possible with SELinux support. I'll add this use case in the cover letter too in the next version.