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=-0.8 required=3.0 tests=DKIM_INVALID,DKIM_SIGNED, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_PASS 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 61813C43444 for ; Thu, 17 Jan 2019 16:38:03 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 3118620856 for ; Thu, 17 Jan 2019 16:38:03 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=tycho.nsa.gov header.i=@tycho.nsa.gov header.b="Cltdg5ZJ" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728731AbfAQQiB (ORCPT ); Thu, 17 Jan 2019 11:38:01 -0500 Received: from upbd19pa12.eemsg.mail.mil ([214.24.27.87]:31703 "EHLO upbd19pa12.eemsg.mail.mil" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726854AbfAQQiB (ORCPT ); Thu, 17 Jan 2019 11:38:01 -0500 X-EEMSG-check-017: 182453021|UPBD19PA12_EEMSG_MP12.csd.disa.mil Received: from emsm-gh1-uea10.ncsc.mil ([214.29.60.2]) by upbd19pa12.eemsg.mail.mil with ESMTP/TLS/DHE-RSA-AES256-SHA256; 17 Jan 2019 16:37:54 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=tycho.nsa.gov; i=@tycho.nsa.gov; q=dns/txt; s=tycho.nsa.gov; t=1547743074; x=1579279074; h=subject:to:cc:references:from:message-id:date: mime-version:in-reply-to:content-transfer-encoding; bh=ExqSTP7dHPREs1Kx11in364X3aory7Q7qTK1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KXFW20fZ0TYrdT++0?= =?us-ascii?q?PCSaKhBq47MgtAzs6CLLFGatrzjVVJXP3jIsjRY3qtm2esAhaF3reMbIvse2?= =?us-ascii?q?UA0yTREUYEkxsO8nmYKwgxGCOhrnnADDxhC13veVng8epgp3OhSE870QWKY1?= =?us-ascii?q?dm17qv9R4fneacRO8L3rIYpCchrC15E0qy39LMDNqAuhJhfL5HbNMj71dIy3?= =?us-ascii?q?jZuxZ+PpO+NaBigEARcwBts0PpzRV3BdYIrc9/kH4o0Qw6Ca+fmAdddRub0I?= =?us-ascii?q?r2N7mRLXP9qlTnR6fQ21zamOmf/rwPoKA0tFznpwGBDEcu83x7ldJS1i3PyI?= =?us-ascii?q?/NCV8pTZ/pUksxvyN/rrXebzh1s5jYzlVwIKK0tXnEwNtvC+w7nEXzN+xDOb?= =?us-ascii?q?+JQVehW/YRANKjfalzwQCk?= X-IPAS-Result: =?us-ascii?q?A2BKAAARrkBc/wHyM5BjGgEBAQEBAgEBAQEHAgEBAQGBZ?= =?us-ascii?q?YFbKYE1M4Qok31MAQEBAQEBBoE1iTCQSTgBhEACglgiOBIBAwEBAQEBAQIBb?= =?us-ascii?q?CiCOikBgmcBBSMPAQVBEAsOCgICJgICVwYBDAgBAYJfP4F1DawBgS+FQ4Rxg?= =?us-ascii?q?QuLNBd4gQeBOIJrhFqDMIJXAolOhzaQMloJkg0GGIFlhSqKfIoAkmshgVYrC?= =?us-ascii?q?AIYCCEPgyiCJheOPCEDgTUBAYdfgk0BAQ?= Received: from tarius.tycho.ncsc.mil ([144.51.242.1]) by EMSM-GH1-UEA10.NCSC.MIL with ESMTP; 17 Jan 2019 16:37:53 +0000 Received: from moss-pluto.infosec.tycho.ncsc.mil (moss-pluto.infosec.tycho.ncsc.mil [192.168.25.131]) by tarius.tycho.ncsc.mil (8.14.4/8.14.4) with ESMTP id x0HGbphK023995; Thu, 17 Jan 2019 11:37:51 -0500 Subject: Re: [PATCH 0/3] Allow initializing the kernfs node's secctx based on its parent To: Tejun Heo , Daniel Walsh Cc: Ondrej Mosnacek , selinux@vger.kernel.org, Paul Moore , Linux Security Module list , Greg Kroah-Hartman , linux-fsdevel@vger.kernel.org, cgroups@vger.kernel.org References: <20190109091028.24485-1-omosnace@redhat.com> <20190111205053.GV2509588@devbig004.ftw2.facebook.com> <64977013-e2a5-809d-7a3f-bffbda9276aa@redhat.com> <20190117161521.GA50184@devbig004.ftw2.facebook.com> From: Stephen Smalley Message-ID: <46abb960-f047-c2eb-96a8-72114cc44c86@tycho.nsa.gov> Date: Thu, 17 Jan 2019 11:39:52 -0500 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.4.0 MIME-Version: 1.0 In-Reply-To: <20190117161521.GA50184@devbig004.ftw2.facebook.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 8bit Sender: linux-fsdevel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-fsdevel@vger.kernel.org On 1/17/19 11:15 AM, Tejun Heo wrote: > Hello, > > On Thu, Jan 17, 2019 at 10:01:23AM -0500, Daniel Walsh wrote: >> The above comment is correct.  We want to be able to run a container >> where we hand it control over a limited subdir of the cgroups hierachy. >> We can currently do this and label the content correctly, but when >> subdirs of the directory get created by processes inside the container >> they do not get the correct label.  For example we add a label like >> system_u:object_r:container_file_t:s0 to a directory but when the >> process inside of the container creates a fd within this directory the >> kernel says the label is the default label for cgroups >> system_u:object_r:cgroup_t:s0.  This forces us to write looser policy >> that from an SELinux point of view allows a process within the container >> to write anywhere on the cgroup file system, rather then just the >> designated directories. > > Can you please go into a bit more details on why the existing > cgroup delegation model isn't enough? I would hazard a guess that it is because the existing cgroup delegation model is based on user IDs and discretionary access control (DAC), whereas they are using per-container SELinux security contexts and mandatory access control (MAC) to enforce the separation of containers irrespective of UID and DAC. Optimally both would be supported by cgroup, as DAC and MAC have different properties and use cases.