From: "Jason Zaman" <perfinion@gentoo.org>
To: gentoo-commits@lists.gentoo.org
Subject: [gentoo-commits] proj/hardened-refpolicy:master commit in: policy/modules/services/, policy/modules/system/
Date: Sat, 28 Nov 2020 23:09:30 +0000 (UTC) [thread overview]
Message-ID: <1606604148.e2236d7e0c64a40ec71ab835f5818e396437ec2e.perfinion@gentoo> (raw)
commit: e2236d7e0c64a40ec71ab835f5818e396437ec2e
Author: Jason Zaman <perfinion <AT> gentoo <DOT> org>
AuthorDate: Tue Nov 17 03:46:21 2020 +0000
Commit: Jason Zaman <perfinion <AT> gentoo <DOT> org>
CommitDate: Sat Nov 28 22:55:48 2020 +0000
URL: https://gitweb.gentoo.org/proj/hardened-refpolicy.git/commit/?id=e2236d7e
userdomain: Add watch on home dirs
avc: denied { watch } for pid=12351 comm="gmain" path="/usr/share/backgrounds/xfce" dev="zfs" ino=366749 scontext=staff_u:staff_r:staff_t:s0-s0:c0.c1023 tcontext=system_u:object_r:usr_t:s0 tclass=dir permissive=0
avc: denied { watch } for pid=11646 comm="gmain" path="/etc/fonts" dev="zfs" ino=237700 scontext=staff_u:staff_r:staff_t:s0-s0:c0.c1023 tcontext=system_u:object_r:fonts_t:s0 tclass=dir permissive=0
avc: denied { watch } for pid=12351 comm="gmain" path="/home/jason/Desktop" dev="zfs" ino=33153 scontext=staff_u:staff_r:staff_t:s0-s0:c0.c1023 tcontext=staff_u:object_r:user_home_t:s0 tclass=dir permissive=0
avc: denied { watch } for pid=12574 comm="gmain" path="/home/jason/.local/share/icc" dev="zfs" ino=1954514 scontext=staff_u:staff_r:staff_t:s0-s0:c0.c1023 tcontext=staff_u:object_r:xdg_data_t:s0 tclass=dir permissive=0
avc: denied { watch } for pid=11795 comm="gmain" path="/home/jason/.config/xfce4/panel/launcher-19" dev="zfs" ino=35464 scontext=staff_u:staff_r:staff_t:s0-s0:c0.c1023 tcontext=staff_u:object_r:xdg_config_t:s0 tclass=dir permissive=0
avc: denied { watch } for pid=12351 comm="gmain" path="/home/jason/downloads/pics" dev="zfs" ino=38173 scontext=staff_u:staff_r:staff_t:s0-s0:c0.c1023 tcontext=staff_u:object_r:xdg_downloads_t:s0 tclass=dir permissive=0
Signed-off-by: Jason Zaman <jason <AT> perfinion.com>
Signed-off-by: Jason Zaman <perfinion <AT> gentoo.org>
policy/modules/services/xserver.if | 11 +-
policy/modules/system/miscfiles.if | 18 ++++
policy/modules/system/userdomain.if | 15 ++-
policy/modules/system/xdg.if | 198 ++++++++++++++++++++++++++++++++++++
4 files changed, 240 insertions(+), 2 deletions(-)
diff --git a/policy/modules/services/xserver.if b/policy/modules/services/xserver.if
index baa39ef8..d5d6c791 100644
--- a/policy/modules/services/xserver.if
+++ b/policy/modules/services/xserver.if
@@ -95,6 +95,7 @@ interface(`xserver_restricted_role',`
dev_rw_usbfs($2)
miscfiles_read_fonts($2)
+ miscfiles_watch_fonts_dirs($2)
xserver_common_x_domain_template(user, $2) #selint-disable:S-004
xserver_domtrans($2)
@@ -186,10 +187,13 @@ interface(`xserver_role',`
optional_policy(`
xdg_manage_all_cache($2)
xdg_relabel_all_cache($2)
+ xdg_watch_all_cache_dirs($2)
xdg_manage_all_config($2)
xdg_relabel_all_config($2)
+ xdg_watch_all_config_dirs($2)
xdg_manage_all_data($2)
xdg_relabel_all_data($2)
+ xdg_watch_all_data_dirs($2)
xdg_generic_user_home_dir_filetrans_cache($2, dir, ".cache")
xdg_generic_user_home_dir_filetrans_config($2, dir, ".config")
@@ -203,14 +207,19 @@ interface(`xserver_role',`
xdg_manage_documents($2)
xdg_relabel_documents($2)
+ xdg_watch_documents_dirs($2)
xdg_manage_downloads($2)
xdg_relabel_downloads($2)
+ xdg_watch_downloads_dirs($2)
xdg_manage_music($2)
xdg_relabel_music($2)
+ xdg_watch_music_dirs($2)
xdg_manage_pictures($2)
xdg_relabel_pictures($2)
+ xdg_watch_pictures_dirs($2)
xdg_manage_videos($2)
xdg_relabel_videos($2)
+ xdg_watch_videos_dirs($2)
xdg_cache_filetrans($2, mesa_shader_cache_t, dir, "mesa_shader_cache")
')
@@ -508,7 +517,7 @@ interface(`xserver_use_user_fonts',`
')
# Read per user fonts
- allow $1 user_fonts_t:dir list_dir_perms;
+ allow $1 user_fonts_t:dir { list_dir_perms watch };
allow $1 user_fonts_t:file { map read_file_perms };
# Manipulate the global font cache
diff --git a/policy/modules/system/miscfiles.if b/policy/modules/system/miscfiles.if
index a0b13261..751b3579 100644
--- a/policy/modules/system/miscfiles.if
+++ b/policy/modules/system/miscfiles.if
@@ -854,6 +854,24 @@ interface(`miscfiles_manage_public_files',`
manage_lnk_files_pattern($1, public_content_rw_t, public_content_rw_t)
')
+########################################
+## <summary>
+## Watch public files
+## </summary>
+## <param name="domain">
+## <summary>
+## Domain allowed access.
+## </summary>
+## </param>
+#
+interface(`miscfiles_watch_public_dirs',`
+ gen_require(`
+ type public_content_rw_t;
+ ')
+
+ allow $1 public_content_rw_t:dir watch;
+')
+
########################################
## <summary>
## Read TeX data
diff --git a/policy/modules/system/userdomain.if b/policy/modules/system/userdomain.if
index b7fe1a79..7ce340dc 100644
--- a/policy/modules/system/userdomain.if
+++ b/policy/modules/system/userdomain.if
@@ -289,6 +289,12 @@ interface(`userdom_ro_home_role',`
read_sock_files_pattern($2, { user_home_t user_home_dir_t }, user_home_t)
files_list_home($2)
+ allow $2 { user_home_t user_home_dir_t }:dir { watch watch_mount watch_sb watch_with_perm watch_reads };
+ allow $2 user_home_t:file { watch watch_mount watch_sb watch_with_perm watch_reads };
+ allow $2 user_home_t:lnk_file { watch watch_mount watch_sb watch_with_perm watch_reads };
+ allow $2 user_home_t:sock_file { watch watch_mount watch_sb watch_with_perm watch_reads };
+ allow $2 user_home_t:fifo_file { watch watch_mount watch_sb watch_with_perm watch_reads };
+
tunable_policy(`use_nfs_home_dirs',`
fs_list_nfs($2)
fs_read_nfs_files($2)
@@ -368,7 +374,11 @@ interface(`userdom_manage_home_role',`
# cjp: this should probably be removed:
allow $2 user_home_dir_t:dir { manage_dir_perms relabel_dir_perms };
- allow $2 user_home_dir_t:dir watch;
+ allow $2 { user_home_t user_home_dir_t }:dir { watch watch_mount watch_sb watch_with_perm watch_reads };
+ allow $2 user_home_t:file { watch watch_mount watch_sb watch_with_perm watch_reads };
+ allow $2 user_home_t:lnk_file { watch watch_mount watch_sb watch_with_perm watch_reads };
+ allow $2 user_home_t:sock_file { watch watch_mount watch_sb watch_with_perm watch_reads };
+ allow $2 user_home_t:fifo_file { watch watch_mount watch_sb watch_with_perm watch_reads };
userdom_manage_user_certs($2)
userdom_user_home_dir_filetrans($2, user_cert_t, dir, ".pki")
@@ -631,6 +641,8 @@ template(`userdom_common_user_template',`
files_read_var_lib_files($1_t)
# Stat lost+found.
files_getattr_lost_found_dirs($1_t)
+ files_watch_etc_dirs($1_t)
+ files_watch_usr_dirs($1_t)
fs_rw_cgroup_files($1_t)
@@ -1183,6 +1195,7 @@ template(`userdom_unpriv_user_template', `
files_exec_usr_files($1_t)
miscfiles_manage_public_files($1_t)
+ miscfiles_watch_public_dirs($1_t)
tunable_policy(`user_dmesg',`
kernel_read_ring_buffer($1_t)
diff --git a/policy/modules/system/xdg.if b/policy/modules/system/xdg.if
index e94d6720..b7620384 100644
--- a/policy/modules/system/xdg.if
+++ b/policy/modules/system/xdg.if
@@ -83,6 +83,42 @@ interface(`xdg_search_cache_dirs',`
userdom_search_user_home_dirs($1)
')
+########################################
+## <summary>
+## Watch the xdg cache home directories
+## </summary>
+## <param name="domain">
+## <summary>
+## Domain allowed access.
+## </summary>
+## </param>
+#
+interface(`xdg_watch_cache_dirs',`
+ gen_require(`
+ type xdg_cache_t;
+ ')
+
+ allow $1 xdg_cache_t:dir watch;
+')
+
+########################################
+## <summary>
+## Watch all the xdg cache home directories
+## </summary>
+## <param name="domain">
+## <summary>
+## Domain allowed access.
+## </summary>
+## </param>
+#
+interface(`xdg_watch_all_cache_dirs',`
+ gen_require(`
+ attribute xdg_cache_type;
+ ')
+
+ allow $1 xdg_cache_type:dir watch;
+')
+
########################################
## <summary>
## Read the xdg cache home files
@@ -333,6 +369,42 @@ interface(`xdg_search_config_dirs',`
userdom_search_user_home_dirs($1)
')
+########################################
+## <summary>
+## Watch the xdg config home directories
+## </summary>
+## <param name="domain">
+## <summary>
+## Domain allowed access.
+## </summary>
+## </param>
+#
+interface(`xdg_watch_config_dirs',`
+ gen_require(`
+ type xdg_config_t;
+ ')
+
+ allow $1 xdg_config_t:dir watch;
+')
+
+########################################
+## <summary>
+## Watch all the xdg config home directories
+## </summary>
+## <param name="domain">
+## <summary>
+## Domain allowed access.
+## </summary>
+## </param>
+#
+interface(`xdg_watch_all_config_dirs',`
+ gen_require(`
+ attribute xdg_config_type;
+ ')
+
+ allow $1 xdg_config_type:dir watch;
+')
+
########################################
## <summary>
## Read the xdg config home files
@@ -563,6 +635,42 @@ interface(`xdg_relabel_all_config',`
userdom_search_user_home_dirs($1)
')
+########################################
+## <summary>
+## Watch the xdg data home directories
+## </summary>
+## <param name="domain">
+## <summary>
+## Domain allowed access.
+## </summary>
+## </param>
+#
+interface(`xdg_watch_data_dirs',`
+ gen_require(`
+ type xdg_data_t;
+ ')
+
+ allow $1 xdg_data_t:dir watch;
+')
+
+########################################
+## <summary>
+## Watch all the xdg data home directories
+## </summary>
+## <param name="domain">
+## <summary>
+## Domain allowed access.
+## </summary>
+## </param>
+#
+interface(`xdg_watch_all_data_dirs',`
+ gen_require(`
+ attribute xdg_data_type;
+ ')
+
+ allow $1 xdg_data_type:dir watch;
+')
+
########################################
## <summary>
## Read the xdg data home files
@@ -793,6 +901,24 @@ interface(`xdg_relabel_all_data',`
userdom_search_user_home_dirs($1)
')
+########################################
+## <summary>
+## Watch the xdg documents home directories
+## </summary>
+## <param name="domain">
+## <summary>
+## Domain allowed access.
+## </summary>
+## </param>
+#
+interface(`xdg_watch_documents_dirs',`
+ gen_require(`
+ type xdg_documents_t;
+ ')
+
+ allow $1 xdg_documents_t:dir watch;
+')
+
########################################
## <summary>
## Create objects in the user home dir with an automatic type transition to
@@ -865,6 +991,24 @@ interface(`xdg_relabel_documents',`
userdom_search_user_home_dirs($1)
')
+########################################
+## <summary>
+## Watch the xdg downloads home directories
+## </summary>
+## <param name="domain">
+## <summary>
+## Domain allowed access.
+## </summary>
+## </param>
+#
+interface(`xdg_watch_downloads_dirs',`
+ gen_require(`
+ type xdg_downloads_t;
+ ')
+
+ allow $1 xdg_downloads_t:dir watch;
+')
+
#########################################
## <summary>
## Read downloaded content
@@ -1006,6 +1150,24 @@ interface(`xdg_relabel_downloads',`
userdom_search_user_home_dirs($1)
')
+########################################
+## <summary>
+## Watch the xdg pictures home directories
+## </summary>
+## <param name="domain">
+## <summary>
+## Domain allowed access.
+## </summary>
+## </param>
+#
+interface(`xdg_watch_pictures_dirs',`
+ gen_require(`
+ type xdg_pictures_t;
+ ')
+
+ allow $1 xdg_pictures_t:dir watch;
+')
+
#########################################
## <summary>
## Read user pictures content
@@ -1101,6 +1263,24 @@ interface(`xdg_relabel_pictures',`
userdom_search_user_home_dirs($1)
')
+########################################
+## <summary>
+## Watch the xdg music home directories
+## </summary>
+## <param name="domain">
+## <summary>
+## Domain allowed access.
+## </summary>
+## </param>
+#
+interface(`xdg_watch_music_dirs',`
+ gen_require(`
+ type xdg_music_t;
+ ')
+
+ allow $1 xdg_music_t:dir watch;
+')
+
#########################################
## <summary>
## Read user music content
@@ -1196,6 +1376,24 @@ interface(`xdg_relabel_music',`
userdom_search_user_home_dirs($1)
')
+########################################
+## <summary>
+## Watch the xdg video content
+## </summary>
+## <param name="domain">
+## <summary>
+## Domain allowed access.
+## </summary>
+## </param>
+#
+interface(`xdg_watch_videos_dirs',`
+ gen_require(`
+ type xdg_videos_t;
+ ')
+
+ allow $1 xdg_videos_t:dir watch;
+')
+
#########################################
## <summary>
## Read user video content
next reply other threads:[~2020-11-28 23:09 UTC|newest]
Thread overview: 22+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-11-28 23:09 Jason Zaman [this message]
-- strict thread matches above, loose matches on Subject: below --
2024-09-22 0:03 [gentoo-commits] proj/hardened-refpolicy:master commit in: policy/modules/services/, policy/modules/system/ Jason Zaman
2023-10-06 16:44 Kenton Groombridge
2023-02-13 15:35 Kenton Groombridge
2022-11-02 14:42 Kenton Groombridge
2021-01-11 1:27 Jason Zaman
2020-02-15 7:33 Jason Zaman
2019-03-26 10:17 Jason Zaman
2019-03-26 10:17 Jason Zaman
2019-02-10 4:14 Jason Zaman
2018-12-09 11:48 Jason Zaman
2017-12-12 7:59 Jason Zaman
2017-11-17 14:59 Jason Zaman
2017-01-13 18:43 Sven Vermeulen
2016-08-17 16:59 [gentoo-commits] proj/hardened-refpolicy:next " Jason Zaman
2016-08-17 16:59 ` [gentoo-commits] proj/hardened-refpolicy:master " Jason Zaman
2016-08-17 16:59 Jason Zaman
2015-05-27 20:00 Jason Zaman
2014-06-30 19:03 Sven Vermeulen
2014-06-30 19:03 Sven Vermeulen
2014-06-10 18:17 Sven Vermeulen
2013-12-06 17:33 Sven Vermeulen
2012-12-07 15:36 Sven Vermeulen
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=1606604148.e2236d7e0c64a40ec71ab835f5818e396437ec2e.perfinion@gentoo \
--to=perfinion@gentoo.org \
--cc=gentoo-commits@lists.gentoo.org \
--cc=gentoo-dev@lists.gentoo.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