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.0 required=3.0 tests=DKIMWL_WL_MED,DKIM_SIGNED, DKIM_VALID,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 9D6DEC43387 for ; Sun, 6 Jan 2019 12:34:42 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 4FC90206B7 for ; Sun, 6 Jan 2019 12:34:42 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=tresys.onmicrosoft.com header.i=@tresys.onmicrosoft.com header.b="pL5NPbOo" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726272AbfAFMel (ORCPT ); Sun, 6 Jan 2019 07:34:41 -0500 Received: from mail-eopbgr750092.outbound.protection.outlook.com ([40.107.75.92]:6209 "EHLO NAM02-BL2-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726189AbfAFMel (ORCPT ); Sun, 6 Jan 2019 07:34:41 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=tresys.onmicrosoft.com; s=selector1-tresys-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=eMDx7ZDu6x81tPgLGh3fkEVlu0Bu753/W0327H43jyU=; b=pL5NPbOoHBRsyrmMwKeadvx6kJrLnsmWliiD8snJxEDY1vwp1RDvYrY8yU4hwsV87sOWeEtb6XGNG4eZ529hTC7pFCUyon6/ym5EBsHZbpyHYAp/Rn1llwa58QF9/384n3gJMaA/vXE4w28CyrLihlZkQn1p6N+a1ahQUPhnDKo= Received: from BN6PR15MB1507.namprd15.prod.outlook.com (10.172.151.147) by BN6PR15MB1506.namprd15.prod.outlook.com (10.172.151.146) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1495.7; Sun, 6 Jan 2019 12:34:35 +0000 Received: from BN6PR15MB1507.namprd15.prod.outlook.com ([fe80::6d82:5bd:50b3:6a10]) by BN6PR15MB1507.namprd15.prod.outlook.com ([fe80::6d82:5bd:50b3:6a10%3]) with mapi id 15.20.1495.011; Sun, 6 Jan 2019 12:34:35 +0000 From: "Sugar, David" To: "selinux-refpolicy@vger.kernel.org" Subject: [PATCH 1/2 v2] Allow greeter to start dbus Thread-Topic: [PATCH 1/2 v2] Allow greeter to start dbus Thread-Index: AQHUpbwuu7diYxLLUUqaH1KAzt2O4A== Date: Sun, 6 Jan 2019 12:34:35 +0000 Message-ID: <20190106123358.18395-1-dsugar@tresys.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [73.180.141.176] x-clientproxiedby: BN6PR11CA0044.namprd11.prod.outlook.com (2603:10b6:404:4b::30) To BN6PR15MB1507.namprd15.prod.outlook.com (2603:10b6:404:c6::19) authentication-results: spf=none (sender IP is ) smtp.mailfrom=dsugar@tresys.com; x-ms-exchange-messagesentrepresentingtype: 1 x-ms-publictraffictype: Email x-microsoft-exchange-diagnostics: 1;BN6PR15MB1506;6:JvrdMZa/iMmcRwDJFH59uFT6eVOL3IUWYDTRlUpWXH7bxz+x9McwvzH8HBxxEEFWtJHTER/uoyFqRUhqhDeuqxFd38UD+aHn9S1g2pKNSbs7ikDg1H0dBZXntCDGafszz9M4x1AFL54PF08waff48N6m6Lw2i34gupKSp34b84+CyvQz0+UNe8u17HqB6NtF3w1oyi7b9jwYPniP5KUdDBU0VZi/k44XHhrWvFrvARhLK/XNeYao69VPbXD1tMTXTQrs+noTO4ZebxK/ANkafmgiHOcnigCODdWbAk1HqtEk8HgDoFO9r4spmoU1U2d8R5I2kjHdDlWR+8gF22UYwdE9aX/YB69u9I4iNDhNEk4vgFdPooSJsMnNvtZ1zwbVjfIaUaxWtLem3zTP+13ax6vLNsMMSiTngcoR2hAr9V2ipsZS7OP44wNFyXO8W2Eh8LMEJewZOvj/CPtHRa1hGg==;5:GnIoA45zAxCAA7GzdqFMNZNkjTuWvJDyH9HSdPComc+LDNt3G97taD9OI1Awz8KzEeIVv43Nze/Q9IiYOT8NuVsJUwM17x/77XwRH4l1td2w7aXHy8FR9Sdx3kbcNSXowQ2/q5iI8YQGJgPK4JRM9a2QXE5Kp54HNwXUajpQwoztzCtWTmgJfORpxMgz34iw52ZBAE2MktbWNuIrypT23g==;7:LNf2groHqnZcAeGQ/V28yye2L2JdTo3+rxyhLpewP/SIaZmQTY2GldHIjV8ecEusCbTxUOdycWCmYifu5oH9tk9YOKIrMeT80GtwdirgzFpMOseTtGyEQkbzebppxYiUOFS97LwT3TYOQRYpbYlksg== x-ms-office365-filtering-correlation-id: 3e948eee-f1ed-4bf3-223f-08d673d35094 x-microsoft-antispam: BCL:0;PCL:0;RULEID:(2390118)(7020095)(4652040)(7021145)(8989299)(5600109)(711020)(4534185)(7022145)(4603075)(4627221)(201702281549075)(8990200)(7048125)(7024125)(7027125)(7023125)(2017052603328)(7153060)(7193020);SRVR:BN6PR15MB1506; x-ms-traffictypediagnostic: BN6PR15MB1506: x-microsoft-antispam-prvs: x-exchange-antispam-report-cfa-test: BCL:0;PCL:0;RULEID:(8211001083)(3230021)(908002)(999002)(5005026)(6040522)(8220060)(2401047)(8121501046)(3002001)(3231475)(944501520)(52105112)(93006095)(93001095)(10201501046)(6041310)(20161123558120)(20161123564045)(20161123560045)(2016111802025)(20161123562045)(6043046)(201708071742011)(7699051)(76991095);SRVR:BN6PR15MB1506;BCL:0;PCL:0;RULEID:;SRVR:BN6PR15MB1506; x-forefront-prvs: 09090B6B69 x-forefront-antispam-report: SFV:NSPM;SFS:(10019020)(396003)(366004)(376002)(136003)(39830400003)(346002)(199004)(189003)(36756003)(52116002)(256004)(476003)(2501003)(6116002)(6436002)(508600001)(6512007)(3846002)(99286004)(97736004)(53936002)(6916009)(105586002)(6506007)(106356001)(5660300001)(386003)(316002)(68736007)(4743002)(66066001)(575784001)(86362001)(186003)(26005)(7736002)(102836004)(305945005)(25786009)(71190400001)(71200400001)(2906002)(8676002)(8936002)(81156014)(81166006)(5640700003)(1076003)(14444005)(14454004)(486006)(6486002)(2616005)(2351001);DIR:OUT;SFP:1102;SCL:1;SRVR:BN6PR15MB1506;H:BN6PR15MB1507.namprd15.prod.outlook.com;FPR:;SPF:None;LANG:en;PTR:InfoNoRecords;A:1;MX:1; received-spf: None (protection.outlook.com: tresys.com does not designate permitted sender hosts) x-ms-exchange-senderadcheck: 1 x-microsoft-antispam-message-info: tOVAgnOIJ7+xnOoFxu3FO2LhV+CNMx/Ag3EtGdycpsFvPHN4wI9nb/gqJXghBZ4XLr+g+BCjGsC5ttNVfmc59GdkI5yu5QRIudWLD/7/bL7ekS2Vtbw51Awpq0FHGTdBu/4Se271+5EWQN8uymRJowkFSIeEuc1WTNtLJeGCMJGyQmzqPrVmSkdMvq7LavIgauzU4ZWArgqCQW+KJqsuAVHC+bpZtEHrbF/Yddf/PdaZMGH3wOORwj9QHJ4q8GDrJv/Re5tlZudNz5uohV55gBkjafxTK/i5gM7k96lXDZWSNyhKmxZ50ds35+Sfppce spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-OriginatorOrg: tresys.com X-MS-Exchange-CrossTenant-Network-Message-Id: 3e948eee-f1ed-4bf3-223f-08d673d35094 X-MS-Exchange-CrossTenant-originalarrivaltime: 06 Jan 2019 12:34:35.2151 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: a0d45667-6c07-4e88-868f-4ac9af95c7ed X-MS-Exchange-Transport-CrossTenantHeadersStamped: BN6PR15MB1506 Sender: selinux-refpolicy-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: selinux-refpolicy@vger.kernel.org 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 domai= n. type=3DAVC msg=3Daudit(1544626796.378:201): avc: denied { execute } for = pid=3D9973 comm=3D"dbus-launch" name=3D"dbus-daemon" dev=3D"dm-1" ino=3D669= 5040 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 { read 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.c1023 tcontext= =3Dsystem_u:object_r:dbusd_exec_t:s0 tclass=3Dfile permissive=3D1 type=3DAVC msg=3Daudit(1544626796.378:201): avc: denied { execute_no_tran= s } 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 t= context=3Dsystem_u:object_r:dbusd_exec_t:s0 tclass=3Dfile permissive=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 tcontext=3Dsys= tem_u:object_r:dbusd_exec_t:s0 tclass=3Dfile permissive=3D1 type=3DAVC msg=3Daudit(1546551459.112:208): avc: denied { getcap } for pi= d=3D6275 comm=3D"dbus-daemon" scontext=3Dsystem_u:system_r:xdm_t:s0-s0:c0.c= 1023 tcontext=3Dsystem_u:system_r:xdm_t:s0-s0:c0.c1023 tclass=3Dprocess per= missive=3D1 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',` ') ') =20 +######################################## +## +## 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; +') + ######################################## ## ## Role access for dbus. diff --git a/policy/modules/services/xserver.te b/policy/modules/services/x= server.te index fa7ce88e..cc717e7f 100644 --- a/policy/modules/services/xserver.te +++ b/policy/modules/services/xserver.te @@ -566,6 +566,7 @@ optional_policy(` ') =20 optional_policy(` + dbus_exec(xdm_t) dbus_system_bus_client(xdm_t) dbus_connect_system_bus(xdm_t) =20 --=20 2.20.1