selinux-refpolicy.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Chris PeBenito <pebenito@ieee.org>
To: Laurent Bigonville <bigon@debian.org>, selinux-refpolicy@vger.kernel.org
Subject: Re: [PATCH 06/10] Allow alsa_t to create alsa_runtime_t file as well
Date: Sat, 12 Oct 2019 11:52:46 -0400	[thread overview]
Message-ID: <765a8329-6944-b8fd-de32-e344896c4302@ieee.org> (raw)
In-Reply-To: <20191011122416.14651-6-bigon@debian.org>

On 10/11/19 8:24 AM, Laurent Bigonville wrote:
> From: Laurent Bigonville <bigon@bigon.be>
> 
> When alsactl is started as a daemon, it creates a pidfile
> (/run/alsactl.pid), that needs to be allowed
> 
> ----
> time->Sun Oct  6 10:59:09 2019
> type=AVC msg=audit(1570352349.743:45): avc:  denied  { write open } for  pid=804 comm="alsactl" path="/run/alsactl.pid" dev="tmpfs" ino=25882 scontext=system_u:system_r:alsa_t:s0 tcontext=system_u:object_r:var_run_t:s0 tclass=file permissive=1
> type=AVC msg=audit(1570352349.743:45): avc:  denied  { create } for  pid=804 comm="alsactl" name="alsactl.pid" scontext=system_u:system_r:alsa_t:s0 tcontext=system_u:object_r:var_run_t:s0 tclass=file permissive=1
> ----
> time->Sun Oct  6 11:54:38 2019
> type=AVC msg=audit(1570355678.226:657): avc:  denied  { open } for  pid=9186 comm="alsactl" path="/run/alsactl.pid" dev="tmpfs" ino=25882 scontext=system_u:system_r:alsa_t:s0 tcontext=system_u:object_r:var_run_t:s0 tclass=file permissive=1
> type=AVC msg=audit(1570355678.226:657): avc:  denied  { read } for  pid=9186 comm="alsactl" name="alsactl.pid" dev="tmpfs" ino=25882 scontext=system_u:system_r:alsa_t:s0 tcontext=system_u:object_r:var_run_t:s0 tclass=file permissive=1
> ----
> time->Sun Oct  6 11:54:38 2019
> type=AVC msg=audit(1570355678.230:659): avc:  denied  { unlink } for  pid=804 comm="alsactl" name="alsactl.pid" dev="tmpfs" ino=25882 scontext=system_u:system_r:alsa_t:s0 tcontext=system_u:object_r:var_run_t:s0 tclass=file permissive=1
> 
> Signed-off-by: Laurent Bigonville <bigon@bigon.be>
> ---
>   policy/modules/admin/alsa.fc | 1 +
>   policy/modules/admin/alsa.te | 3 ++-
>   2 files changed, 3 insertions(+), 1 deletion(-)
> 
> diff --git a/policy/modules/admin/alsa.fc b/policy/modules/admin/alsa.fc
> index 75ea9ebf..16ccb7ca 100644
> --- a/policy/modules/admin/alsa.fc
> +++ b/policy/modules/admin/alsa.fc
> @@ -4,6 +4,7 @@ HOME_DIR/\.asoundrc				--	gen_context(system_u:object_r:alsa_home_t,s0)
>   /etc/asound\.conf				--	gen_context(system_u:object_r:alsa_etc_t,s0)
>   
>   /run/alsa(/.*)?						gen_context(system_u:object_r:alsa_runtime_t,s0)
> +/run/alsactl.pid				--	gen_context(system_u:object_r:alsa_runtime_t,s0)

Needs escaping ( \.pid )


>   
>   /usr/bin/ainit					--	gen_context(system_u:object_r:alsa_exec_t,s0)
>   /usr/bin/alsactl				--	gen_context(system_u:object_r:alsa_exec_t,s0)
> diff --git a/policy/modules/admin/alsa.te b/policy/modules/admin/alsa.te
> index e567dd32..9d053c4d 100644
> --- a/policy/modules/admin/alsa.te
> +++ b/policy/modules/admin/alsa.te
> @@ -58,8 +58,9 @@ allow alsa_t alsa_etc_t:file map;
>   can_exec(alsa_t, alsa_exec_t)
>   
>   allow alsa_t alsa_runtime_t:dir manage_dir_perms;
> +allow alsa_t alsa_runtime_t:file manage_file_perms;
>   allow alsa_t alsa_runtime_t:lnk_file manage_lnk_file_perms;
> -files_pid_filetrans(alsa_t, alsa_runtime_t, dir)
> +files_pid_filetrans(alsa_t, alsa_runtime_t, { dir file })
>   
>   manage_dirs_pattern(alsa_t, alsa_tmp_t, alsa_tmp_t)
>   manage_files_pattern(alsa_t, alsa_tmp_t, alsa_tmp_t)
> 


-- 
Chris PeBenito

  reply	other threads:[~2019-10-12 15:52 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-10-11 12:24 [PATCH 01/10] Allow the systemd dbus-daemon to talk to systemd Laurent Bigonville
2019-10-11 12:24 ` [PATCH 02/10] Allow geoclue to log in syslog Laurent Bigonville
2019-10-11 12:24 ` [PATCH 03/10] Allow colord_t to exec colord_exec_t type Laurent Bigonville
2019-10-11 12:24 ` [PATCH 04/10] Allow realmd_t to read localization files Laurent Bigonville
2019-10-11 12:24 ` [PATCH 05/10] Allow colord_t to read the color profile stored in ~/.local/share/icc/ Laurent Bigonville
2019-10-11 12:54   ` Dominick Grift
2019-10-12  7:53     ` Dominick Grift
2019-10-12 15:51       ` Chris PeBenito
2019-10-12 16:09         ` Dominick Grift
2019-10-15 13:09           ` Laurent Bigonville
2019-10-11 12:24 ` [PATCH 06/10] Allow alsa_t to create alsa_runtime_t file as well Laurent Bigonville
2019-10-12 15:52   ` Chris PeBenito [this message]
2019-10-15 13:10     ` Laurent Bigonville
2019-10-11 12:24 ` [PATCH 07/10] Allow alsa_t to set scheduling priority and send signal to itself Laurent Bigonville
2019-10-11 12:24 ` [PATCH 08/10] Allow colord_t to read snmpd_var_lib_t files Laurent Bigonville
2019-10-11 12:24 ` [PATCH 09/10] Allow systemd_locale_t to talk to systemd notify socket Laurent Bigonville
2019-10-11 12:24 ` [PATCH 10/10] Allow vpnc to create and write its pid file in /run/NetworkManager Laurent Bigonville

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=765a8329-6944-b8fd-de32-e344896c4302@ieee.org \
    --to=pebenito@ieee.org \
    --cc=bigon@debian.org \
    --cc=selinux-refpolicy@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).