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=-6.8 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 DEED0C0044C for ; Fri, 2 Nov 2018 00:36:50 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 76F2820820 for ; Fri, 2 Nov 2018 00:36:50 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=tresys.onmicrosoft.com header.i=@tresys.onmicrosoft.com header.b="KQh2S3QC" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 76F2820820 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=tresys.com 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 S1728233AbeKBJmC (ORCPT ); Fri, 2 Nov 2018 05:42:02 -0400 Received: from mail-bl2nam02on0111.outbound.protection.outlook.com ([104.47.38.111]:49812 "EHLO NAM02-BL2-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1728231AbeKBJmC (ORCPT ); Fri, 2 Nov 2018 05:42:02 -0400 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=EXvaQCDQ04sOBtILT6AnNw1yEw5Z3Nz7udm/yPme2Yk=; b=KQh2S3QCR/kahftcak5K8FxjgY2FblhgUGTWqSRLFfF54C6X+d0VPqOvvoFXlHTsnJGCWoo6JU0UKXEafPyap3w5woRZAsry9KRj1xu+gUepjk2TjndId7vdWtH34wPO346/R79CbX+nG1PNyrW8gBgl6D4G9iN+zf9iPHW15fk= Received: from BN6PR15MB1507.namprd15.prod.outlook.com (10.172.151.147) by BN6PR15MB1459.namprd15.prod.outlook.com (10.172.151.18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1294.25; Fri, 2 Nov 2018 00:36:46 +0000 Received: from BN6PR15MB1507.namprd15.prod.outlook.com ([fe80::c0de:889e:7675:1b74]) by BN6PR15MB1507.namprd15.prod.outlook.com ([fe80::c0de:889e:7675:1b74%3]) with mapi id 15.20.1294.021; Fri, 2 Nov 2018 00:36:46 +0000 From: David Sugar To: "selinux-refpolicy@vger.kernel.org" Subject: [PATCH 1/1 v2] Add interface udev_run_domain Thread-Topic: [PATCH 1/1 v2] Add interface udev_run_domain Thread-Index: AQHUckQiDPyD4j/h5k+2u5TODl0Sfw== Date: Fri, 2 Nov 2018 00:36:45 +0000 Message-ID: <20181102003607.22300-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: BL0PR02CA0070.namprd02.prod.outlook.com (2603:10b6:207:3d::47) 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;BN6PR15MB1459;6:1EUBDVHRQsUatV3POb0t821qyMikzwGH37YkSu68yf5aL42AlApHSu50YKw3l+FBtNMmEqoOE4zYntoobqWfKYKr5xugp8Ui164lFigAtyjB12iuujKgLP4FFhiW2BnjebNy4mwi2h+yxKbqKJel6qrnlVm8oSL/PSBXuSuq6dgA7ya++Uit+0UdpEWwHSOOLGWYjYAFt25W+fYPZI2KIwnAsmc9/5zGuf8z7GsHOHBZcJBUIRnH6B3PLwzLGJoReWd2GklzKCinJcOWkzN3TPzlKBrnLIAWtq9VoSozVyyBrK/TbLiqffX/78kriRjPNX5j8zANeeieSkSuuphbLoveMAp3J5dodsrR4CjtPRBQ4lcNpLYXHrzddh0s7dTBOqkGKsA8/Fme50lOPWyTRNJIf4MkCexHNPbI+kvtRX07vrxTsSW5nbxEwECQTtyyfKP3haez2oieCqX0SxhOCQ==;5:tX3n7rn2nR3bgn0E/vz7lZoF4EerIAUwMoGICwlEDorLkNw6r1/lP3gCt7LFb6Y0T6c8uM6r2CbJ0UaatDkutjwOoNIiKsLUgzp2Xm9sf4RE6SOba4VzPftOT6NXiJyWNMxJpdPdcgGExYYA0P+4kqAf27u+swRa9esHBs1bOpY=;7:xHJe/CWhfIF56cE9HgvScHe50F92lFOS/ttp18wWz85fXCPvjz54g9XDjp2vm/Xnl/pRo7HnmMlP1punu2cfK4a0p7G/PocebEcGmiQRvyD2ilLojE5VSno6hheq45go2ysn9HPKrINWefXAZsMgKg== x-ms-office365-filtering-correlation-id: eaf69d3f-2810-4a29-01a3-08d6405b4488 x-microsoft-antispam: BCL:0;PCL:0;RULEID:(7020095)(4652040)(7021145)(8989299)(4534185)(7022145)(4603075)(4627221)(201702281549075)(8990200)(7048125)(7024125)(7027125)(7023125)(5600074)(711020)(2017052603328)(7153060)(7193020);SRVR:BN6PR15MB1459; x-ms-traffictypediagnostic: BN6PR15MB1459: x-microsoft-antispam-prvs: x-exchange-antispam-report-test: UriScan:(269456686620040); x-ms-exchange-senderadcheck: 1 x-exchange-antispam-report-cfa-test: BCL:0;PCL:0;RULEID:(8211001083)(6040522)(2401047)(5005006)(8121501046)(3231382)(944501410)(52105095)(93006095)(93001095)(3002001)(10201501046)(148016)(149066)(150057)(6041310)(20161123564045)(20161123560045)(2016111802025)(20161123558120)(20161123562045)(6043046)(201708071742011)(7699051)(76991095);SRVR:BN6PR15MB1459;BCL:0;PCL:0;RULEID:;SRVR:BN6PR15MB1459; x-forefront-prvs: 08444C7C87 x-forefront-antispam-report: SFV:NSPM;SFS:(10019020)(136003)(396003)(39830400003)(366004)(376002)(346002)(199004)(189003)(8936002)(66066001)(2900100001)(2616005)(2906002)(476003)(14454004)(486006)(25786009)(6916009)(97736004)(508600001)(6486002)(106356001)(2351001)(6116002)(68736007)(105586002)(1076002)(5660300001)(2501003)(6436002)(102836004)(5640700003)(316002)(6506007)(99286004)(71190400001)(3846002)(386003)(52116002)(6512007)(256004)(53936002)(7736002)(186003)(305945005)(81156014)(81166006)(8676002)(86362001)(36756003)(71200400001)(26005);DIR:OUT;SFP:1102;SCL:1;SRVR:BN6PR15MB1459;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-microsoft-antispam-message-info: WOvtx2jD0xJe70Lzil8UchBtLY3DlCq08pJO/EkrLRCljxVC8PDuf4zjNHRsvYcAaxdJHShP6wfVPvKPhU12rOawjDKNi6LGDPHtQT/PJtl9ewGCkcyebCJg4Up+Exeien21Kse207zaqlibsHhtf4ShTikUQbJkvBlnnVPzXwxIfm6UjBki8bIg6Kg4jRPg7z0NFpue8VOjjiKm7RbkrHWwanHS2b4+8MpDxwzf5xbt2NV6uB7nGXKfkGmFMPizkAwGRiSeMj10sQ4u+bKSNe6P/wXLOaD8CAGBUQ3yPWd4v1slAsLS6sKxVC7vSVllnyPv5FtyN9RU0McXH3CAsjd1dT/NnVOAs0snkBYhGWs= 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: eaf69d3f-2810-4a29-01a3-08d6405b4488 X-MS-Exchange-CrossTenant-originalarrivaltime: 02 Nov 2018 00:36:46.0503 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: a0d45667-6c07-4e88-868f-4ac9af95c7ed X-MS-Exchange-Transport-CrossTenantHeadersStamped: BN6PR15MB1459 Sender: selinux-refpolicy-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: selinux-refpolicy@vger.kernel.org This interface is useful when using the 'RUN' option in UDEV rules where ud= ev will be executing a user executable to perform some action. This interf= ace allows a domain transition to occur for the run action. Signed-off-by: Dave Sugar --- policy/modules/system/udev.if | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) diff --git a/policy/modules/system/udev.if b/policy/modules/system/udev.if index a2067895..fee55852 100644 --- a/policy/modules/system/udev.if +++ b/policy/modules/system/udev.if @@ -36,6 +36,37 @@ interface(`udev_domtrans',` domtrans_pattern($1, udev_exec_t, udev_t) ') =20 +######################################## +## +## Allow udev to execute the specified program in +## the specified domain. +## +## +##

+## This is a 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_run_domain',` + gen_require(` + type udev_t; + ') + + domtrans_pattern(udev_t,$2,$1) +') + ######################################## ## ## Execute udev in the caller domain. --=20 2.14.4