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=-12.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, MENTIONS_GIT_HOSTING,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 023D4C43387 for ; Sun, 23 Dec 2018 17:02:43 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id AF92F21773 for ; Sun, 23 Dec 2018 17:02:43 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="jLSg1PHd" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1725616AbeLWRCn (ORCPT ); Sun, 23 Dec 2018 12:02:43 -0500 Received: from mail-ed1-f65.google.com ([209.85.208.65]:33667 "EHLO mail-ed1-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725554AbeLWRCn (ORCPT ); Sun, 23 Dec 2018 12:02:43 -0500 Received: by mail-ed1-f65.google.com with SMTP id p6so8639664eds.0 for ; Sun, 23 Dec 2018 09:02:41 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:subject:message-id:mail-followup-to:references :mime-version:content-disposition:in-reply-to:user-agent; bh=tP8lXfpsFKsv/KbmNUHlb2l/iClYrbjW6vs/wWhqUuE=; b=jLSg1PHdRGyMENdpGWUarSa7uOVHdHqCIRu/e6jwTA4vrmmbEb1DgBBdNdI8hJXb4M FhtT/mYKewyZrBLVuhgXVD1c1RyVdoKoM1AWtj9F6ArCQLSvgXgDsk6bC9ZGO5z5Buyy c8jfym0tpzcjun6nLZpMS4C5MaXCf3dOrSIe0Rx3MZ4cfrLSixhkWF61fqRaOT1bKo5f 8Z0R3mUvEdu0D7u0GQzjmZ3aaI6xx8ObRKf0DZD1ukhRxUxIqHPKuHQsiTzj2ExJClyE O8FEo11ZF9VoVB+xUoU7wz82vRdRgm2iBeYAQ4jPYcOycK7x7t/ivNkU1VFpky6IwwmX jwww== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:subject:message-id:mail-followup-to :references:mime-version:content-disposition:in-reply-to:user-agent; bh=tP8lXfpsFKsv/KbmNUHlb2l/iClYrbjW6vs/wWhqUuE=; b=UAZqSxq/Uph7zhQxjo0Xql9GF1bMvxQyqJ0IX22wg81iuANzp0lLe4og37BSmpL+Vr q1kafRAoaFIDCKSpxpv6U1sZfmD7FJ6BZ4yfkxq7nxiskjYR3w4cPLgOyjKAu0tXC4ii iVUGouiW0aIq3HNz5B3Sr5gJTGvSXymyO4N6e7TzMEzkdFoeAGPhFnd98OC9s89562W9 mQolWN2bQ8lpoHzh1w42PnMSpFVTMLlyu+17O33j/iuI0TVEDwwY3BUDXMUPD+3OARSj BRhWqLmHujO7fNC+6OSHLB+MU9okRMX6EbTn5GZ7FUXJjYwBLfnLTasn3eg4sfq2w7vp ppOQ== X-Gm-Message-State: AA+aEWbfZY0lYIAHWvAlKM4RVduMnyS00HGP3X3VjixvfcJ99f+brEsb BwYNxDUjbNmVcroDiPZ1CGI= X-Google-Smtp-Source: AFSGD/Wcj4k/e5c6QI0JeCHP3bGw7+gxOcXKSdDr5z+PBFxmIIsqOjEKQRTdv/aCxXZ0bapajyI42Q== X-Received: by 2002:a50:d002:: with SMTP id j2mr8118810edf.123.1545584559947; Sun, 23 Dec 2018 09:02:39 -0800 (PST) Received: from brutus.lan ([2001:985:d55d::438]) by smtp.gmail.com with ESMTPSA id v12-v6sm3132761ejk.58.2018.12.23.09.02.39 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Sun, 23 Dec 2018 09:02:39 -0800 (PST) Date: Sun, 23 Dec 2018 18:02:37 +0100 From: Dominick Grift To: Chris PeBenito , David Sugar , "selinux-refpolicy@vger.kernel.org" Subject: Re: [PATCH 1/2] Allow greeter to start dbus and transition Message-ID: <20181223170237.GJ20992@brutus.lan> Mail-Followup-To: Chris PeBenito , David Sugar , "selinux-refpolicy@vger.kernel.org" References: <20181221014026.2867-1-dsugar@tresys.com> <20181223163359.GF20992@brutus.lan> <20181223164512.GG20992@brutus.lan> <20181223165206.GH20992@brutus.lan> <20181223165510.GI20992@brutus.lan> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="8tZVdKiiYitVG083" Content-Disposition: inline In-Reply-To: <20181223165510.GI20992@brutus.lan> User-Agent: Every email client sucks, this one just sucks less. X-PGP-Key: https://sks-keyservers.net/pks/lookup?op=get&search=0x3B6C5F1D2C7B6B02 Sender: selinux-refpolicy-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: selinux-refpolicy@vger.kernel.org --8tZVdKiiYitVG083 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Sun, Dec 23, 2018 at 05:55:10PM +0100, Dominick Grift wrote: > On Sun, Dec 23, 2018 at 05:52:06PM +0100, Dominick Grift wrote: > > On Sun, Dec 23, 2018 at 05:45:12PM +0100, Dominick Grift wrote: > > > On Sun, Dec 23, 2018 at 05:33:59PM +0100, Dominick Grift wrote: > > > > On Sat, Dec 22, 2018 at 02:28:15PM -0500, Chris PeBenito wrote: > > > > > On 12/20/18 8:41 PM, David Sugar wrote: > > > > > > The display manager lightdm (and I think gdm) start a dbus bina= ry. > > > > > > This allows that to happen in a special dbus domain. > > > > > >=20 > > > > > > type=3DAVC msg=3Daudit(1544626796.378:201): avc: denied { exe= cute } for pid=3D9973 comm=3D"dbus-launch" name=3D"dbus-daemon" dev=3D"dm-= 1" ino=3D6695040 scontext=3Dsystem_u:system_r:xdm_t:s0-s0:c0.c1023 tcontext= =3Dsystem_u:object_r:dbusd_exec_t:s0 tclass=3Dfile permissive=3D1 > > > > > > type=3DAVC msg=3Daudit(1544626796.378:201): avc: denied { rea= d open } for pid=3D9973 comm=3D"dbus-launch" path=3D"/usr/bin/dbus-daemon"= dev=3D"dm-1" ino=3D6695040 scontext=3Dsystem_u:system_r:xdm_t:s0-s0:c0.c10= 23 tcontext=3Dsystem_u:object_r:dbusd_exec_t:s0 tclass=3Dfile permissive=3D1 > > > > > > type=3DAVC msg=3Daudit(1544626796.378:201): avc: denied { exe= cute_no_trans } for pid=3D9973 comm=3D"dbus-launch" path=3D"/usr/bin/dbus-= daemon" dev=3D"dm-1" ino=3D6695040 scontext=3Dsystem_u:system_r:xdm_t:s0-s0= :c0.c1023 tcontext=3Dsystem_u:object_r:dbusd_exec_t:s0 tclass=3Dfile permis= sive=3D1 > > > > > > type=3DAVC msg=3Daudit(1544626796.378:201): avc: denied { map= } for pid=3D9973 comm=3D"dbus-daemon" path=3D"/usr/bin/dbus-daemon" dev= =3D"dm-1" ino=3D6695040 scontext=3Dsystem_u:system_r:xdm_t:s0-s0:c0.c1023 t= context=3Dsystem_u:object_r:dbusd_exec_t:s0 tclass=3Dfile permissive=3D1 > > > > > > type=3DAVC msg=3Daudit(1544628523.635:3208): avc: denied { ex= ecute } for pid=3D16376 comm=3D"at-spi-bus-laun" name=3D"dbus-daemon" dev= =3D"dm-1" ino=3D6695040 scontext=3Dsystem_u:system_r:xdm_t:s0-s0:c0.c1023 t= context=3Dsystem_u:object_r:dbusd_exec_t:s0 tclass=3Dfile permissive=3D1 > > > > > > type=3DAVC msg=3Daudit(1544628523.635:3208): avc: denied { re= ad open } for pid=3D16376 comm=3D"at-spi-bus-laun" path=3D"/usr/bin/dbus-d= aemon" dev=3D"dm-1" ino=3D6695040 scontext=3Dsystem_u:system_r:xdm_t:s0-s0:= c0.c1023 tcontext=3Dsystem_u:object_r:dbusd_exec_t:s0 tclass=3Dfile permiss= ive=3D1 > > > > > > type=3DAVC msg=3Daudit(1544628523.635:3208): avc: denied { ex= ecute_no_trans } for pid=3D16376 comm=3D"at-spi-bus-laun" path=3D"/usr/bin= /dbus-daemon" dev=3D"dm-1" ino=3D6695040 scontext=3Dsystem_u:system_r:xdm_t= :s0-s0:c0.c1023 tcontext=3Dsystem_u:object_r:dbusd_exec_t:s0 tclass=3Dfile = permissive=3D1 > > > > > > type=3DAVC msg=3Daudit(1544628523.635:3208): avc: denied { ma= p } for pid=3D16376 comm=3D"dbus-daemon" path=3D"/usr/bin/dbus-daemon" dev= =3D"dm-1" ino=3D6695040 scontext=3Dsystem_u:system_r:xdm_t:s0-s0:c0.c1023 t= context=3Dsystem_u:object_r:dbusd_exec_t:s0 tclass=3Dfile permissive=3D1 > > > > > >=20 > > > > > > Signed-off-by: Dave Sugar > > > > > > --- > > > > > > policy/modules/services/xserver.te | 1 + > > > > > > 1 file changed, 1 insertion(+) > > > > > >=20 > > > > > > diff --git a/policy/modules/services/xserver.te b/policy/module= s/services/xserver.te > > > > > > index fa7ce88e..12ad3a87 100644 > > > > > > --- a/policy/modules/services/xserver.te > > > > > > +++ b/policy/modules/services/xserver.te > > > > > > @@ -568,6 +568,7 @@ optional_policy(` > > > > > > optional_policy(` > > > > > > dbus_system_bus_client(xdm_t) > > > > > > dbus_connect_system_bus(xdm_t) > > > > > > + dbus_role_template(xdm, system_r, xdm_t) > > > > > > optional_policy(` > > > > > > accountsd_dbus_chat(xdm_t) > > > > >=20 > > > > > This doesn't sit well with me. XDM isn't a user, or is system_r = a user > > > > > role, so it shouldn't be using this template. On my system, > > > > > at-spi-bus-launcher is running as part of my user session, not as= part of > > > > > XDM. It seems like this may be a transition problem. > > > >=20 > > > > It does not sit well with me either but gdm is actually a "user" in= way's. and it has a session. > > > >=20 > > > > the gdm DM policy should never have been merged with XDM DM policy = as XDM is much cleaner. > > > >=20 > > > > GDM is nasty > > >=20 > > > In dssp2 i actually have a seuser for gdm: > > >=20 > > > # seinfo -xugdm.id > > >=20 > > > Users: 1 > > > user gdm.id roles sys.role level s0 range s0; > > >=20 > > > And believe me, I did not do that for fun. In distributions with syst= emd --user this is just needed because > > > systemd will spawn a --user instance for gdm and this user instance s= pawns all kinds of processes on gdm's behalf > > >=20 > > > for example dbus instance, the last thing you want is to have a gdm d= bus instance running with system_dbusd_t > >=20 > > then again, in dssp2 i just run pretty much everything in "gdm_t" > > so maybe a dbus_exec() is more appropriate (and simpler) >=20 > https://github.com/DefenSec/dssp2-standard/blob/master/policy/gnome/g/gdm= =2Ecil#L218 My last comment on this: my advice is to stay in the xdm_t domain and to no= t transition out of it. just run that whole session in xdm_t, all of it. >=20 > >=20 > > >=20 > > > >=20 > > > > >=20 > > > > > --=20 > > > > > Chris PeBenito > > > >=20 > > > > --=20 > > > > Key fingerprint =3D 5F4D 3CDB D3F8 3652 FBD8 02D5 3B6C 5F1D 2C7B 6B= 02 > > > > https://sks-keyservers.net/pks/lookup?op=3Dget&search=3D0x3B6C5F1D2= C7B6B02 > > > > Dominick Grift > > >=20 > > >=20 > > >=20 > > > --=20 > > > Key fingerprint =3D 5F4D 3CDB D3F8 3652 FBD8 02D5 3B6C 5F1D 2C7B 6B02 > > > https://sks-keyservers.net/pks/lookup?op=3Dget&search=3D0x3B6C5F1D2C7= B6B02 > > > Dominick Grift > >=20 > >=20 > >=20 > > --=20 > > Key fingerprint =3D 5F4D 3CDB D3F8 3652 FBD8 02D5 3B6C 5F1D 2C7B 6B02 > > https://sks-keyservers.net/pks/lookup?op=3Dget&search=3D0x3B6C5F1D2C7B6= B02 > > Dominick Grift >=20 >=20 >=20 > --=20 > Key fingerprint =3D 5F4D 3CDB D3F8 3652 FBD8 02D5 3B6C 5F1D 2C7B 6B02 > https://sks-keyservers.net/pks/lookup?op=3Dget&search=3D0x3B6C5F1D2C7B6B02 > Dominick Grift --=20 Key fingerprint =3D 5F4D 3CDB D3F8 3652 FBD8 02D5 3B6C 5F1D 2C7B 6B02 https://sks-keyservers.net/pks/lookup?op=3Dget&search=3D0x3B6C5F1D2C7B6B02 Dominick Grift --8tZVdKiiYitVG083 Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQGzBAEBCAAdFiEEujmXliIBLFTc2Y4AJXSOVTf5R2kFAlwfv6kACgkQJXSOVTf5 R2nKDgwAkY3RB48BXmqmMpfdRigL19+OvYnzf8xCYHFjqJLeEfzhozXrw4G0kApj 1fdVxsbvjx/yvJ4Z0JHX3eDaNwFGNOxKV/h82HwflADid3KUuuku4ax3ElK9E/aa GJ4gNKDzsjdI6gu4aj25C5NCyxuPN0fru6QM+ET1Gf4BYQbRHQlIYvLyaBej07xW 54tKOVTAYx6lqT3BOomvvjoavQZ9LMXg0gWz8xFQ/Gemcjv7ix8+CVkMaXZTbbS8 SbqoiXhvVSI80flIrM44G5d1FDQ1Lj5WjHD3c6+XDovn7GpXbx933RW/wsEqEyVg tWRMM//qmfykDZguNiUXQdO5kKzSRFZ8vr1xoic9LzUguImUAxznQd91RNMBxkyq E5vsL3RFz2qfNEqyGbNhGCN25CKhWFbawSOHu/d9XpuqLZA3Ey8Q42DE93xEB+f1 gNY/qHQFL6c2kVzrJLZ4CtjWQFSbfotd8ask0/bm1CBtPeY/Q2lGx3q6ajNgUUbi FE1eplwk =9iw+ -----END PGP SIGNATURE----- --8tZVdKiiYitVG083--