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=-2.6 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_PASS, USER_AGENT_MUTT 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 49FFFC61CE4 for ; Sat, 19 Jan 2019 12:04:51 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 14FB52086A for ; Sat, 19 Jan 2019 12:04:51 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=coker.com.au header.i=@coker.com.au header.b="1TwkNm3g" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727924AbfASMEu (ORCPT ); Sat, 19 Jan 2019 07:04:50 -0500 Received: from smtp.sws.net.au ([46.4.88.250]:37006 "EHLO smtp.sws.net.au" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727900AbfASMEu (ORCPT ); Sat, 19 Jan 2019 07:04:50 -0500 Received: from xev.coker.com.au (localhost [127.0.0.1]) by smtp.sws.net.au (Postfix) with ESMTP id D33A0ECBC for ; Sat, 19 Jan 2019 23:04:48 +1100 (AEDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=coker.com.au; s=2008; t=1547899489; bh=DEgj+ta5zdKepjG6ymqpFSZ/A1QIAHPAh2LxyHWXGnc=; l=2993; h=Date:From:To:Subject:From; b=1TwkNm3gRT2/sb1CuiicBKWfJ61wRWKdS4K5+OqJ9Ot80gyjg+2ft4L5PsjZDl2KF d8mKJptBzZM2Ci8ZhokVfTKAq6sw8QSiqKdXHmlyDfr4IGqrj1AOK8zqE5vTLXDXNi 3atPDCNu1ldA+bEOaPXl6zB2LFtxQrzpeacm3NEw= Received: by xev.coker.com.au (Postfix, from userid 1001) id 38B07C5E930; Sat, 19 Jan 2019 23:04:44 +1100 (AEDT) Date: Sat, 19 Jan 2019 23:04:44 +1100 From: Russell Coker To: "selinux-refpolicy@vger.kernel.org" Subject: [PATCH] more tiny stuff Message-ID: <20190119120444.GA1199@xev> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.10.1 (2018-07-13) Sender: selinux-refpolicy-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: selinux-refpolicy@vger.kernel.org I think the old timesync labelling wasn't working anyway due to -- for a directory name. A couple of patches for devicekit calling dmidecode (this is part of replacing some kmem access that was discussed on this list and rejected as a misfeature in Debian DMI related code ages ago). The rest should be obvious. Index: refpolicy-2.20180701/policy/modules/services/ntp.fc =================================================================== --- refpolicy-2.20180701.orig/policy/modules/services/ntp.fc +++ refpolicy-2.20180701/policy/modules/services/ntp.fc @@ -32,7 +32,7 @@ /var/lib/ntp(/.*)? gen_context(system_u:object_r:ntp_drift_t,s0) /var/lib/sntp-kod(/.*)? gen_context(system_u:object_r:ntp_drift_t,s0) /var/lib/systemd/clock -- gen_context(system_u:object_r:ntp_drift_t,s0) -/var/lib/private/systemd/timesync(/.*)? -- gen_context(system_u:object_r:ntp_drift_t,s0) +/var/lib/systemd/timesync(/.*)? gen_context(system_u:object_r:ntp_drift_t,s0) /var/lock/ntpdate -- gen_context(system_u:object_r:ntpd_lock_t,s0) Index: refpolicy-2.20180701/policy/modules/admin/dmidecode.te =================================================================== --- refpolicy-2.20180701.orig/policy/modules/admin/dmidecode.te +++ refpolicy-2.20180701/policy/modules/admin/dmidecode.te @@ -32,3 +32,9 @@ mls_file_read_all_levels(dmidecode_t) locallogin_use_fds(dmidecode_t) userdom_use_inherited_user_terminals(dmidecode_t) + +ifdef(`init_systemd',` + # inherits /dev/null and a socket from devicekit_disk_t + init_use_fds(dmidecode_t) + init_rw_inherited_stream_socket(dmidecode_t) +') Index: refpolicy-2.20180701/policy/modules/services/devicekit.te =================================================================== --- refpolicy-2.20180701.orig/policy/modules/services/devicekit.te +++ refpolicy-2.20180701/policy/modules/services/devicekit.te @@ -177,6 +177,10 @@ optional_policy(` ') optional_policy(` + dmidecode_domtrans(devicekit_disk_t) +') + +optional_policy(` fstools_domtrans(devicekit_disk_t) ') Index: refpolicy-2.20180701/policy/modules/services/xserver.te =================================================================== --- refpolicy-2.20180701.orig/policy/modules/services/xserver.te +++ refpolicy-2.20180701/policy/modules/services/xserver.te @@ -291,6 +291,8 @@ kernel_request_load_module(xauth_t) domain_use_interactive_fds(xauth_t) +dev_read_sysfs(xauth_t) + files_read_etc_files(xauth_t) files_search_pids(xauth_t) Index: refpolicy-2.20180701/policy/modules/system/unconfined.te =================================================================== --- refpolicy-2.20180701.orig/policy/modules/system/unconfined.te +++ refpolicy-2.20180701/policy/modules/system/unconfined.te @@ -59,6 +59,9 @@ ifdef(`direct_sysadm_daemon',` ') ifdef(`init_systemd',` + # for systemd-analyze + init_service_status(unconfined_t) + optional_policy(` systemd_dbus_chat_resolved(unconfined_t) ')