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=-3.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS 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 548AAC43460 for ; Thu, 22 Apr 2021 13:48:55 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 777D361405 for ; Thu, 22 Apr 2021 13:48:54 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 777D361405 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=paul-moore.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id D31686B006C; Thu, 22 Apr 2021 09:48:53 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id CE1CA6B006E; Thu, 22 Apr 2021 09:48:53 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id B5B326B0070; Thu, 22 Apr 2021 09:48:53 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0242.hostedemail.com [216.40.44.242]) by kanga.kvack.org (Postfix) with ESMTP id 95E7C6B006C for ; Thu, 22 Apr 2021 09:48:53 -0400 (EDT) Received: from smtpin09.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay04.hostedemail.com (Postfix) with ESMTP id 56CEE584C for ; Thu, 22 Apr 2021 13:48:53 +0000 (UTC) X-FDA: 78060133746.09.0436DC7 Received: from mail-ej1-f43.google.com (mail-ej1-f43.google.com [209.85.218.43]) by imf19.hostedemail.com (Postfix) with ESMTP id 75AE090009FC for ; Thu, 22 Apr 2021 13:48:28 +0000 (UTC) Received: by mail-ej1-f43.google.com with SMTP id x12so48135758ejc.1 for ; Thu, 22 Apr 2021 06:48:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=paul-moore-com.20150623.gappssmtp.com; s=20150623; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=NPXeKwdFlap14vs28Y4vSZZ6ciyFAPkqMaUPkDvcMVI=; b=g2Pegb2i5gH3n3l6hJjATWdi3iSRPPKWPvRDvTEh8fnjREBUy3Z+0lTtD7iRSCwtpO S6dk13ah5C7pNR+BxWjdF6CJEI1hJyjvHx1Excbh3MwvJEZkYb01U+PfxKwolPBMnMsv Uf4wboM3zz38RxIWdXdh/+f4aD7yUPbRZnGPDyct+BqSiufuihPwMrQXYU56rZ/HSMho hjJXDE1oQRmqQ9/P6odaumqtoOOIFhSqdg2yqS/k4Hs4Dl8RzQvdHOaurHCemzRmIpb4 AARZ71ZmZjBKfLp2YsS4SNt/r/SQ6xa94MiIPNffXi+ZAa3e5efNCDW1v6g23jdlXSnH eigw== 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=NPXeKwdFlap14vs28Y4vSZZ6ciyFAPkqMaUPkDvcMVI=; b=Gyoci5H7OLgTGDABKc6pH4oO5uUdLlBD6Wpa7cLHavLee3T+3cXjEEjNDPrzxZIDbp h98w+MGT/uJMUiZHUzgmO98b72V7P8Y23HX28d6N9X7lE4z6mqn8TVfdLS0/w9xWRmOK jLSPuQ1fBowwAEHoGEtdFXUxJWKpHP+cWSagHgqX8H2h//EF615ANj/FG2jJwZSYB3kt 693Tbc3nxLVsLw8D0oHyH8vV7RfGoU4fg27oFg8FyyLnoROlOCRB7rlKsUooahJKWhye EQugROQ1hueQjb6X9P4iOKFuCb82GHN/R1UilVha4MVqsb611WmQqFHIBS7g2CsLMraf pPew== X-Gm-Message-State: AOAM533VMhfObdFQ3AT9+RLIVGx58IBHJKeIg6/Oy5iUpGxlb/rK5DUy hpEVDJS/Sf1cFMnzOIFh98waZG1XCQvAaRkk7K+E X-Google-Smtp-Source: ABdhPJzNjMPp6FcBf0oyaEMYIveL5pHdZ5Je333l9k3fLxHGpk6Jx7BPpTUP8ch+2YwXiWuNcvvo3mw84daOnYGoymk= X-Received: by 2002:a17:907:16a3:: with SMTP id hc35mr3468498ejc.488.1619099331254; Thu, 22 Apr 2021 06:48:51 -0700 (PDT) MIME-Version: 1.0 References: <20210421171446.785507-1-omosnace@redhat.com> In-Reply-To: From: Paul Moore Date: Thu, 22 Apr 2021 09:48:41 -0400 Message-ID: Subject: Re: [RFC PATCH 0/2] selinux,anon_inodes: Use a separate SELinux class for each type of anon inode To: Ondrej Mosnacek Cc: SElinux list , Linux Security Module list , linux-mm@kvack.org, linux-fsdevel@vger.kernel.org, Linux kernel mailing list , Lokesh Gidra , Stephen Smalley Content-Type: text/plain; charset="UTF-8" X-Rspamd-Server: rspam01 X-Rspamd-Queue-Id: 75AE090009FC X-Stat-Signature: i9791kg39sab37e3hwmg6fow99f9xz9p Received-SPF: none (paul-moore.com>: No applicable sender policy available) receiver=imf19; identity=mailfrom; envelope-from=""; helo=mail-ej1-f43.google.com; client-ip=209.85.218.43 X-HE-DKIM-Result: pass/pass X-HE-Tag: 1619099308-792986 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 Thu, Apr 22, 2021 at 7:40 AM Ondrej Mosnacek wrote: > On Wed, Apr 21, 2021 at 10:38 PM Paul Moore wrote: > > On Wed, Apr 21, 2021 at 1:14 PM Ondrej Mosnacek wrote: > > > > > > This series aims to correct a design flaw in the original anon_inode > > > SELinux support that would make it hard to write policies for anonymous > > > inodes once more types of them are supported (currently only userfaultfd > > > inodes are). A more detailed rationale is provided in the second patch. > > > > > > The first patch extends the anon_inode_getfd_secure() function to accept > > > an additional numeric identifier that represents the type of the > > > anonymous inode being created, which is passed to the LSMs via > > > security_inode_init_security_anon(). > > > > > > The second patch then introduces a new SELinux policy capability that > > > allow policies to opt-in to have a separate class used for each type of > > > anon inode. That means that the "old way" will still > > > > ... will what? :) > > Whoops, I thought I had gone over all the text enough times, but > apparently not :) It should have said something along the lines of: > > ...will still work and will be used by default. That's what I figured from my quick glance at the code, but I wanted to make sure. > > I think it would be a very good idea if you could provide some > > concrete examples of actual policy problems encountered using the > > current approach. I haven't looked at these patches very seriously > > yet, but my initial reaction is not "oh yes, we definitely need this". > > An example is provided in patch 2. It is a generalized problem that we > would eventually run into in Fedora policy (at least) with the > unconfined_domain_type attribute and so far only hypothetical future > types of anon inodes. Yes, I read the example you provided in patch 2, but it was still a little too abstract for my liking. I have the same concern that Stephen mentioned, I was just giving you an opportunity to show that in this case the additional object classes were warranted. -- paul moore www.paul-moore.com