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=-8.1 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH, MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_PASS autolearn=ham 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 07F46C43387 for ; Wed, 16 Jan 2019 23:19:44 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id CC95820652 for ; Wed, 16 Jan 2019 23:19:43 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=ieee.org header.i=@ieee.org header.b="PghAvNLP" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727019AbfAPXTn (ORCPT ); Wed, 16 Jan 2019 18:19:43 -0500 Received: from mail-qt1-f195.google.com ([209.85.160.195]:33655 "EHLO mail-qt1-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726976AbfAPXTn (ORCPT ); Wed, 16 Jan 2019 18:19:43 -0500 Received: by mail-qt1-f195.google.com with SMTP id l11so9395826qtp.0 for ; Wed, 16 Jan 2019 15:19:42 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ieee.org; s=google; h=subject:to:references:from:message-id:date:user-agent:mime-version :in-reply-to:content-language:content-transfer-encoding; bh=21oQx3Mgs7yvwKuSwIDFFMjVTmgaOC0glYot70NmOfM=; b=PghAvNLPEHq025hlgNtn4LP39Ludet9vK1aOIEgLbHeSl237Ykk7origtFhbbsKsNs ghxdTq3q2Ci/ot0wURgtjqHCnkK3wXQK6SkAt0r9XOWcuYVAOWpCCQLh75mkNb12SXKX 4fB3seOn+A+0HHeI/pNEL3WTb+FJ3mazmMMzA= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=21oQx3Mgs7yvwKuSwIDFFMjVTmgaOC0glYot70NmOfM=; b=lXwBRHX98A5ze3xzUNj7Klh49uPLx52NgrAzVmFaJKedCSnC2i5oN55U3nspcEKodj pNBjAhyYAr3UDEhFojKQ+Gad2BEfMjlekP1iPAdNRXX18D5eGQEEZNvsUuyofoP/WXoq P92sIc3EXJ2eZSQmZycAIMhEwliDZp0JaYO0XeT4OaTg6mpA1y84fElv4NTJTdvgKQcO MUg8JpUgvWV9YdNUkEFXbOt6Ss8tKLJel+WytyHmr0/6Hcw0t+btByjyxIYKZXZPexpi uPVbs2dADbBztUP3cl+E/R5r/YT4n1F/5c8xkbYTG7VnkmtfMrj/aUFcJ2uZHyp7z1fW /Pxg== X-Gm-Message-State: AJcUukcC6ElYvnM9BOuHEPS9eSAS+kKKZz8Gx1bl77Rex6BXL/4NIK0L e3rD5QVEFYRw1XGvH/QdfS70YpGHNjY= X-Google-Smtp-Source: ALg8bN7V1Nz8aGG6wYG+AIXBCqN4TSHHFjbSliFb5FcG+hi/JBD/6GpgfLChjot/A78+1wa4Tk4D5A== X-Received: by 2002:a0c:90a6:: with SMTP id p35mr9042953qvp.125.1547680781813; Wed, 16 Jan 2019 15:19:41 -0800 (PST) Received: from [192.168.1.190] (pool-108-15-23-247.bltmmd.fios.verizon.net. [108.15.23.247]) by smtp.gmail.com with ESMTPSA id u50sm61123438qta.23.2019.01.16.15.19.41 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 16 Jan 2019 15:19:41 -0800 (PST) Subject: Re: [PATCH] Interface to read and write the mount_runtime_t directory. To: "Sugar, David" , "selinux-refpolicy@vger.kernel.org" References: <20190115032018.28662-1-dsugar@tresys.com> From: Chris PeBenito Message-ID: <7830b698-db43-f4da-13b3-a23654d31d8f@ieee.org> Date: Wed, 16 Jan 2019 18:06:04 -0500 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.3.0 MIME-Version: 1.0 In-Reply-To: <20190115032018.28662-1-dsugar@tresys.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: selinux-refpolicy-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: selinux-refpolicy@vger.kernel.org On 1/14/19 10:20 PM, Sugar, David wrote: > I see this denial when mounting media. I'm running mount_exec_t > from my domain, not transitioning. > > type=AVC msg=audit(1547086778.470:331): avc: denied { read write } for pid=11172 comm="mount" name="mount" dev="tmpfs" ino=9470 scontext=sysadm_u:sysadm_r:settings_sudo_t:s0-s0:c0.c1023 tcontext=system_u:object_r:mount_runtime_t:s0 tclass=dir permissive=1 Seems like there is a leaked file descriptor. > Signed-off-by: Dave Sugar > --- > policy/modules/system/mount.if | 18 ++++++++++++++++++ > 1 file changed, 18 insertions(+) > > diff --git a/policy/modules/system/mount.if b/policy/modules/system/mount.if > index bf9a8bf3..31475bde 100644 > --- a/policy/modules/system/mount.if > +++ b/policy/modules/system/mount.if > @@ -220,3 +220,21 @@ interface(`mount_rw_runtime_files',` > rw_files_pattern($1, mount_runtime_t, mount_runtime_t) > ') > > +######################################## > +## > +## Read and write mount runtime directory > +## > +## > +## > +## Domain allowed access. > +## > +## > +# > +interface(`mount_rw_runtime_dir',` > + gen_require(` > + type mount_runtime_t; > + ') > + > + allow $1 mount_runtime_t:dir rw_dir_perms; > +') > + > -- Chris PeBenito