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 CE8E0C43387 for ; Sun, 6 Jan 2019 02:42:42 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 93A6A20836 for ; Sun, 6 Jan 2019 02:42:42 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=coker.com.au header.i=@coker.com.au header.b="dIJHbei9" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726378AbfAFCmm (ORCPT ); Sat, 5 Jan 2019 21:42:42 -0500 Received: from smtp.sws.net.au ([46.4.88.250]:39824 "EHLO smtp.sws.net.au" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726372AbfAFCmm (ORCPT ); Sat, 5 Jan 2019 21:42:42 -0500 Received: from xev.coker.com.au (localhost [127.0.0.1]) by smtp.sws.net.au (Postfix) with ESMTP id 49E5AECBC for ; Sun, 6 Jan 2019 13:42:40 +1100 (AEDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=coker.com.au; s=2008; t=1546742560; bh=m9Fx5E6LTZB6d2xJROw2/GMqp8Z/CVq4OXPiMUiwSL8=; l=3035; h=Date:From:To:Subject:From; b=dIJHbei9x0hT0Y2V3EUycKsiP2J+4UqljqyPmdhEHHJgeHVMuMWo32YEX6kjRl6uq ucV1ej3ZMbJgiCkxj6hNF1PGHITkAnnYvm70WiuHGdcDzGrXK+1/lAnp3OCi96p0BK NNdsiLAToehI1kH3Smb/EkYb8+4Cr3HpU2/kU7AQ= Received: by xev.coker.com.au (Postfix, from userid 1001) id D409DC3CF2E; Sun, 6 Jan 2019 13:42:35 +1100 (AEDT) Date: Sun, 6 Jan 2019 13:42:35 +1100 From: Russell Coker To: selinux-refpolicy@vger.kernel.org Subject: [PATCH] missing from previous Message-ID: <20190106024235.GA17569@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 Here are the things that weren't applied from my previous patches, I think they are all worthy of inclusion. Index: refpolicy-2.20180701/policy/modules/admin/apt.if =================================================================== --- refpolicy-2.20180701.orig/policy/modules/admin/apt.if +++ refpolicy-2.20180701/policy/modules/admin/apt.if @@ -171,7 +171,7 @@ interface(`apt_read_cache',` files_search_var($1) allow $1 apt_var_cache_t:dir list_dir_perms; - allow $1 apt_var_cache_t:file read_file_perms; + allow $1 apt_var_cache_t:file mmap_read_file_perms; ') ######################################## @@ -191,7 +191,7 @@ interface(`apt_manage_cache',` files_search_var($1) allow $1 apt_var_cache_t:dir manage_dir_perms; - allow $1 apt_var_cache_t:file manage_file_perms; + allow $1 apt_var_cache_t:file { manage_file_perms map }; ') ######################################## Index: refpolicy-2.20180701/policy/modules/system/systemd.if =================================================================== --- refpolicy-2.20180701.orig/policy/modules/system/systemd.if +++ refpolicy-2.20180701/policy/modules/system/systemd.if @@ -307,6 +307,7 @@ interface(`systemd_use_passwd_agent',` manage_sock_files_pattern($1, systemd_passwd_var_run_t, systemd_passwd_var_run_t) allow systemd_passwd_agent_t $1:process signull; + ps_process_pattern(systemd_passwd_agent_t, $1) allow systemd_passwd_agent_t $1:unix_dgram_socket sendto; ') @@ -828,3 +829,22 @@ interface(`systemd_getattr_updated_runti getattr_files_pattern($1, systemd_update_run_t, systemd_update_run_t) ') + +####################################### +## +## Allow domain to list dirs under /run/systemd/netif +## +## +## +## domain permitted the access +## +## +# +interface(`systemd_list_netif',` + gen_require(` + type systemd_networkd_var_run_t; + ') + + init_list_pids($1) + allow $1 systemd_networkd_var_run_t:dir list_dir_perms; +') Index: refpolicy-2.20180701/policy/modules/services/ntp.te =================================================================== --- refpolicy-2.20180701.orig/policy/modules/services/ntp.te +++ refpolicy-2.20180701/policy/modules/services/ntp.te @@ -152,7 +152,7 @@ ifdef(`init_systemd',` init_list_var_lib_dirs(ntpd_t) # for /run/systemd/netif/links - init_list_pids(ntpd_t) + systemd_list_netif(ntpd_t) optional_policy(` unconfined_dbus_send(ntpd_t) Index: refpolicy-2.20180701/policy/modules/system/logging.te =================================================================== --- refpolicy-2.20180701.orig/policy/modules/system/logging.te +++ refpolicy-2.20180701/policy/modules/system/logging.te @@ -552,6 +552,8 @@ ifdef(`init_systemd',` init_dgram_send(syslogd_t) init_read_pid_pipes(syslogd_t) init_read_state(syslogd_t) + # for /run/systemd/units/invocation:* links + init_read_unit_links(syslogd_t) systemd_manage_journal_files(syslogd_t)