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=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, 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 45AD0C43387 for ; Sun, 6 Jan 2019 12:40:34 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 028FA2070B for ; Sun, 6 Jan 2019 12:40:33 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="WhwjvUdG" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726264AbfAFMkd (ORCPT ); Sun, 6 Jan 2019 07:40:33 -0500 Received: from mail-ed1-f66.google.com ([209.85.208.66]:34169 "EHLO mail-ed1-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726189AbfAFMkd (ORCPT ); Sun, 6 Jan 2019 07:40:33 -0500 Received: by mail-ed1-f66.google.com with SMTP id b3so35599161ede.1 for ; Sun, 06 Jan 2019 04:40:32 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:references:date:in-reply-to:message-id :user-agent:mime-version; bh=Q3FZebUQHWefUj9AtzdZMcvi4eQwXZtyVNKVlaf8h/k=; b=WhwjvUdGMGWvkLs0+fJljjZBsz1hZebg+45CUhHN5NU8b4l2PjwGLMPkHwTeNgd836 PMFCG4yedykKzSPoBAJDRy+nFCBRNVx4zbbqddRWvPextAxLIkbleK8oOrj/TxG03IZu DXxIWOE5MkHvpXkC6BYJy84Si0cp36wGO97j5NJhQA8B5qqCm901CWMgB7cWwxeJ44eB dfmIpqoIQTlgYrO0GXCSkPyE9Q9nPxypIdZn2JuPC+SQu+Gm3nrKbTrj/QiU2pdWUToN BbPIOsjJ3BbfM5ZtwexPzxFHUHdkEO+eq0t7i0SmOvCBk9I7yLzpPihzwWkpfq7mpu9h c4kw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:references:date:in-reply-to :message-id:user-agent:mime-version; bh=Q3FZebUQHWefUj9AtzdZMcvi4eQwXZtyVNKVlaf8h/k=; b=hI7L5pGnczSMVZB9Eot89wCB222CrZ1ESoX06BbGmOHxCUJYTdiiQuXvymdds2yWJD MdzMriHVPWuqWlNCZQvNPu70AjmSlJrAwXOzSz/MFQrGZYzeLJiwMVVdDdQpv48l1lfA Jt9fTt1yKCFENEtmKRzoGhRc8OyJdz+6YLBVGEy+kfd2VkmbGDk9MNnLIBaQBzolcJbu MQVoMZzfqZ92I3AzbU+4hcUHTV4DMSVNr01sL+FlayvdOV8GwdW0MNo9T3HYZf/V9mJ4 Dxu1GthgJsy7fflsSo5DSAJ9z+3lATAlzZg1Vk3Qm7YAaw5LWh9M3Fseq2VXj9VBi3wi bKLQ== X-Gm-Message-State: AA+aEWYzkB7y1be6yK3dOxHgG5gttP1fVLNG1YOmavT0kSxL8aqaA3bp slCoGkk3fr5NzO/pJTt9tJVxvM+BwPA= X-Google-Smtp-Source: AFSGD/W5QkWFj6/0G8FaEERm+ac71qi9IM4nUiIOadYjMuwcWK0mGT6BN3TC8f+Ys8qpo1eB+wyxwg== X-Received: by 2002:a50:d2d6:: with SMTP id q22mr53495520edg.121.1546778431369; Sun, 06 Jan 2019 04:40:31 -0800 (PST) Received: from brutus ([2001:985:d55d::438]) by smtp.gmail.com with ESMTPSA id k26-v6sm17315099ejv.59.2019.01.06.04.40.30 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Sun, 06 Jan 2019 04:40:30 -0800 (PST) From: Dominick Grift To: "Sugar\, David" Cc: "selinux-refpolicy\@vger.kernel.org" Subject: Re: [PATCH 1/2 v2] Allow greeter to start dbus References: <20190106123358.18395-1-dsugar@tresys.com> Date: Sun, 06 Jan 2019 13:40:30 +0100 In-Reply-To: <20190106123358.18395-1-dsugar@tresys.com> (David Sugar's message of "Sun, 6 Jan 2019 12:34:35 +0000") Message-ID: <87d0pa7ydd.fsf@gmail.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.1 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain Sender: selinux-refpolicy-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: selinux-refpolicy@vger.kernel.org "Sugar, David" writes: > The display manager lightdm (and I think gdm) start a dbus binary. > > This adds (and uses) new interface dbus_exec to start dbus in the xdm domain. > > type=AVC msg=audit(1544626796.378:201): avc: denied { execute } for pid=9973 comm="dbus-launch" name="dbus-daemon" dev="dm-1" ino=6695040 scontext=system_u:system_r:xdm_t:s0-s0:c0.c1023 tcontext=system_u:object_r:dbusd_exec_t:s0 tclass=file permissive=1 > type=AVC msg=audit(1544626796.378:201): avc: denied { read open } for pid=9973 comm="dbus-launch" path="/usr/bin/dbus-daemon" dev="dm-1" ino=6695040 scontext=system_u:system_r:xdm_t:s0-s0:c0.c1023 tcontext=system_u:object_r:dbusd_exec_t:s0 tclass=file permissive=1 > type=AVC msg=audit(1544626796.378:201): avc: denied { execute_no_trans } for pid=9973 comm="dbus-launch" path="/usr/bin/dbus-daemon" dev="dm-1" ino=6695040 scontext=system_u:system_r:xdm_t:s0-s0:c0.c1023 tcontext=system_u:object_r:dbusd_exec_t:s0 tclass=file permissive=1 > type=AVC msg=audit(1544626796.378:201): avc: denied { map } for pid=9973 comm="dbus-daemon" path="/usr/bin/dbus-daemon" dev="dm-1" ino=6695040 scontext=system_u:system_r:xdm_t:s0-s0:c0.c1023 tcontext=system_u:object_r:dbusd_exec_t:s0 tclass=file permissive=1 > type=AVC msg=audit(1546551459.112:208): avc: denied { getcap } for pid=6275 comm="dbus-daemon" scontext=system_u:system_r:xdm_t:s0-s0:c0.c1023 tcontext=system_u:system_r:xdm_t:s0-s0:c0.c1023 tclass=process permissive=1 > > Signed-off-by: Dave Sugar > --- > policy/modules/services/dbus.if | 21 +++++++++++++++++++++ > policy/modules/services/xserver.te | 1 + > 2 files changed, 22 insertions(+) > > diff --git a/policy/modules/services/dbus.if b/policy/modules/services/dbus.if > index ef829e30..d0eec745 100644 > --- a/policy/modules/services/dbus.if > +++ b/policy/modules/services/dbus.if > @@ -17,6 +17,27 @@ interface(`dbus_stub',` > ') > ') > > +######################################## > +## > +## Execute dbus in the caller domain. > +## > +## > +## > +## Domain allowed access. > +## > +## > +# > +interface(`dbus_exec',` > + gen_require(` > + type dbusd_exec_t; > + ') > + > + corecmd_search_bin($1) > + can_exec($1, dbusd_exec_t) > + > + allow $1 self:process getcap; I would not enclose the getcap rule here. For example I do not believe you need that permission to be able to `dbus-daemon --version`. Instead I would add that rule to xserver.te: allow xdm_t self:process getcap; > +') > + > ######################################## > ## > ## Role access for dbus. > diff --git a/policy/modules/services/xserver.te b/policy/modules/services/xserver.te > index fa7ce88e..cc717e7f 100644 > --- a/policy/modules/services/xserver.te > +++ b/policy/modules/services/xserver.te > @@ -566,6 +566,7 @@ optional_policy(` > ') > > optional_policy(` > + dbus_exec(xdm_t) > dbus_system_bus_client(xdm_t) > dbus_connect_system_bus(xdm_t) -- Key fingerprint = 5F4D 3CDB D3F8 3652 FBD8 02D5 3B6C 5F1D 2C7B 6B02 https://sks-keyservers.net/pks/lookup?op=get&search=0x3B6C5F1D2C7B6B02 Dominick Grift