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.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 6F949C282DD for ; Mon, 8 Apr 2019 00:53:05 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 3DC91206B7 for ; Mon, 8 Apr 2019 00:53:05 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=ieee.org header.i=@ieee.org header.b="G8hvFlBZ" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726431AbfDHAxF (ORCPT ); Sun, 7 Apr 2019 20:53:05 -0400 Received: from mail-qt1-f194.google.com ([209.85.160.194]:43472 "EHLO mail-qt1-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726349AbfDHAxE (ORCPT ); Sun, 7 Apr 2019 20:53:04 -0400 Received: by mail-qt1-f194.google.com with SMTP id v32so13503779qtc.10 for ; Sun, 07 Apr 2019 17:53:04 -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=wHl14jQehafbIBywF5yiA45y0Tq4FXWz0jt+Gdnm4to=; b=G8hvFlBZmnCqRx9nbCHS9B2kpQA5WzB4FQiy0XyD4mTxMtnYU9Tox7aDqmfNUWdZhL uT8vwIHqO/kBxiIoUfv3UkCCmlXnAktwWdgUoS/s6d/+PT4yuUh3id1JiYu+yvXLwkPB Cpc+ZanX3Rvmrusx6+4MkMqs7zBAeSIsKG7HA= 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=wHl14jQehafbIBywF5yiA45y0Tq4FXWz0jt+Gdnm4to=; b=AQWoPwARZsSg7SwzVS2XXROvf+fKQKSZrypOUCZv8w3fsBcd3cQ+xSltKHaUWyt59b kPhVNmDLzDhmIzYi1hcsh7ih9UlAMZR1CFTSiTm7ds4qkjOSG79JaTcahuPqAOB2sMEW NuQeonabKd7Yd85nRvEnECLCLy2shdsICCGgqiYm8sy7JUD263eR4EK0gZEHnT/wMr6E vrylV/HTWWkkr2Eg8gHq463GKv1TPe+HJ29R8WWUWVcBpLjGPOyUQHuDvdfFp+uaY1Z8 c1Vo5YN4fJTuVU4Is4U9SUNEQ4qZ5RRo+ZUL/YbWFEkN5J6/F30uR7m5B9y/tLCiWxnK PnXw== X-Gm-Message-State: APjAAAV28wI79BINgTUxNjxGWHgsmYn1S0Dhv1oYeaqsDOrBjO3pM9k9 EhJDC7ve5UWuR8nYIe5tjcIhjA3Uvd4= X-Google-Smtp-Source: APXvYqzTW8NO+GA6sIJQRhajkCMqM7+vqRhyeBEmEkEjQdGYrNXscGi6TRMK5tkV9/o5X6SzDLQyCw== X-Received: by 2002:ac8:2975:: with SMTP id z50mr21678008qtz.294.1554684783669; Sun, 07 Apr 2019 17:53:03 -0700 (PDT) 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 x184sm6395653qke.35.2019.04.07.17.53.03 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 07 Apr 2019 17:53:03 -0700 (PDT) Subject: Re: [PATCH] Add interface xdm_run_domain To: "Sugar, David" , "selinux-refpolicy@vger.kernel.org" References: <20190404122900.8945-1-dsugar@tresys.com> From: Chris PeBenito Message-ID: <6688c91f-9b5a-67f6-faf3-9aa5e3c55e65@ieee.org> Date: Sun, 7 Apr 2019 20:52:52 -0400 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: <20190404122900.8945-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 4/4/19 8:29 AM, Sugar, David wrote: > This interface is needed when using the various script options in > lightdm (others?) configuration file. I'm using with 'display-setup-script' > and 'greeter-setup-script', but I suspect the same would be useful for > 'display-stopped-script', 'session-cleanup-script' and others. In these > cases lightdm will be executing a configured script to perform some action > during the specified phase of the greeter/session. But without this interface > there is no way to transition into a new domain to execute the action. I'm reluctant to add this "reversed" interface. In other cases, the domain (init, cron, inetd, etc.) is legitimately transitioning to many domains. I don't see that here. > Signed-off-by: Dave Sugar > --- > policy/modules/services/xserver.if | 31 ++++++++++++++++++++++++++++++ > 1 file changed, 31 insertions(+) > > diff --git a/policy/modules/services/xserver.if b/policy/modules/services/xserver.if > index 854f3b90..2faef71d 100644 > --- a/policy/modules/services/xserver.if > +++ b/policy/modules/services/xserver.if > @@ -734,6 +734,37 @@ interface(`xserver_relabel_console_pipes',` > allow $1 xconsole_device_t:fifo_file { getattr relabelfrom relabelto }; > ') > > +######################################## > +## > +## Allow display manager to execute the specified program in > +## the specified domain. > +## > +## > +##

> +## This is a interface to support the lightdm *-setup-script > +## options. This will allow the command run by lightdm to > +## be run in a domain other than xdm_t. > +##

> +##
> +## > +## > +## Domain to execute in. > +## > +## > +## > +## > +## Domain entry point file. > +## > +## > +# > +interface(`xdm_run_domain',` > + gen_require(` > + type xdm_t; > + ') > + > + domtrans_pattern(xdm_t,$2,$1) > +') > + > ######################################## > ## > ## Use file descriptors for xdm. > -- Chris PeBenito