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=-7.2 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,URIBL_BLOCKED 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 801A6C46475 for ; Sat, 27 Oct 2018 19:13:25 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 127E62082C for ; Sat, 27 Oct 2018 19:13:25 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=ieee.org header.i=@ieee.org header.b="EmOhAiyj" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 127E62082C Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=ieee.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=selinux-refpolicy-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728788AbeJ1DzU (ORCPT ); Sat, 27 Oct 2018 23:55:20 -0400 Received: from mail-qt1-f194.google.com ([209.85.160.194]:35077 "EHLO mail-qt1-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728213AbeJ1DzU (ORCPT ); Sat, 27 Oct 2018 23:55:20 -0400 Received: by mail-qt1-f194.google.com with SMTP id a10-v6so4996272qtp.2 for ; Sat, 27 Oct 2018 12:13:24 -0700 (PDT) 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=epzV3nsBkpp3UFzClXrv8wGLxrMqLUhcCdABx/yMoo0=; b=EmOhAiyj9fYMJYZ4uH9NG+US2EzAFdnF03H5EYZccAlBQy4tiTFGq0SfEX9mY/xFvF GGhp4vWAabwo2ycfs/pT6b0ZSx29dUrPibz+yqPv5GvlLyoihvuuzZ+oDVBePGlWufGp 7Ct05M4MiAwKRJQ130vwDZ9Fs+o/7hGlqUOzk= 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=epzV3nsBkpp3UFzClXrv8wGLxrMqLUhcCdABx/yMoo0=; b=FiJJKiQCBm8ai4kem5YcKVzMb4JyN0eclVhlJJZn/syhp3uRS1gsx3+E08keMc2jrZ wam0veVGBx0Rjtiu94rK+mSVf2B1jfHGjd2QcrlZwVNFUUgBFnvkJBsLubRfx+3CM+KB BiGQnOZ2UspTKyHONuyZORr60NYeKGSJLMhj9zXdsv5PwNvm74aglayyZ7jPrsSscIdp 9LtJcwGqltdMM9NZTFi0CaJ8CyAbvjka97b/MMWCxOlME9RLhkbXILE/GpmVJJ9oeP1m X8qgSyOt2lw75vDxy+on0lmrr7JHoqg5GRdFUl7Nb+THQH+qDsspsckk6B+cvKOvoOdE vXFw== X-Gm-Message-State: AGRZ1gJQXTJgkUOOBh5E7shJyAbGtsnKLtE868SRHXIe4hIaq5Iigf7O sSgzrfysAyJf9zD6nI2qkdtvqdr7vpk= X-Google-Smtp-Source: AJdET5eACdLEJ1c5e7gS75keQhQKsRMrO4zi2ElzRexnvAGHaMI/ZMMarp9OLwObm1XKYfGc09jayg== X-Received: by 2002:aed:3e94:: with SMTP id n20-v6mr7632125qtf.196.1540667603410; Sat, 27 Oct 2018 12:13:23 -0700 (PDT) Received: from [192.168.1.190] (pool-68-134-29-209.bltmmd.fios.verizon.net. [68.134.29.209]) by smtp.gmail.com with ESMTPSA id v57-v6sm9849888qtk.51.2018.10.27.12.13.22 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sat, 27 Oct 2018 12:13:22 -0700 (PDT) Subject: Re: [PATCH 1/1] Add interface udev_domtrans_to To: Dave Sugar , selinux-refpolicy@vger.kernel.org References: <20181017141949.17119-1-dsugar@tresys.com> From: Chris PeBenito Message-ID: Date: Sat, 27 Oct 2018 15:13:22 -0400 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.9.1 MIME-Version: 1.0 In-Reply-To: <20181017141949.17119-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 10/17/2018 10:19 AM, Dave Sugar wrote: > This interface is useful when using the 'RUN' option in UDEV rules where udev will be executing a user function to perform some action. This interface allows a domain transition to occur for the run action. > > Signed-off-by: Dave Sugar > --- > policy/modules/system/udev.if | 35 +++++++++++++++++++++++++++++++++++ > 1 file changed, 35 insertions(+) > > diff --git a/policy/modules/system/udev.if b/policy/modules/system/udev.if > index a2067895..45ab498c 100644 > --- a/policy/modules/system/udev.if > +++ b/policy/modules/system/udev.if > @@ -36,6 +36,41 @@ interface(`udev_domtrans',` > domtrans_pattern($1, udev_exec_t, udev_t) > ') > > +######################################## > +## > +## Allow udev to execute the specified program in > +## the specified domain. > +## > +## > +##

> +## Allow udev to execute the specified program in > +## the specified domain. > +##

> +##

> +## This is an interface to support the UDEV 'RUN' > +## command. This will allow the command run by > +## udev to be run in a domain other than udev_t. > +##

> +##
> +## > +## > +## Domain to execute in. > +## > +## > +## > +## > +## Domain entry point file. > +## > +## > +# > +interface(`udev_domtrans_to',` This should be called something like udev_run_command_domain or udev_run_domain. If you have other suggestions, I could take that too, since this being for "run commands" doesn't make interface naming easy. > + gen_require(` > + type udev_t; > + ') > + > + domtrans_pattern(udev_t,$2,$1) > +') > + > ######################################## > ## > ## Execute udev in the caller domain. > -- Chris PeBenito