Skip to contentSkip to conversation

mount: fs_list_auto_mountpoint() is now redundant because autofs_t is covered by files_list_all_mountpoints()

PATCH New Dominick Grift 6 participants 89 messages Nov 9, 2013 – Feb 7, 2014

lore
Share & tools
lore
#0 lore raw

PATCH 1/39 mount: fs_list_auto_mountpoint() is now redundant because autofs_t is covered by files_list_all_mountpoints()

---
 policy/modules/system/mount.te | 1 -
 1 file changed, 1 deletion(-)
policy/modules/system/mount.te +0 -1
index 459a0ef..ea1016d 100644
@@ -107,7 +107,6 @@ fs_mount_all_fs(mount_t)
 fs_unmount_all_fs(mount_t)
 fs_remount_all_fs(mount_t)
 fs_relabelfrom_all_fs(mount_t)
-fs_list_auto_mountpoints(mount_t)
 fs_rw_tmpfs_chr_files(mount_t)
 fs_read_tmpfs_symlinks(mount_t)
 fs_dontaudit_write_tmpfs_dirs(mount_t)
Signature · 1 line
1.8.3.1
#1 lore raw

PATCH 2/39 udev: this fc spec does not make sense, as there is no corresponding file type transition for it

---
 policy/modules/system/udev.fc | 1 -
 1 file changed, 1 deletion(-)
policy/modules/system/udev.fc +0 -1
index f41857e..374ac00 100644
@@ -30,7 +30,6 @@ ifdef(`distro_redhat',`
 
 /usr/lib/systemd/systemd-udevd -- gen_context(system_u:object_r:udev_exec_t,s0)
 
-/var/run/PackageKit/udev(/.*)? gen_context(system_u:object_r:udev_var_run_t,s0)
 /var/run/udev(/.*)?	gen_context(system_u:object_r:udev_var_run_t,s0)
 
 ifdef(`distro_debian',`
Signature · 1 line
1.8.3.1
#2 lore raw

PATCH 2/39 udev: this fc spec does not make sense, as there is no corresponding file type transition for it

Quoted 10 lines · Dominick Grift
---
 policy/modules/system/udev.fc | 1 -
 1 file changed, 1 deletion(-)
policy/modules/system/udev.fc +0 -0
index f41857e..374ac00 100644

policy/modules/system/udev.fc ifdef(`distro_redhat',` · line 35

Quoted 7 lines
policy/modules/system/udev.fc +0 -1
@@ -30,7 +30,6 @@ ifdef(`distro_redhat',`
 
 /usr/lib/systemd/systemd-udevd -- gen_context(system_u:object_r:udev_exec_t,s0)
 
-/var/run/PackageKit/udev(/.*)? gen_context(system_u:object_r:udev_var_run_t,s0)
 /var/run/udev(/.*)?	gen_context(system_u:object_r:udev_var_run_t,s0)
 
 ifdef(`distro_debian',`

Merged.

Signature · 3 lines
Chris PeBenito
Tresys Technology, LLC
www.tresys.com | oss.tresys.com
#3 lore raw

PATCH 3/39 userdomain: add userdom_delete_user_tmpfs_files() for pulseaudio clients

In reply to Dominick Grift
---
 policy/modules/system/userdomain.if | 19 +++++++++++++++++++
 1 file changed, 19 insertions(+)
policy/modules/system/userdomain.if +19 -0
index 9dc60c6..06d8db1 100644
@@ -2663,6 +2663,25 @@ interface(`userdom_tmp_filetrans_user_tmp',`
 
 ########################################
 ## <summary>
+##	Delete user tmpfs files.
+## </summary>
+## <param name="domain">
+##	<summary>
+##	Domain allowed access.
+##	</summary>
+## </param>
+#
+interface(`userdom_delete_user_tmpfs_files',`
+	gen_require(`
+		type user_tmpfs_t;
+	')
+
+	delete_files_pattern($1, user_tmpfs_t, user_tmpfs_t)
+	fs_search_tmpfs($1)
+')
+
+########################################
+## <summary>
 ##	Read user tmpfs files.
 ## </summary>
 ## <param name="domain">
Signature · 1 line
1.8.3.1
#4 lore raw

PATCH 3/39 userdomain: add userdom_delete_user_tmpfs_files() for pulseaudio clients

Quoted 25 lines · Dominick Grift
---
 policy/modules/system/userdomain.if | 19 +++++++++++++++++++
 1 file changed, 19 insertions(+)
policy/modules/system/userdomain.if +12 -0
index 9dc60c6..06d8db1 100644
@@ -2663,6 +2663,25 @@ interface(`userdom_tmp_filetrans_user_tmp',`
 
 ########################################
 ## <summary>
+##	Delete user tmpfs files.
+## </summary>
+## <param name="domain">
+##	<summary>
+##	Domain allowed access.
+##	</summary>
+## </param>
+#
+interface(`userdom_delete_user_tmpfs_files',`
+	gen_require(`
+		type user_tmpfs_t;
+	')

policy/modules/system/userdomain.if interface(`userdom_tmp_filetrans_user_tmp',` · line 2687

Quoted 10 lines
policy/modules/system/userdomain.if +7 -0
+
+	delete_files_pattern($1, user_tmpfs_t, user_tmpfs_t)
+	fs_search_tmpfs($1)
+')
+
+########################################
+## <summary>
 ##	Read user tmpfs files.
 ## </summary>
 ## <param name="domain">

Merged.

Signature · 3 lines
Chris PeBenito
Tresys Technology, LLC
www.tresys.com | oss.tresys.com
#5 lore raw

PATCH 4/39 udev: the avahi dns check script run by udev in Debian chmods /run/avahi-daemon

In reply to Dominick Grift
---
 policy/modules/system/udev.te | 1 +
 1 file changed, 1 insertion(+)
policy/modules/system/udev.te +1 -0
index 39f185f..183e45d 100644
@@ -184,6 +184,7 @@ ifdef(`distro_debian',`
 		avahi_create_pid_dirs(udev_t)
 		avahi_initrc_domtrans(udev_t)
 		avahi_manage_pid_files(udev_t)
+		avahi_setattr_pid_dirs(udev_t)
 		avahi_filetrans_pid(udev_t, dir, "avahi-daemon")
 	')
 ')
Signature · 1 line
1.8.3.1
#6 lore raw

PATCH 4/39 udev: the avahi dns check script run by udev in Debian chmods /run/avahi-daemon

Quoted 10 lines · Dominick Grift
---
 policy/modules/system/udev.te | 1 +
 1 file changed, 1 insertion(+)
policy/modules/system/udev.te +0 -0
index 39f185f..183e45d 100644

policy/modules/system/udev.te ifdef(`distro_debian',` · line 190

Quoted 7 lines
policy/modules/system/udev.te +1 -0
@@ -184,6 +184,7 @@ ifdef(`distro_debian',`
 		avahi_create_pid_dirs(udev_t)
 		avahi_initrc_domtrans(udev_t)
 		avahi_manage_pid_files(udev_t)
+		avahi_setattr_pid_dirs(udev_t)
 		avahi_filetrans_pid(udev_t, dir, "avahi-daemon")
 	')
 ')

Merged.

Signature · 3 lines
Chris PeBenito
Tresys Technology, LLC
www.tresys.com | oss.tresys.com
#7 lore raw

PATCH 5/39 authlogin: unix_chkpwd traverses / on sysfs device on Debian

In reply to Dominick Grift
---
 policy/modules/system/authlogin.te | 1 +
 1 file changed, 1 insertion(+)
policy/modules/system/authlogin.te +1 -0
index 09b791d..367e920 100644
@@ -105,6 +105,7 @@ domain_dontaudit_use_interactive_fds(chkpwd_t)
 
 dev_read_rand(chkpwd_t)
 dev_read_urand(chkpwd_t)
+dev_search_sysfs(chkpwd_t)
 
 files_read_etc_files(chkpwd_t)
 # for nscd
Signature · 1 line
1.8.3.1
#8 lore raw

PATCH 5/39 authlogin: unix_chkpwd traverses / on sysfs device on Debian

Quoted 10 lines · Dominick Grift
---
 policy/modules/system/authlogin.te | 1 +
 1 file changed, 1 insertion(+)
policy/modules/system/authlogin.te +0 -0
index 09b791d..367e920 100644

policy/modules/system/authlogin.te domain_dontaudit_use_interactive_fds(chkpwd_t) · line 111

Quoted 7 lines
policy/modules/system/authlogin.te +1 -0
@@ -105,6 +105,7 @@ domain_dontaudit_use_interactive_fds(chkpwd_t)
 
 dev_read_rand(chkpwd_t)
 dev_read_urand(chkpwd_t)
+dev_search_sysfs(chkpwd_t)
 
 files_read_etc_files(chkpwd_t)
 # for nscd

Merged.

Signature · 3 lines
Chris PeBenito
Tresys Technology, LLC
www.tresys.com | oss.tresys.com
#9 lore raw

PATCH 6/39 setrans: mcstransd reads filesystems file in /proc

In reply to Dominick Grift
---
 policy/modules/system/setrans.te | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
policy/modules/system/setrans.te +1 -1
index 1447687..8e1e27d 100644
@@ -50,7 +50,7 @@ manage_sock_files_pattern(setrans_t, setrans_var_run_t, setrans_var_run_t)
 files_pid_filetrans(setrans_t, setrans_var_run_t, { file dir })
 
 kernel_read_kernel_sysctls(setrans_t)
-kernel_read_proc_symlinks(setrans_t)
+kernel_read_system_state(setrans_t)
 
 # allow performing getpidcon() on all processes
 domain_read_all_domains_state(setrans_t)
Signature · 1 line
1.8.3.1
#10 lore raw

PATCH 6/39 setrans: mcstransd reads filesystems file in /proc

Quoted 10 lines · Dominick Grift
---
 policy/modules/system/setrans.te | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
policy/modules/system/setrans.te +0 -0
index 1447687..8e1e27d 100644

policy/modules/system/setrans.te manage_sock_files_pattern(setrans_t, setrans_var_run_t, setrans_var_run_t) · line 56

Quoted 8 lines
policy/modules/system/setrans.te +1 -1
@@ -50,7 +50,7 @@ manage_sock_files_pattern(setrans_t, setrans_var_run_t, setrans_var_run_t)
 files_pid_filetrans(setrans_t, setrans_var_run_t, { file dir })
 
 kernel_read_kernel_sysctls(setrans_t)
-kernel_read_proc_symlinks(setrans_t)
+kernel_read_system_state(setrans_t)
 
 # allow performing getpidcon() on all processes
 domain_read_all_domains_state(setrans_t)

Merged.

Signature · 3 lines
Chris PeBenito
Tresys Technology, LLC
www.tresys.com | oss.tresys.com
#11 lore raw

PATCH 7/39 setrans: needs to be able to get attributes of selinuxfs, else fails to start in Debian

In reply to Dominick Grift
---
 policy/modules/system/setrans.te | 1 +
 1 file changed, 1 insertion(+)
policy/modules/system/setrans.te +1 -0
index 8e1e27d..48aefa2 100644
@@ -67,6 +67,7 @@ mls_socket_write_all_levels(setrans_t)
 mls_process_read_up(setrans_t)
 mls_socket_read_all_levels(setrans_t)
 
+selinux_getattr_fs(setrans_t)
 selinux_compute_access_vector(setrans_t)
 
 term_dontaudit_use_generic_ptys(setrans_t)
Signature · 1 line
1.8.3.1
#12 lore raw

PATCH 7/39 setrans: needs to be able to get attributes of selinuxfs, else fails to start in Debian

Quoted 10 lines · Dominick Grift
---
 policy/modules/system/setrans.te | 1 +
 1 file changed, 1 insertion(+)
policy/modules/system/setrans.te +0 -0
index 8e1e27d..48aefa2 100644

policy/modules/system/setrans.te mls_socket_write_all_levels(setrans_t) · line 73

Quoted 7 lines
policy/modules/system/setrans.te +1 -0
@@ -67,6 +67,7 @@ mls_socket_write_all_levels(setrans_t)
 mls_process_read_up(setrans_t)
 mls_socket_read_all_levels(setrans_t)
 
+selinux_getattr_fs(setrans_t)
 selinux_compute_access_vector(setrans_t)
 
 term_dontaudit_use_generic_ptys(setrans_t)

Instead of merging this, I replaced the seutil_read_config() with seutil_libselinux_linked(). It has the above access that you wanted to add.

Signature · 3 lines
Chris PeBenito
Tresys Technology, LLC
www.tresys.com | oss.tresys.com
#13 lore raw

PATCH 8/39 These { read write } tty_device_t chr files on boot up in Debian

In reply to Dominick Grift
---
 policy/modules/system/fstools.te    | 5 +++++
 policy/modules/system/hostname.te   | 4 ++++
 policy/modules/system/sysnetwork.te | 4 ++++
 3 files changed, 13 insertions(+)
policy/modules/system/fstools.te +5 -0
index 3f48d30..b40e06f 100644
@@ -149,6 +149,11 @@ seutil_read_config(fsadm_t)
 
 userdom_use_user_terminals(fsadm_t)
 
+ifdef(`distro_debian',`
+	term_dontaudit_use_unallocated_ttys(fsadm_t)
+')
+
+
 ifdef(`distro_redhat',`
 	optional_policy(`
 		unconfined_domain(fsadm_t)
policy/modules/system/hostname.te +4 -0
index 24a7889..d5d4a1c 100644
@@ -56,6 +56,10 @@ sysnet_dontaudit_rw_dhcpc_unix_stream_sockets(hostname_t)
 sysnet_read_config(hostname_t)
 sysnet_dns_name_resolve(hostname_t)
 
+ifdef(`distro_debian',`
+	term_dontaudit_use_unallocated_ttys(hostname_t)
+')
+
 optional_policy(`
 	nis_use_ypbind(hostname_t)
 ')
policy/modules/system/sysnetwork.te +4 -0
index a392fc4..999e142 100644
@@ -319,6 +319,10 @@ sysnet_dontaudit_rw_dhcpc_udp_sockets(ifconfig_t)
 userdom_use_user_terminals(ifconfig_t)
 userdom_use_all_users_fds(ifconfig_t)
 
+ifdef(`distro_debian',`
+	term_dontaudit_use_unallocated_ttys(ifconfig_t)
+')
+
 ifdef(`distro_ubuntu',`
 	optional_policy(`
 		unconfined_domain(ifconfig_t)
Signature · 1 line
1.8.3.1
#14 lore raw

PATCH 8/39 These { read write } tty_device_t chr files on boot up in Debian

Quoted 1 line · Dominick Grift

Merged, with a whitespace fix.

Quoted 53 lines
---
 policy/modules/system/fstools.te    | 5 +++++
 policy/modules/system/hostname.te   | 4 ++++
 policy/modules/system/sysnetwork.te | 4 ++++
 3 files changed, 13 insertions(+)
policy/modules/system/fstools.te +5 -0
index 3f48d30..b40e06f 100644
@@ -149,6 +149,11 @@ seutil_read_config(fsadm_t)
 
 userdom_use_user_terminals(fsadm_t)
 
+ifdef(`distro_debian',`
+	term_dontaudit_use_unallocated_ttys(fsadm_t)
+')
+
+
 ifdef(`distro_redhat',`
 	optional_policy(`
 		unconfined_domain(fsadm_t)
policy/modules/system/hostname.te +4 -0
index 24a7889..d5d4a1c 100644
@@ -56,6 +56,10 @@ sysnet_dontaudit_rw_dhcpc_unix_stream_sockets(hostname_t)
 sysnet_read_config(hostname_t)
 sysnet_dns_name_resolve(hostname_t)
 
+ifdef(`distro_debian',`
+	term_dontaudit_use_unallocated_ttys(hostname_t)
+')
+
 optional_policy(`
 	nis_use_ypbind(hostname_t)
 ')
policy/modules/system/sysnetwork.te +4 -0
index a392fc4..999e142 100644
@@ -319,6 +319,10 @@ sysnet_dontaudit_rw_dhcpc_udp_sockets(ifconfig_t)
 userdom_use_user_terminals(ifconfig_t)
 userdom_use_all_users_fds(ifconfig_t)
 
+ifdef(`distro_debian',`
+	term_dontaudit_use_unallocated_ttys(ifconfig_t)
+')
+
 ifdef(`distro_ubuntu',`
 	optional_policy(`
 		unconfined_domain(ifconfig_t)
Signature · 3 lines
Chris PeBenito
Tresys Technology, LLC
www.tresys.com | oss.tresys.com
#15 lore raw

PATCH 9/39 These are some of the device nodes created by kernel, and udev with the generic device_t type in debian.

In reply to Dominick Grift

These named file transitions make sure that these devices get created with the proper types

This list is probably far from comprehensive because i only added the ones i was able to confirm on my virtual machine

---
 policy/modules/kernel/corenetwork.if.in |  25 ++++++
 policy/modules/kernel/devices.if        | 146 +++++++++++++++++++++++++++++++-
 policy/modules/kernel/kernel.te         |  42 +++++++++
 policy/modules/kernel/terminal.if       |  50 +++++++++++
 policy/modules/system/udev.te           |   4 +
 5 files changed, 266 insertions(+), 1 deletion(-)
policy/modules/kernel/corenetwork.if.in +25 -0
index 07126bd..7158d4a 100644
@@ -1993,6 +1993,31 @@ interface(`corenet_rw_tun_tap_dev',`
 
 ########################################
 ## <summary>
+##	Create TUN/TAP virtual network devices
+##	in /dev with the tun tap type
+##	via an automatic type transition.
+## </summary>
+## <param name="domain">
+##	<summary>
+##	Domain allowed access.
+##	</summary>
+## </param>
+## <param name="filename" optional="true">
+##	<summary>
+##	The name of the object being created.
+##	</summary>
+## </param>
+#
+interface(`corenet_dev_filetrans_tun_tap',`
+	gen_require(`
+		type tun_tap_device_t;
+	')
+
+	dev_filetrans($1, tun_tap_device_t, chr_file, $2)
+')
+
+########################################
+## <summary>
 ##	Do not audit attempts to read or write the TUN/TAP
 ##	virtual network device.
 ## </summary>
policy/modules/kernel/devices.if +145 -1

188 lines not on this page · raw message

policy/modules/kernel/kernel.te +42 -0

48 lines not on this page · raw message

policy/modules/kernel/terminal.if +50 -0

59 lines not on this page · raw message

policy/modules/system/udev.te +4 -0
index 183e45d..47bfc33 100644
@@ -174,8 +174,12 @@ sysnet_etc_filetrans_config(udev_t)
 userdom_dontaudit_search_user_home_content(udev_t)
 
 ifdef(`distro_debian',`
+	corenet_dev_filetrans_tun_tap(udev_t, "tun")
+
 	files_pid_filetrans(udev_t, udev_var_run_t, dir, "xen-hotplug")
 
+	storage_dev_filetrans_fixed_disk(udev_t, "loop0")
+
 	optional_policy(`
 		# for /usr/lib/avahi/avahi-daemon-check-dns.sh
 		kernel_read_vm_sysctls(udev_t)
Signature · 1 line
1.8.3.1
#16 lore raw

PATCH 9/39 These are some of the device nodes created by kernel, and udev with the generic device_t type in debian.

I also experience this problem when I reconnect my mouse, so it isn't debian-specific. I'm not a SELinux expert, but this patch looks like a workaround to me, not like a real fix. It's also a bit limited: For
example, on my system, there are more event devices than event0 -
event5 (atm, the mouse in question is at event9).
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 836 bytes
Desc: not available
Url : http://oss.tresys.com/pipermail/refpolicy/attachments/20131110/b099aaa6/attachment.bin

#17 lore raw

PATCH 9/39 These are some of the device nodes created by kernel, and udev with the generic device_t type in debian.

Quoted 5 lines · Luis Ressel

I also experience this problem when I reconnect my mouse, so it isn't debian-specific. I'm not a SELinux expert, but this patch looks like a workaround to me, not like a real fix. It's also a bit limited: For example, on my system, there are more event devices than event0 - event5 (atm, the mouse in question is at event9).

I consider this to be a )possible) starting point

I do not think we should add named file type transitions for every conceivable object in /dev like i think Fedora does

Only the ones that are actually confirmed. but yes this should probably not be distro specific.

Consider this patch a [RFC]

#18 lore raw

PATCH 9/39 These are some of the device nodes created by kernel, and udev with the generic device_t type in debian.

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Quoted 12 lines · Dominick Grift
Quoted 5 lines · Luis Ressel

I also experience this problem when I reconnect my mouse, so it isn't debian-specific. I'm not a SELinux expert, but this patch looks like a workaround to me, not like a real fix. It's also a bit limited: For example, on my system, there are more event devices than event0 - event5 (atm, the mouse in question is at event9).

I consider this to be a )possible) starting point

I do not think we should add named file type transitions for every conceivable object in /dev like i think Fedora does

Quoted 9 lines

Only the ones that are actually confirmed. but yes this should probably not be distro specific.

Consider this patch a [RFC]

_______________________________________________ refpolicy mailing list refpolicy at oss.tresys.com http://oss.tresys.com/mailman/listinfo/refpolicy

The ones we have added in Fedora have been confirmed. We just round up to
the next 10 when they happen. We add them when we see bug reports for mislabeled devices.
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.15 (GNU/Linux)
Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/

iEYEARECAAYFAlKA5/UACgkQrlYvE4MpobMamgCgtKW39NzDr358RVqy+VqKD7yG /y4An0sAzsWITVqxZPMBaRL3Vhs/5nRb
=9UaC
-----END PGP SIGNATURE-----

#19 lore raw

PATCH 10/39 udev: udevd executable location changed

In reply to Dominick Grift
---
 policy/modules/system/udev.fc | 1 +
 1 file changed, 1 insertion(+)
policy/modules/system/udev.fc +1 -0
index 374ac00..dd1a887 100644
@@ -33,5 +33,6 @@ ifdef(`distro_redhat',`
 /var/run/udev(/.*)?	gen_context(system_u:object_r:udev_var_run_t,s0)
 
 ifdef(`distro_debian',`
+/lib/systemd/systemd-udevd	--	gen_context(system_u:object_r:udev_exec_t,s0)
 /var/run/xen-hotplug -d	gen_context(system_u:object_r:udev_var_run_t,s0)
 ')
Signature · 1 line
1.8.3.1
#20 lore raw

PATCH 10/39 udev: udevd executable location changed

Quoted 10 lines · Dominick Grift
---
 policy/modules/system/udev.fc | 1 +
 1 file changed, 1 insertion(+)
policy/modules/system/udev.fc +0 -0
index 374ac00..dd1a887 100644

policy/modules/system/udev.fc ifdef(`distro_redhat',` · line 38

Quoted 6 lines
policy/modules/system/udev.fc +1 -0
@@ -33,5 +33,6 @@ ifdef(`distro_redhat',`
 /var/run/udev(/.*)?	gen_context(system_u:object_r:udev_var_run_t,s0)
 
 ifdef(`distro_debian',`
+/lib/systemd/systemd-udevd	--	gen_context(system_u:object_r:udev_exec_t,s0)
 /var/run/xen-hotplug -d	gen_context(system_u:object_r:udev_var_run_t,s0)
 ')

Merged.

Signature · 3 lines
Chris PeBenito
Tresys Technology, LLC
www.tresys.com | oss.tresys.com
#21 lore raw

PATCH 11/39 udev: reads modules config: /etc/modprobe.d/alsa-base-blacklist.conf

In reply to Dominick Grift
---
 policy/modules/system/udev.te | 1 +
 1 file changed, 1 insertion(+)
policy/modules/system/udev.te +1 -0
index 47bfc33..f6ee5ae 100644
@@ -154,6 +154,7 @@ miscfiles_read_localization(udev_t)
 miscfiles_read_hwdata(udev_t)
 
 modutils_domtrans_insmod(udev_t)
+modutils_read_module_config(udev_t)
 # read modules.inputmap:
 modutils_read_module_deps(udev_t)
 
Signature · 1 line
1.8.3.1
#22 lore raw

PATCH 11/39 udev: reads modules config: /etc/modprobe.d/alsa-base-blacklist.conf

Quoted 10 lines · Dominick Grift
---
 policy/modules/system/udev.te | 1 +
 1 file changed, 1 insertion(+)
policy/modules/system/udev.te +0 -0
index 47bfc33..f6ee5ae 100644

policy/modules/system/udev.te miscfiles_read_localization(udev_t) · line 159

Quoted 6 lines
policy/modules/system/udev.te +1 -0
@@ -154,6 +154,7 @@ miscfiles_read_localization(udev_t)
 miscfiles_read_hwdata(udev_t)
 
 modutils_domtrans_insmod(udev_t)
+modutils_read_module_config(udev_t)
 # read modules.inputmap:
 modutils_read_module_deps(udev_t)

Merged.

Signature · 3 lines
Chris PeBenito
Tresys Technology, LLC
www.tresys.com | oss.tresys.com
#23 lore raw

PATCH 12/39 lvm: lvm writes read_ahead_kb

In reply to Dominick Grift
---
 policy/modules/system/lvm.te | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
policy/modules/system/lvm.te +1 -1
index 79048c4..d379ef3 100644
@@ -234,7 +234,7 @@ dev_manage_generic_symlinks(lvm_t)
 dev_relabel_generic_dev_dirs(lvm_t)
 dev_manage_generic_blk_files(lvm_t)
 # Read /sys/block. Device mapper metadata is kept there.
-dev_read_sysfs(lvm_t)
+dev_rw_sysfs(lvm_t)
 # cjp: this has no effect since LVM does not
 # have lnk_file relabelto for anything else.
 # perhaps this should be blk_files?
Signature · 1 line
1.8.3.1
#24 lore raw

PATCH 12/39 lvm: lvm writes read_ahead_kb

Quoted 10 lines · Dominick Grift
---
 policy/modules/system/lvm.te | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
policy/modules/system/lvm.te +0 -0
index 79048c4..d379ef3 100644

policy/modules/system/lvm.te dev_manage_generic_symlinks(lvm_t) · line 240

Quoted 8 lines
policy/modules/system/lvm.te +1 -1
@@ -234,7 +234,7 @@ dev_manage_generic_symlinks(lvm_t)
 dev_relabel_generic_dev_dirs(lvm_t)
 dev_manage_generic_blk_files(lvm_t)
 # Read /sys/block. Device mapper metadata is kept there.
-dev_read_sysfs(lvm_t)
+dev_rw_sysfs(lvm_t)
 # cjp: this has no effect since LVM does not
 # have lnk_file relabelto for anything else.
 # perhaps this should be blk_files?

Merged.

Signature · 3 lines
Chris PeBenito
Tresys Technology, LLC
www.tresys.com | oss.tresys.com
#25 lore raw

PATCH 13/39 usermanage: Run /etc/cron\.daily/cracklib-runtime in the crack_t domain in Debian

In reply to Dominick Grift
---
 policy/modules/admin/usermanage.fc | 4 ++++
 policy/modules/admin/usermanage.te | 3 +++
 2 files changed, 7 insertions(+)
policy/modules/admin/usermanage.fc +4 -0
index f82f0ce..4b7737e 100644
@@ -2,6 +2,10 @@ ifdef(`distro_gentoo',`
 /bin/passwd		--	gen_context(system_u:object_r:passwd_exec_t,s0)
 ')
 
+ifdef(`distro_debian',`
+/etc/cron\.daily/cracklib-runtime	--	gen_context(system_u:object_r:crack_exec_t,s0)
+')
+
 /usr/bin/chage		--	gen_context(system_u:object_r:passwd_exec_t,s0)
 /usr/bin/chfn		--	gen_context(system_u:object_r:chfn_exec_t,s0)
 /usr/bin/chsh		--	gen_context(system_u:object_r:chfn_exec_t,s0)
policy/modules/admin/usermanage.te +3 -0
index 1d732f1..471d4a7 100644
@@ -171,10 +171,13 @@ logging_send_syslog_msg(crack_t)
 userdom_dontaudit_search_user_home_dirs(crack_t)
 
 ifdef(`distro_debian',`
+	allow crack_t self:process getsched;
 	# the package cracklib-runtime on Debian contains a daily maintenance
 	# script /etc/cron.daily/cracklib-runtime, that calls
 	# update-cracklib and that calls crack_mkdict, which is a shell script.
 	corecmd_exec_shell(crack_t)
+	dev_search_sysfs(crack_t)
+	miscfiles_read_localization(crack_t)
 ')
 
 optional_policy(`
Signature · 1 line
1.8.3.1
#26 lore raw

PATCH 13/39 usermanage: Run /etc/cron\.daily/cracklib-runtime in the crack_t domain in Debian

Quoted 29 lines · Dominick Grift
---
 policy/modules/admin/usermanage.fc | 4 ++++
 policy/modules/admin/usermanage.te | 3 +++
 2 files changed, 7 insertions(+)
policy/modules/admin/usermanage.fc +4 -0
index f82f0ce..4b7737e 100644
@@ -2,6 +2,10 @@ ifdef(`distro_gentoo',`
 /bin/passwd		--	gen_context(system_u:object_r:passwd_exec_t,s0)
 ')
 
+ifdef(`distro_debian',`
+/etc/cron\.daily/cracklib-runtime	--	gen_context(system_u:object_r:crack_exec_t,s0)
+')
+
 /usr/bin/chage		--	gen_context(system_u:object_r:passwd_exec_t,s0)
 /usr/bin/chfn		--	gen_context(system_u:object_r:chfn_exec_t,s0)
 /usr/bin/chsh		--	gen_context(system_u:object_r:chfn_exec_t,s0)
policy/modules/admin/usermanage.te +0 -0
index 1d732f1..471d4a7 100644
@@ -171,10 +171,13 @@ logging_send_syslog_msg(crack_t)
 userdom_dontaudit_search_user_home_dirs(crack_t)
 
 ifdef(`distro_debian',`

policy/modules/admin/usermanage.te logging_send_syslog_msg(crack_t) · line 183

Quoted 10 lines
policy/modules/admin/usermanage.te +3 -0
+	allow crack_t self:process getsched;
 	# the package cracklib-runtime on Debian contains a daily maintenance
 	# script /etc/cron.daily/cracklib-runtime, that calls
 	# update-cracklib and that calls crack_mkdict, which is a shell script.
 	corecmd_exec_shell(crack_t)
+	dev_search_sysfs(crack_t)
+	miscfiles_read_localization(crack_t)
 ')
 
 optional_policy(`

Merged.

Signature · 3 lines
Chris PeBenito
Tresys Technology, LLC
www.tresys.com | oss.tresys.com
#27 lore raw

PATCH 14/39 fstools: hdparm append (what seems inherited from devicekit ) /var/log/pm-powersave.log fstools: hdparm reads /run/pm-utils/locks/pm-powersave.lock

In reply to Dominick Grift
---
 policy/modules/system/fstools.te | 5 +++++
 1 file changed, 5 insertions(+)
policy/modules/system/fstools.te +5 -0
index b40e06f..6f9fde9 100644
@@ -171,6 +171,11 @@ optional_policy(`
 ')
 
 optional_policy(`
+	devicekit_read_pid_files(fsadm_t)
+	devicekit_append_inherited_log_files(fsadm_t)
+')
+
+optional_policy(`
 	hal_dontaudit_write_log(fsadm_t)
 ')
 
Signature · 1 line
1.8.3.1
#28 lore raw

PATCH 14/39 fstools: hdparm append (what seems inherited from devicekit ) /var/log/pm-powersave.log fstools: hdparm reads /run/pm-utils/locks/pm-powersave.lock

Quoted 10 lines · Dominick Grift
---
 policy/modules/system/fstools.te | 5 +++++
 1 file changed, 5 insertions(+)
policy/modules/system/fstools.te +0 -0
index b40e06f..6f9fde9 100644

policy/modules/system/fstools.te optional_policy(` · line 180

Quoted 10 lines
policy/modules/system/fstools.te +5 -0
@@ -171,6 +171,11 @@ optional_policy(`
 ')
 
 optional_policy(`
+	devicekit_read_pid_files(fsadm_t)
+	devicekit_append_inherited_log_files(fsadm_t)
+')
+
+optional_policy(`
 	hal_dontaudit_write_log(fsadm_t)
 ')

Merged.

Signature · 3 lines
Chris PeBenito
Tresys Technology, LLC
www.tresys.com | oss.tresys.com
#29 lore raw

PATCH 15/39 sysnetwork: dhcpc: networkmanager interface calls from Fedora. In Debian i was able to confirm the need for networkmanager_manage_lib_files(dhcpc_t) since dhclient reads /var/lib/NetworkManager/dhclient-eth0.conf

In reply to Dominick Grift
---
 policy/modules/system/sysnetwork.te | 7 +++++++
 1 file changed, 7 insertions(+)
policy/modules/system/sysnetwork.te +7 -0
index 999e142..a2b9820 100644
@@ -201,6 +201,13 @@ optional_policy(`
 ')
 
 optional_policy(`
+	networkmanager_domtrans(dhcpc_t)
+	networkmanager_read_pid_files(dhcpc_t)
+	networkmanager_manage_lib_files(dhcpc_t)
+	networkmanager_stream_connect(dhcpc_t)
+')
+
+optional_policy(`
 	nis_read_ypbind_pid(dhcpc_t)
 ')
 
Signature · 1 line
1.8.3.1
#30 lore raw

PATCH 15/39 sysnetwork: dhcpc: networkmanager interface calls from Fedora. In Debian i was able to confirm the need for networkmanager_manage_lib_files(dhcpc_t) since dhclient reads /var/lib/NetworkManager/dhclient-eth0.conf

Quoted 12 lines · Dominick Grift
---
 policy/modules/system/sysnetwork.te | 7 +++++++
 1 file changed, 7 insertions(+)
policy/modules/system/sysnetwork.te +0 -0
index 999e142..a2b9820 100644
@@ -201,6 +201,13 @@ optional_policy(`
 ')
 

policy/modules/system/sysnetwork.te optional_policy(` · line 212

Quoted 10 lines
policy/modules/system/sysnetwork.te +7 -0
 optional_policy(`
+	networkmanager_domtrans(dhcpc_t)
+	networkmanager_read_pid_files(dhcpc_t)
+	networkmanager_manage_lib_files(dhcpc_t)
+	networkmanager_stream_connect(dhcpc_t)
+')
+
+optional_policy(`
 	nis_read_ypbind_pid(dhcpc_t)
 ')

Merged.

Signature · 3 lines
Chris PeBenito
Tresys Technology, LLC
www.tresys.com | oss.tresys.com
#31 lore raw

PATCH 16/39 iptables: calls to firewalld interfaces from Fedora. The firewalld_dontaudit_rw_tmp_files(iptables_t) was confirmed on Debian.

In reply to Dominick Grift
---
 policy/modules/system/iptables.te | 6 ++++++
 1 file changed, 6 insertions(+)
policy/modules/system/iptables.te +6 -0
index be8ed1e..63eb287 100644
@@ -49,6 +49,7 @@ allow iptables_t iptables_tmp_t:dir manage_dir_perms;
 allow iptables_t iptables_tmp_t:file manage_file_perms;
 files_tmp_filetrans(iptables_t, iptables_tmp_t, { file dir })
 
+kernel_getattr_proc(iptables_t)
 kernel_request_load_module(iptables_t)
 kernel_read_system_state(iptables_t)
 kernel_read_network_state(iptables_t)
@@ -105,6 +106,11 @@ optional_policy(`
 ')
 
 optional_policy(`
+	firewalld_read_config_files(iptables_t)
+	firewalld_dontaudit_rw_tmp_files(iptables_t)
+')
+
+optional_policy(`
 	firstboot_use_fds(iptables_t)
 	firstboot_rw_pipes(iptables_t)
 ')
Signature · 1 line
1.8.3.1
#32 lore raw

PATCH 16/39 iptables: calls to firewalld interfaces from Fedora. The firewalld_dontaudit_rw_tmp_files(iptables_t) was confirmed on Debian.

Quoted 19 lines · Dominick Grift
---
 policy/modules/system/iptables.te | 6 ++++++
 1 file changed, 6 insertions(+)
policy/modules/system/iptables.te +1 -0
index be8ed1e..63eb287 100644
@@ -49,6 +49,7 @@ allow iptables_t iptables_tmp_t:dir manage_dir_perms;
 allow iptables_t iptables_tmp_t:file manage_file_perms;
 files_tmp_filetrans(iptables_t, iptables_tmp_t, { file dir })
 
+kernel_getattr_proc(iptables_t)
 kernel_request_load_module(iptables_t)
 kernel_read_system_state(iptables_t)
 kernel_read_network_state(iptables_t)
@@ -105,6 +106,11 @@ optional_policy(`
 ')

policy/modules/system/iptables.te optional_policy(` · line 116

Quoted 10 lines
policy/modules/system/iptables.te +5 -0
 
 optional_policy(`
+	firewalld_read_config_files(iptables_t)
+	firewalld_dontaudit_rw_tmp_files(iptables_t)
+')
+
+optional_policy(`
 	firstboot_use_fds(iptables_t)
 	firstboot_rw_pipes(iptables_t)
 ')

Merged.

Signature · 3 lines
Chris PeBenito
Tresys Technology, LLC
www.tresys.com | oss.tresys.com
#33 lore raw

PATCH 17/39 init: This should make transitions to init_script_domains() work for direct_sysadm_daemon

In reply to Dominick Grift
---
 policy/modules/system/init.if | 13 ++++++++++++-
 1 file changed, 12 insertions(+), 1 deletion(-)
policy/modules/system/init.if +12 -1
index 79a45f6..bc49474 100644
@@ -67,7 +67,8 @@ interface(`init_script_file',`
 interface(`init_script_domain',`
 	gen_require(`
 		attribute init_script_domain_type, init_script_file_type;
-		attribute init_run_all_scripts_domain;
+		attribute init_run_all_scripts_domain, direct_init, direct_init_entry;
+		attribute direct_run_init;
 	')
 
 	typeattribute $1 init_script_domain_type;
@@ -77,6 +78,16 @@ interface(`init_script_domain',`
 	domain_entry_file($1, $2)
 
 	domtrans_pattern(init_run_all_scripts_domain, $2, $1)
+
+	ifdef(`direct_sysadm_daemon',`
+		domtrans_pattern(direct_run_init, $2, $1)
+		allow direct_run_init $1:process { noatsecure siginh rlimitinh };
+
+		typeattribute $1 direct_init;
+		typeattribute $2 direct_init_entry;
+
+		userdom_dontaudit_use_user_terminals($1)
+	')
 ')
 
 ########################################
Signature · 1 line
1.8.3.1
#34 lore raw

PATCH 18/39 unconfined: make direct_sysadm_daemon apply to unconfined_r:unconfined_t as well

In reply to Dominick Grift
---
 policy/modules/system/unconfined.te | 14 +++++++++++---
 1 file changed, 11 insertions(+), 3 deletions(-)
policy/modules/system/unconfined.te +11 -3
index 5fe902d..28a2188 100644
@@ -49,9 +49,17 @@ unconfined_domain(unconfined_t)
 
 userdom_user_home_dir_filetrans_user_home_content(unconfined_t, { dir file lnk_file fifo_file sock_file })
 
-ifdef(`distro_gentoo',`
-	seutil_run_runinit(unconfined_t, unconfined_r)
-	seutil_init_script_run_runinit(unconfined_t, unconfined_r)
+ifdef(`direct_sysadm_daemon',`
+	optional_policy(`
+		init_run_daemon(unconfined_t, unconfined_r)
+	')
+',`
+	ifdef(`distro_gentoo',`
+		optional_policy(`
+			seutil_run_runinit(unconfined_t, unconfined_r)
+			seutil_init_script_run_runinit(unconfined_t, unconfined_r)
+		')
+	')
 ')
 
 optional_policy(`
Signature · 1 line
1.8.3.1
#35 lore raw

PATCH 18/39 unconfined: make direct_sysadm_daemon apply to unconfined_r:unconfined_t as well

Quoted 18 lines · Dominick Grift
---
 policy/modules/system/unconfined.te | 14 +++++++++++---
 1 file changed, 11 insertions(+), 3 deletions(-)
policy/modules/system/unconfined.te +2 -3
index 5fe902d..28a2188 100644
@@ -49,9 +49,17 @@ unconfined_domain(unconfined_t)
 
 userdom_user_home_dir_filetrans_user_home_content(unconfined_t, { dir file lnk_file fifo_file sock_file })
 
-ifdef(`distro_gentoo',`
-	seutil_run_runinit(unconfined_t, unconfined_r)
-	seutil_init_script_run_runinit(unconfined_t, unconfined_r)
+ifdef(`direct_sysadm_daemon',`
+	optional_policy(`

policy/modules/system/unconfined.te unconfined_domain(unconfined_t) · line 63

Quoted 10 lines
policy/modules/system/unconfined.te +9 -0
+		init_run_daemon(unconfined_t, unconfined_r)
+	')
+',`
+	ifdef(`distro_gentoo',`
+		optional_policy(`
+			seutil_run_runinit(unconfined_t, unconfined_r)
+			seutil_init_script_run_runinit(unconfined_t, unconfined_r)
+		')
+	')
 ')

I get an error:

/usr/bin/checkpolicy: loading policy configuration from policy.conf
policy/modules/system/unconfined.te":52:ERROR 'duplicate role transition for (unconfined_r,NetworkManager_exec_t,process)' at token ';' on line 2433460:
#line 52

	role_transition unconfined_r direct_init_entry system_r;

checkpolicy: error(s) encountered while parsing configuration
make: *** [policy.29] Error 1

Signature · 3 lines
Chris PeBenito
Tresys Technology, LLC
www.tresys.com | oss.tresys.com
#36 lore raw

PATCH 18/39 unconfined: make direct_sysadm_daemon apply to unconfined_r:unconfined_t as well

Quoted 10 lines · Christopher J. PeBenito

I get an error:

/usr/bin/checkpolicy: loading policy configuration from policy.conf
policy/modules/system/unconfined.te":52:ERROR 'duplicate role transition for (unconfined_r,NetworkManager_exec_t,process)' at token ';' on line 2433460:
#line 52

	role_transition unconfined_r direct_init_entry system_r;

checkpolicy: error(s) encountered while parsing configuration
make: *** [policy.29] Error 1

Monolithic i assume. Because i did not see this in modular builts.

This can probably be easily fixed though

What is more important to me right now is to know that you are not opposed to the idea of making direct_sysadm_daemon apply to unconfined_t in general.

I am sorry though about all these built errors i should have tested it more thoroughly...

#37 lore raw

PATCH 19/39 users: associate the system_r role to unconfined_u identity conditionally ( direct_sysadm_daemon )

In reply to Dominick Grift
---
 policy/users | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)
policy/users +5 -1
index c4ebc7e..5db8cf4 100644
@@ -29,7 +29,11 @@ gen_user(staff_u, staff, staff_r sysadm_r ifdef(`enable_mls',`secadm_r auditadm_
 gen_user(sysadm_u, sysadm, sysadm_r, s0, s0 - mls_systemhigh, mcs_allcats)
 
 # Until order dependence is fixed for users:
-gen_user(unconfined_u, unconfined, unconfined_r, s0, s0 - mls_systemhigh, mcs_allcats)
+ifdef(`direct_sysadm_daemon',`
+	gen_user(unconfined_u, unconfined, unconfined_r system_r, s0, s0 - mls_systemhigh, mcs_allcats)
+',`
+	gen_user(unconfined_u, unconfined, unconfined_r, s0, s0 - mls_systemhigh, mcs_allcats)
+')
 
 #
 # The following users correspond to Unix identities.
Signature · 1 line
1.8.3.1
#38 lore raw

PATCH 19/39 users: associate the system_r role to unconfined_u identity conditionally ( direct_sysadm_daemon )

Quoted 12 lines · Dominick Grift
---
 policy/users | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)
policy/users +0 -0
index c4ebc7e..5db8cf4 100644
@@ -29,7 +29,11 @@ gen_user(staff_u, staff, staff_r sysadm_r ifdef(`enable_mls',`secadm_r auditadm_
 gen_user(sysadm_u, sysadm, sysadm_r, s0, s0 - mls_systemhigh, mcs_allcats)
 

policy/users gen_user(staff_u, staff, staff_r sysadm_r ifdef(`enable_mls',`secadm_r auditadm_ · line 39

Quoted 10 lines
policy/users +5 -1
 # Until order dependence is fixed for users:
-gen_user(unconfined_u, unconfined, unconfined_r, s0, s0 - mls_systemhigh, mcs_allcats)
+ifdef(`direct_sysadm_daemon',`
+	gen_user(unconfined_u, unconfined, unconfined_r system_r, s0, s0 - mls_systemhigh, mcs_allcats)
+',`
+	gen_user(unconfined_u, unconfined, unconfined_r, s0, s0 - mls_systemhigh, mcs_allcats)
+')
 
 #
 # The following users correspond to Unix identities.

Skipping this for now since the corresponding other change in unconfined has that transition conflict.

Signature · 3 lines
Chris PeBenito
Tresys Technology, LLC
www.tresys.com | oss.tresys.com
#39 lore raw

PATCH 20/39 init: for a specified automatic role transition to work. the source role must be allowed to change manually to the target role

In reply to Dominick Grift
---
 policy/modules/system/init.if | 2 ++
 1 file changed, 2 insertions(+)
policy/modules/system/init.if +2 -0
index bc49474..9bce838 100644
@@ -998,6 +998,8 @@ interface(`init_run_daemon',`
 	')
 
 	typeattribute $1 direct_run_init;
+
+	allow $2 system_r;
 	role_transition $2 direct_init_entry system_r;
 ')
 
Signature · 1 line
1.8.3.1
#40 lore raw

PATCH 20/39 init: for a specified automatic role transition to work. the source role must be allowed to change manually to the target role

Quoted 10 lines · Dominick Grift
---
 policy/modules/system/init.if | 2 ++
 1 file changed, 2 insertions(+)
policy/modules/system/init.if +0 -0
index bc49474..9bce838 100644

policy/modules/system/init.if interface(`init_run_daemon',` · line 1004

Quoted 7 lines
policy/modules/system/init.if +2 -0
@@ -998,6 +998,8 @@ interface(`init_run_daemon',`
 	')
 
 	typeattribute $1 direct_run_init;
+
+	allow $2 system_r;
 	role_transition $2 direct_init_entry system_r;
 ')

Merged.

Signature · 3 lines
Chris PeBenito
Tresys Technology, LLC
www.tresys.com | oss.tresys.com
#41 lore raw

PATCH 21/39 init: init_script_domain() allow system_r role the init script domain type

In reply to Dominick Grift
---
 policy/modules/system/init.if | 2 ++
 1 file changed, 2 insertions(+)
policy/modules/system/init.if +2 -0
index 9bce838..dc9f92b 100644
@@ -77,6 +77,8 @@ interface(`init_script_domain',`
 	domain_type($1)
 	domain_entry_file($1, $2)
 
+	role system_r types $1;
+
 	domtrans_pattern(init_run_all_scripts_domain, $2, $1)
 
 	ifdef(`direct_sysadm_daemon',`
Signature · 1 line
1.8.3.1
#42 lore raw

PATCH 21/39 init: init_script_domain() allow system_r role the init script domain type

Quoted 10 lines · Dominick Grift
---
 policy/modules/system/init.if | 2 ++
 1 file changed, 2 insertions(+)
policy/modules/system/init.if +0 -0
index 9bce838..dc9f92b 100644

policy/modules/system/init.if interface(`init_script_domain',` · line 84

Quoted 8 lines
policy/modules/system/init.if +2 -0
@@ -77,6 +77,8 @@ interface(`init_script_domain',`
 	domain_type($1)
 	domain_entry_file($1, $2)
 
+	role system_r types $1;
+
 	domtrans_pattern(init_run_all_scripts_domain, $2, $1)
 
 	ifdef(`direct_sysadm_daemon',`

This failed to apply for me; it's been manually applied.

Signature · 3 lines
Chris PeBenito
Tresys Technology, LLC
www.tresys.com | oss.tresys.com
#43 lore raw

PATCH 22/39 sysbnetwork: dhclient searches /var/lib/ntp

In reply to Dominick Grift
---
 policy/modules/system/sysnetwork.te | 1 +
 1 file changed, 1 insertion(+)
policy/modules/system/sysnetwork.te +1 -0
index a2b9820..5857838 100644
@@ -219,6 +219,7 @@ optional_policy(`
 
 optional_policy(`
 	ntp_initrc_domtrans(dhcpc_t)
+	ntp_read_drift_files(dhcpc_t)
 ')
 
 optional_policy(`
Signature · 1 line
1.8.3.1
#44 lore raw

PATCH 22/39 sysbnetwork: dhclient searches /var/lib/ntp

Quoted 10 lines · Dominick Grift
---
 policy/modules/system/sysnetwork.te | 1 +
 1 file changed, 1 insertion(+)
policy/modules/system/sysnetwork.te +0 -0
index a2b9820..5857838 100644

policy/modules/system/sysnetwork.te optional_policy(` · line 225

Quoted 7 lines
policy/modules/system/sysnetwork.te +1 -0
@@ -219,6 +219,7 @@ optional_policy(`
 
 optional_policy(`
 	ntp_initrc_domtrans(dhcpc_t)
+	ntp_read_drift_files(dhcpc_t)
 ')
 
 optional_policy(`

Merged.

Signature · 3 lines
Chris PeBenito
Tresys Technology, LLC
www.tresys.com | oss.tresys.com
#45 lore raw

PATCH 23/39 Initial local_home_t implementation

In reply to Dominick Grift

This was discussed on the maillist. It was decided to make this part of the user domain since Python also uses local_home_t

This is part of implementation of X Desktop Group specification support

---
 policy/modules/system/userdomain.fc |   1 +
 policy/modules/system/userdomain.if | 190 ++++++++++++++++++++++++++++++++----
 policy/modules/system/userdomain.te |   3 +
 3 files changed, 175 insertions(+), 19 deletions(-)
policy/modules/system/userdomain.fc +1 -0
index db75976..ec5c90a 100644
@@ -1,4 +1,5 @@
 HOME_DIR	-d	gen_context(system_u:object_r:user_home_dir_t,s0-mls_systemhigh)
 HOME_DIR/.+		gen_context(system_u:object_r:user_home_t,s0)
+HOME_DIR/\.local(/.*)?	gen_context(system_u:object_r:local_home_t,s0)
 
 /tmp/gconfd-USER -d	gen_context(system_u:object_r:user_tmp_t,s0)
policy/modules/system/userdomain.if +171 -19

221 lines not on this page · raw message

policy/modules/system/userdomain.te +3 -0
index f4ac38d..d657ea7 100644
@@ -58,6 +58,9 @@ attribute unpriv_userdomain;
 
 attribute user_home_content_type;
 
+type local_home_t;
+userdom_user_home_content(local_home_t)
+
 type user_home_dir_t alias { staff_home_dir_t sysadm_home_dir_t secadm_home_dir_t auditadm_home_dir_t unconfined_home_dir_t };
 fs_associate_tmpfs(user_home_dir_t)
 files_type(user_home_dir_t)
Signature · 1 line
1.8.3.1
#46 lore raw

PATCH 24/39 This should probably eventually end up with xdm_home_t type like Fedora, but the file is currently created with xauth_home_t type so i just added a file context spec for that for failover

In reply to Dominick Grift
---
 policy/modules/services/xserver.fc | 1 +
 1 file changed, 1 insertion(+)
policy/modules/services/xserver.fc +1 -0
index 8274418..c74ba1f 100644
@@ -9,6 +9,7 @@ HOME_DIR/\.ICEauthority.* --	gen_context(system_u:object_r:iceauth_home_t,s0)
 HOME_DIR/\.serverauth.*	--	gen_context(system_u:object_r:xauth_home_t,s0)
 HOME_DIR/\.xauth.*	--	gen_context(system_u:object_r:xauth_home_t,s0)
 HOME_DIR/\.Xauthority.*	--	gen_context(system_u:object_r:xauth_home_t,s0)
+HOME_DIR/\.xsession-errors.*	--	gen_context(system_u:object_r:xauth_home_t,s0)
 
 #
 # /dev
Signature · 1 line
1.8.3.1
#47 lore raw

PATCH 24/39 This should probably eventually end up with xdm_home_t type like Fedora, but the file is currently created with xauth_home_t type so i just added a file context spec for that for failover

Quoted 10 lines · Dominick Grift
---
 policy/modules/services/xserver.fc | 1 +
 1 file changed, 1 insertion(+)
policy/modules/services/xserver.fc +0 -0
index 8274418..c74ba1f 100644

policy/modules/services/xserver.fc HOME_DIR/\.ICEauthority.* -- gen_context(system_u:object_r:iceauth_home_t,s0) · line 14

Quoted 6 lines
policy/modules/services/xserver.fc +1 -0
@@ -9,6 +9,7 @@ HOME_DIR/\.ICEauthority.* --	gen_context(system_u:object_r:iceauth_home_t,s0)
 HOME_DIR/\.serverauth.*	--	gen_context(system_u:object_r:xauth_home_t,s0)
 HOME_DIR/\.xauth.*	--	gen_context(system_u:object_r:xauth_home_t,s0)
 HOME_DIR/\.Xauthority.*	--	gen_context(system_u:object_r:xauth_home_t,s0)
+HOME_DIR/\.xsession-errors.*	--	gen_context(system_u:object_r:xauth_home_t,s0)
 
 #

Does xauth create this log? If xdm does, then it makes more sense to have an xdm derived type. Otherwise I don't see why this shouldn't be user_home_t.

Signature · 3 lines
Chris PeBenito
Tresys Technology, LLC
www.tresys.com | oss.tresys.com
#48 lore raw

PATCH 24/39 This should probably eventually end up with xdm_home_t type like Fedora, but the file is currently created with xauth_home_t type so i just added a file context spec for that for failover

Quoted 16 lines · Christopher J. PeBenito
Quoted 15 lines · Dominick Grift
---
 policy/modules/services/xserver.fc | 1 +
 1 file changed, 1 insertion(+)
policy/modules/services/xserver.fc +1 -0
index 8274418..c74ba1f 100644
@@ -9,6 +9,7 @@ HOME_DIR/\.ICEauthority.* --	gen_context(system_u:object_r:iceauth_home_t,s0)
 HOME_DIR/\.serverauth.*	--	gen_context(system_u:object_r:xauth_home_t,s0)
 HOME_DIR/\.xauth.*	--	gen_context(system_u:object_r:xauth_home_t,s0)
 HOME_DIR/\.Xauthority.*	--	gen_context(system_u:object_r:xauth_home_t,s0)
+HOME_DIR/\.xsession-errors.*	--	gen_context(system_u:object_r:xauth_home_t,s0)
 
Quoted 4 lines

policy/modules/services/xserver.fc HOME_DIR/\.ICEauthority.* -- gen_context(system_u:object_r:iceauth_home_t,s0) · line 14

Quoted 1 line
policy/modules/services/xserver.fc +0 -0
 #

Does xauth create this log? If xdm does, then it makes more sense to have an xdm derived type. Otherwise I don't see why this shouldn't be user_home_t.

I can't tell, both xdm_t as well as xauth_t are currently allowed to create files in user home directories with the xauth_home_t type

Does it make sense for a efficiency/security standpoint to create new type for this?

Anyways if you want a new type for this then drop this patch for now

#49 lore raw

PATCH 24/39 This should probably eventually end up with xdm_home_t type like Fedora, but the file is currently created with xauth_home_t type so i just added a file context spec for that for failover

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Quoted 29 lines · Dominick Grift
Quoted 18 lines · Christopher J. PeBenito
Quoted 17 lines · Dominick Grift

policy/modules/services/xserver.fc | 1 + 1 file changed, 1 insertion(+)

(quoted diff) +0 -0

b/policy/modules/services/xserver.fc index 8274418..c74ba1f 100644 --- a/policy/modules/services/xserver.fc +++ b/policy/modules/services/xserver.fc @@ -9,6 +9,7 @@ HOME_DIR/\.ICEauthority.* -- gen_context(system_u:object_r:iceauth_home_t,s0)
HOME_DIR/\.serverauth.* --
gen_context(system_u:object_r:xauth_home_t,s0) HOME_DIR/\.xauth.* --
gen_context(system_u:object_r:xauth_home_t,s0) HOME_DIR/\.Xauthority.*
-- gen_context(system_u:object_r:xauth_home_t,s0)
+HOME_DIR/\.xsession-errors.* --
gen_context(system_u:object_r:xauth_home_t,s0)

Quoted 6 lines
Quoted 1 line

#

Does xauth create this log? If xdm does, then it makes more sense to have an xdm derived type. Otherwise I don't see why this shouldn't be user_home_t.

I can't tell, both xdm_t as well as xauth_t are currently allowed to create files in user home directories with the xauth_home_t type

Quoted 8 lines

Does it make sense for a efficiency/security standpoint to create new type for this?

Anyways if you want a new type for this then drop this patch for now

_______________________________________________ refpolicy mailing list refpolicy at oss.tresys.com http://oss.tresys.com/mailman/listinfo/refpolicy

In fedora we have xdm_home_t.

matchpathcon ~/.xsession-errors
/home/dwalsh/.xsession-errors staff_u:object_r:xdm_home_t:s0

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.15 (GNU/Linux)
Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/

iEYEARECAAYFAlKh2EQACgkQrlYvE4MpobOFPgCggrH02jfz/XJD+/EGifWNQqgX 5AIAnRDmx9AEzxw2glJ7lU+rrvTQZrAZ
=iKvZ
-----END PGP SIGNATURE-----

#50 lore raw

PATCH 24/39 This should probably eventually end up with xdm_home_t type like Fedora, but the file is currently created with xauth_home_t type so i just added a file context spec for that for failover

Quoted 6 lines · Daniel J Walsh

In fedora we have xdm_home_t.

matchpathcon ~/.xsession-errors
/home/dwalsh/.xsession-errors staff_u:object_r:xdm_home_t:s0

Thanks, yes i know, the question i have is, is it worth it to create a private type for this.

#51 lore raw

PATCH 24/39 This should probably eventually end up with xdm_home_t type like Fedora, but the file is currently created with xauth_home_t type so i just added a file context spec for that for failover

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Quoted 4 lines · Dominick Grift
Quoted 2 lines · Daniel J Walsh

In fedora we have xdm_home_t.

Quoted 9 lines
Quoted 4 lines

matchpathcon ~/.xsession-errors /home/dwalsh/.xsession-errors staff_u:object_r:xdm_home_t:s0

Thanks, yes i know, the question i have is, is it worth it to create a private type for this.

Maybe not. At least gdm and kdm no longer create this content, I think they are writing it to journald now.

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.15 (GNU/Linux)
Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/

iEYEARECAAYFAlKh7tAACgkQrlYvE4MpobN3SwCfe7IPBQlzPwdRLtwLCj6SrF8f ABcAoOLZcLFBCR8C9XuyiRPZGbD8EMHK
=f6kz
-----END PGP SIGNATURE-----

#52 lore raw

PATCH 25/39 users: move the unconfined_u user statement to the unconfined module (if possible) so that it will be removed if the unconfined module is disabled, or removed

In reply to Dominick Grift
---
 policy/modules/system/unconfined.te | 6 ++++++
 policy/users                        | 7 -------
 2 files changed, 6 insertions(+), 7 deletions(-)
policy/modules/system/unconfined.te +6 -0
index 28a2188..4e4a4c5 100644
@@ -213,3 +213,9 @@ unconfined_domain_noaudit(unconfined_execmem_t)
 optional_policy(`
 	unconfined_dbus_chat(unconfined_execmem_t)
 ')
+
+ifdef(`direct_sysadm_daemon',`
+	gen_user(unconfined_u, unconfined, unconfined_r system_r, s0, s0 - mls_systemhigh, mcs_allcats)
+',`
+	gen_user(unconfined_u, unconfined, unconfined_r, s0, s0 - mls_systemhigh, mcs_allcats)
+')
policy/users +0 -7
index 5db8cf4..25402af 100644
@@ -28,13 +28,6 @@ gen_user(user_u, user, user_r, s0, s0)
 gen_user(staff_u, staff, staff_r sysadm_r ifdef(`enable_mls',`secadm_r auditadm_r'), s0, s0 - mls_systemhigh, mcs_allcats)
 gen_user(sysadm_u, sysadm, sysadm_r, s0, s0 - mls_systemhigh, mcs_allcats)
 
-# Until order dependence is fixed for users:
-ifdef(`direct_sysadm_daemon',`
-	gen_user(unconfined_u, unconfined, unconfined_r system_r, s0, s0 - mls_systemhigh, mcs_allcats)
-',`
-	gen_user(unconfined_u, unconfined, unconfined_r, s0, s0 - mls_systemhigh, mcs_allcats)
-')
-
 #
 # The following users correspond to Unix identities.
 # These identities are typically assigned as the user attribute
Signature · 1 line
1.8.3.1
#53 lore raw

PATCH 25/39 users: move the unconfined_u user statement to the unconfined module (if possible) so that it will be removed if the unconfined module is disabled, or removed

Quoted 28 lines · Dominick Grift
---
 policy/modules/system/unconfined.te | 6 ++++++
 policy/users                        | 7 -------
 2 files changed, 6 insertions(+), 7 deletions(-)
policy/modules/system/unconfined.te +6 -0
index 28a2188..4e4a4c5 100644
@@ -213,3 +213,9 @@ unconfined_domain_noaudit(unconfined_execmem_t)
 optional_policy(`
 	unconfined_dbus_chat(unconfined_execmem_t)
 ')
+
+ifdef(`direct_sysadm_daemon',`
+	gen_user(unconfined_u, unconfined, unconfined_r system_r, s0, s0 - mls_systemhigh, mcs_allcats)
+',`
+	gen_user(unconfined_u, unconfined, unconfined_r, s0, s0 - mls_systemhigh, mcs_allcats)
+')
policy/users +0 -0
index 5db8cf4..25402af 100644
@@ -28,13 +28,6 @@ gen_user(user_u, user, user_r, s0, s0)
 gen_user(staff_u, staff, staff_r sysadm_r ifdef(`enable_mls',`secadm_r auditadm_r'), s0, s0 - mls_systemhigh, mcs_allcats)
 gen_user(sysadm_u, sysadm, sysadm_r, s0, s0 - mls_systemhigh, mcs_allcats)
 

policy/users gen_user(user_u, user, user_r, s0, s0) · line 33

Quoted 10 lines
policy/users +0 -7
-# Until order dependence is fixed for users:
-ifdef(`direct_sysadm_daemon',`
-	gen_user(unconfined_u, unconfined, unconfined_r system_r, s0, s0 - mls_systemhigh, mcs_allcats)
-',`
-	gen_user(unconfined_u, unconfined, unconfined_r, s0, s0 - mls_systemhigh, mcs_allcats)
-')
-
 #
 # The following users correspond to Unix identities.
 # These identities are typically assigned as the user attribute

I believe this will break monolithic build, otherwise I would have done it a long time ago. It would take a little work to implement user line moving in the build system to get this into the right place in policy.conf that checkpolicy expects.

Alternatively, if semodule_expand was enhanced to output all of the files in the expanded policy, we could simplify refpolicy by doing a monolithic build by doing a modular build and then linking/expanding it locally. Then we'd get around the more painful ordering requirements of checkpolicy.

Signature · 3 lines
Chris PeBenito
Tresys Technology, LLC
www.tresys.com | oss.tresys.com
#54 lore raw

PATCH 25/39 users: move the unconfined_u user statement to the unconfined module (if possible) so that it will be removed if the unconfined module is disabled, or removed

Quoted 42 lines · Christopher J. PeBenito
Quoted 28 lines · Dominick Grift
---
 policy/modules/system/unconfined.te | 6 ++++++
 policy/users                        | 7 -------
 2 files changed, 6 insertions(+), 7 deletions(-)
policy/modules/system/unconfined.te +6 -0
index 28a2188..4e4a4c5 100644
@@ -213,3 +213,9 @@ unconfined_domain_noaudit(unconfined_execmem_t)
 optional_policy(`
 	unconfined_dbus_chat(unconfined_execmem_t)
 ')
+
+ifdef(`direct_sysadm_daemon',`
+	gen_user(unconfined_u, unconfined, unconfined_r system_r, s0, s0 - mls_systemhigh, mcs_allcats)
+',`
+	gen_user(unconfined_u, unconfined, unconfined_r, s0, s0 - mls_systemhigh, mcs_allcats)
+')
policy/users +0 -0
index 5db8cf4..25402af 100644
@@ -28,13 +28,6 @@ gen_user(user_u, user, user_r, s0, s0)
 gen_user(staff_u, staff, staff_r sysadm_r ifdef(`enable_mls',`secadm_r auditadm_r'), s0, s0 - mls_systemhigh, mcs_allcats)
 gen_user(sysadm_u, sysadm, sysadm_r, s0, s0 - mls_systemhigh, mcs_allcats)
 

policy/users gen_user(user_u, user, user_r, s0, s0) · line 33

Quoted 10 lines
policy/users +0 -7
-# Until order dependence is fixed for users:
-ifdef(`direct_sysadm_daemon',`
-	gen_user(unconfined_u, unconfined, unconfined_r system_r, s0, s0 - mls_systemhigh, mcs_allcats)
-',`
-	gen_user(unconfined_u, unconfined, unconfined_r, s0, s0 - mls_systemhigh, mcs_allcats)
-')
-
 #
 # The following users correspond to Unix identities.
 # These identities are typically assigned as the user attribute

I believe this will break monolithic build, otherwise I would have done it a long time ago. It would take a little work to implement user line moving in the build system to get this into the right place in policy.conf that checkpolicy expects.

Quoted 2 lines

Alternatively, if semodule_expand was enhanced to output all of the files in the expanded policy, we could simplify refpolicy by doing a monolithic build by doing a modular build and then linking/expanding it locally. Then we'd get around the more painful ordering requirements of checkpolicy.

Ouch, i seem to not have tested that. i should follow my own advice. problem is monolithic builts take so long. Atleast with modular you can cheat by skipping the assertion checking (although i should not do that either)

Do you think this error might be related to that?

Quoted 8 lines

/usr/bin/checkpolicy -M -U allow policy.conf -o policy.29
/usr/bin/checkpolicy: loading policy configuration from policy.conf policy/modules/roles/unprivuser.te":13:ERROR 'syntax error' at token 'typeattribute' on line 2436000:

	typeattribute user_t domain;

#line 13
checkpolicy: error(s) encountered while parsing configuration
make: *** [policy.29] Error 1

#55 lore raw

PATCH 25/39 users: move the unconfined_u user statement to the unconfined module (if possible) so that it will be removed if the unconfined module is disabled, or removed

Quoted 46 lines · Dominick Grift
Quoted 42 lines · Christopher J. PeBenito
Quoted 28 lines · Dominick Grift
---
 policy/modules/system/unconfined.te | 6 ++++++
 policy/users                        | 7 -------
 2 files changed, 6 insertions(+), 7 deletions(-)
policy/modules/system/unconfined.te +6 -0
index 28a2188..4e4a4c5 100644
@@ -213,3 +213,9 @@ unconfined_domain_noaudit(unconfined_execmem_t)
 optional_policy(`
 	unconfined_dbus_chat(unconfined_execmem_t)
 ')
+
+ifdef(`direct_sysadm_daemon',`
+	gen_user(unconfined_u, unconfined, unconfined_r system_r, s0, s0 - mls_systemhigh, mcs_allcats)
+',`
+	gen_user(unconfined_u, unconfined, unconfined_r, s0, s0 - mls_systemhigh, mcs_allcats)
+')
policy/users +0 -0
index 5db8cf4..25402af 100644
@@ -28,13 +28,6 @@ gen_user(user_u, user, user_r, s0, s0)
 gen_user(staff_u, staff, staff_r sysadm_r ifdef(`enable_mls',`secadm_r auditadm_r'), s0, s0 - mls_systemhigh, mcs_allcats)
 gen_user(sysadm_u, sysadm, sysadm_r, s0, s0 - mls_systemhigh, mcs_allcats)
 

policy/users gen_user(user_u, user, user_r, s0, s0) · line 33

Quoted 10 lines
policy/users +0 -7
-# Until order dependence is fixed for users:
-ifdef(`direct_sysadm_daemon',`
-	gen_user(unconfined_u, unconfined, unconfined_r system_r, s0, s0 - mls_systemhigh, mcs_allcats)
-',`
-	gen_user(unconfined_u, unconfined, unconfined_r, s0, s0 - mls_systemhigh, mcs_allcats)
-')
-
 #
 # The following users correspond to Unix identities.
 # These identities are typically assigned as the user attribute

I believe this will break monolithic build, otherwise I would have done it a long time ago. It would take a little work to implement user line moving in the build system to get this into the right place in policy.conf that checkpolicy expects.

Quoted 2 lines

Alternatively, if semodule_expand was enhanced to output all of the files in the expanded policy, we could simplify refpolicy by doing a monolithic build by doing a modular build and then linking/expanding it locally. Then we'd get around the more painful ordering requirements of checkpolicy.

Quoted 6 lines

Ouch, i seem to not have tested that. i should follow my own advice. problem is monolithic builts take so long. Atleast with modular you can cheat by skipping the assertion checking (although i should not do that either)

Do you think this error might be related to that?

It could be, but a further inspection of the policy.conf would be required, since the error message by itself isn't very helpful.

Quoted 10 lines
Quoted 8 lines

/usr/bin/checkpolicy -M -U allow policy.conf -o policy.29
/usr/bin/checkpolicy: loading policy configuration from policy.conf policy/modules/roles/unprivuser.te":13:ERROR 'syntax error' at token 'typeattribute' on line 2436000:

	typeattribute user_t domain;

#line 13
checkpolicy: error(s) encountered while parsing configuration
make: *** [policy.29] Error 1

Signature · 3 lines
Chris PeBenito
Tresys Technology, LLC
www.tresys.com | oss.tresys.com
#56 lore raw

PATCH 26/39 init: this is a bug in debian where tmpfs is mounted on /run, and so early on in the boot process init creates /run/utmp and /run/initctl in a tmpfs directory (/) tmpfs

In reply to Dominick Grift
---
 policy/modules/system/init.te | 5 +++++
 1 file changed, 5 insertions(+)
policy/modules/system/init.te +5 -0
index 17eda24..5de913e 100644
@@ -179,6 +179,11 @@ seutil_read_config(init_t)
 
 miscfiles_read_localization(init_t)
 
+ifdef(`distro_debian',`
+fs_tmpfs_filetrans(init_t, initctl_t, fifo, "initctl")
+fs_tmpfs_filetrans(init_t, initrc_var_run_t, file, "utmp")
+')
+
 ifdef(`distro_gentoo',`
 	allow init_t self:process { getcap setcap };
 
Signature · 1 line
1.8.3.1
#57 lore raw

PATCH 26/39 init: this is a bug in debian where tmpfs is mounted on /run, and so early on in the boot process init creates /run/utmp and /run/initctl in a tmpfs directory (/) tmpfs

Quoted 10 lines · Dominick Grift
---
 policy/modules/system/init.te | 5 +++++
 1 file changed, 5 insertions(+)
policy/modules/system/init.te +0 -0
index 17eda24..5de913e 100644

policy/modules/system/init.te seutil_read_config(init_t) · line 188

Quoted 10 lines
policy/modules/system/init.te +5 -0
@@ -179,6 +179,11 @@ seutil_read_config(init_t)
 
 miscfiles_read_localization(init_t)
 
+ifdef(`distro_debian',`
+fs_tmpfs_filetrans(init_t, initctl_t, fifo, "initctl")
+fs_tmpfs_filetrans(init_t, initrc_var_run_t, file, "utmp")
+')
+
 ifdef(`distro_gentoo',`
 	allow init_t self:process { getcap setcap };

Merged with whitespace fix.

Signature · 3 lines
Chris PeBenito
Tresys Technology, LLC
www.tresys.com | oss.tresys.com
#58 lore raw

PATCH 27/39 libraries: for now i can only confirm mmap, might need to be changed to bin_t later if it turns out to need execute_no_trans

In reply to Dominick Grift
---
 policy/modules/system/libraries.fc | 4 ++++
 1 file changed, 4 insertions(+)
policy/modules/system/libraries.fc +4 -0
index 73bb3c0..d9408e6 100644
@@ -117,6 +117,10 @@ ifdef(`distro_redhat',`
 
 /usr/(.*/)?nvidia/.+\.so(\..*)?		--	gen_context(system_u:object_r:textrel_shlib_t,s0)
 
+ifdef(`distro_debian',`
+/usr/(.*/)?dh-python/dh_pypy	--	gen_context(system_u:object_r:lib_t,s0)
+')
+
 /usr/lib/altivec/libavcodec\.so(\.[^/]*)* --	gen_context(system_u:object_r:textrel_shlib_t,s0)
 /usr/lib/cedega/.+\.so(\.[^/]*)*	--	gen_context(system_u:object_r:textrel_shlib_t,s0)
 /usr/lib/dovecot/(.*/)?lib.*\.so.*      --      gen_context(system_u:object_r:lib_t,s0)
Signature · 1 line
1.8.3.1
#59 lore raw

PATCH 27/39 libraries: for now i can only confirm mmap, might need to be changed to bin_t later if it turns out to need execute_no_trans

Quoted 10 lines · Dominick Grift
---
 policy/modules/system/libraries.fc | 4 ++++
 1 file changed, 4 insertions(+)
policy/modules/system/libraries.fc +0 -0
index 73bb3c0..d9408e6 100644

policy/modules/system/libraries.fc ifdef(`distro_redhat',` · line 126

Quoted 10 lines
policy/modules/system/libraries.fc +4 -0
@@ -117,6 +117,10 @@ ifdef(`distro_redhat',`
 
 /usr/(.*/)?nvidia/.+\.so(\..*)?		--	gen_context(system_u:object_r:textrel_shlib_t,s0)
 
+ifdef(`distro_debian',`
+/usr/(.*/)?dh-python/dh_pypy	--	gen_context(system_u:object_r:lib_t,s0)
+')
+
 /usr/lib/altivec/libavcodec\.so(\.[^/]*)* --	gen_context(system_u:object_r:textrel_shlib_t,s0)
 /usr/lib/cedega/.+\.so(\.[^/]*)*	--	gen_context(system_u:object_r:textrel_shlib_t,s0)
 /usr/lib/dovecot/(.*/)?lib.*\.so.*      --      gen_context(system_u:object_r:lib_t,s0)

Merged.

Signature · 3 lines
Chris PeBenito
Tresys Technology, LLC
www.tresys.com | oss.tresys.com
#60 lore raw

PATCH 28/39 init: startpar (initrc_t) gets attributes of /dev/dm-0 (device_t) early on boot, soon later the node context is properly reset (debian only) init: startpar (initrc_t) gets attributes of /proc/kcore file

In reply to Dominick Grift
---
 policy/modules/system/init.te | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)
policy/modules/system/init.te +4 -1
index 5de913e..4691035 100644
@@ -180,7 +180,7 @@ seutil_read_config(init_t)
 miscfiles_read_localization(init_t)
 
 ifdef(`distro_debian',`
-fs_tmpfs_filetrans(init_t, initctl_t, fifo, "initctl")
+fs_tmpfs_filetrans(init_t, initctl_t, fifo_file, "initctl")
 fs_tmpfs_filetrans(init_t, initrc_var_run_t, file, "utmp")
 ')
 
@@ -437,6 +437,9 @@ userdom_read_user_home_content_files(initrc_t)
 userdom_use_user_terminals(initrc_t)
 
 ifdef(`distro_debian',`
+	kernel_getattr_core_if(initrc_t)
+
+	dev_getattr_generic_blk_files(initrc_t)
 	dev_setattr_generic_dirs(initrc_t)
 
 	fs_tmpfs_filetrans(initrc_t, initrc_var_run_t, dir)
Signature · 1 line
1.8.3.1
#61 lore raw

PATCH 28/39 init: startpar (initrc_t) gets attributes of /dev/dm-0 (device_t) early on boot, soon later the node context is properly reset (debian only) init: startpar (initrc_t) gets attributes of /proc/kcore file

On Sat, 2013-11-09 at 10:45 +0100, Dominick Grift wrote:

Please merge this patch asap.

Current refpolicy does not build without this patch This was a rebase mistake by me.

Quoted 28 lines
---
 policy/modules/system/init.te | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)
policy/modules/system/init.te +4 -1
index 5de913e..4691035 100644
@@ -180,7 +180,7 @@ seutil_read_config(init_t)
 miscfiles_read_localization(init_t)
 
 ifdef(`distro_debian',`
-fs_tmpfs_filetrans(init_t, initctl_t, fifo, "initctl")
+fs_tmpfs_filetrans(init_t, initctl_t, fifo_file, "initctl")
 fs_tmpfs_filetrans(init_t, initrc_var_run_t, file, "utmp")
 ')
 
@@ -437,6 +437,9 @@ userdom_read_user_home_content_files(initrc_t)
 userdom_use_user_terminals(initrc_t)
 
 ifdef(`distro_debian',`
+	kernel_getattr_core_if(initrc_t)
+
+	dev_getattr_generic_blk_files(initrc_t)
 	dev_setattr_generic_dirs(initrc_t)
 
 	fs_tmpfs_filetrans(initrc_t, initrc_var_run_t, dir)
#62 lore raw

PATCH 28/39 init: startpar (initrc_t) gets attributes of /dev/dm-0 (device_t) early on boot, soon later the node context is properly reset (debian only) init: startpar (initrc_t) gets attributes of /proc/kcore file

In reply to Dominick Grift

Le Sat, 9 Nov 2013 10:45:09 +0100, Dominick Grift <[email protected]> a ?crit :

Quoted 19 lines
---
 policy/modules/system/init.te | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)
(quoted diff) +0 -0

b/policy/modules/system/init.te index 5de913e..4691035 100644

policy/modules/system/init.te +1 -1
@@ -180,7 +180,7 @@ seutil_read_config(init_t)
 miscfiles_read_localization(init_t)
 
 ifdef(`distro_debian',`
-fs_tmpfs_filetrans(init_t, initctl_t, fifo, "initctl")
+fs_tmpfs_filetrans(init_t, initctl_t, fifo_file, "initctl")
 fs_tmpfs_filetrans(init_t, initrc_var_run_t, file, "utmp")
 ')
 

policy/modules/system/init.te userdom_read_user_home_content_files(initrc_t) · line 445

Quoted 9 lines
policy/modules/system/init.te +3 -0
@@ -437,6 +437,9 @@ userdom_read_user_home_content_files(initrc_t)
 userdom_use_user_terminals(initrc_t)
 
 ifdef(`distro_debian',`
+	kernel_getattr_core_if(initrc_t)
+
+	dev_getattr_generic_blk_files(initrc_t)
 	dev_setattr_generic_dirs(initrc_t)
 
 	fs_tmpfs_filetrans(initrc_t, initrc_var_run_t, dir)

Hi,

Apparently this patch has never been merged (but the first chunk is not applying anymore), should I repropose it or would you have the time to do it?

Cheers,

Laurent Bigonville

#63 lore raw

PATCH 28/39 init: startpar (initrc_t) gets attributes of /dev/dm-0 (device_t) early on boot, soon later the node context is properly reset (debian only) init: startpar (initrc_t) gets attributes of /proc/kcore file

Quoted 34 lines · Laurent Bigonville

Le Sat, 9 Nov 2013 10:45:09 +0100, Dominick Grift <[email protected]> a ?crit :

Quoted 19 lines
---
 policy/modules/system/init.te | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)
(quoted diff) +0 -0

b/policy/modules/system/init.te index 5de913e..4691035 100644

policy/modules/system/init.te +1 -1
@@ -180,7 +180,7 @@ seutil_read_config(init_t)
 miscfiles_read_localization(init_t)
 
 ifdef(`distro_debian',`
-fs_tmpfs_filetrans(init_t, initctl_t, fifo, "initctl")
+fs_tmpfs_filetrans(init_t, initctl_t, fifo_file, "initctl")
 fs_tmpfs_filetrans(init_t, initrc_var_run_t, file, "utmp")
 ')
 

policy/modules/system/init.te userdom_read_user_home_content_files(initrc_t) · line 445

Quoted 9 lines
policy/modules/system/init.te +3 -0
@@ -437,6 +437,9 @@ userdom_read_user_home_content_files(initrc_t)
 userdom_use_user_terminals(initrc_t)
 
 ifdef(`distro_debian',`
+	kernel_getattr_core_if(initrc_t)
+
+	dev_getattr_generic_blk_files(initrc_t)
 	dev_setattr_generic_dirs(initrc_t)
 
 	fs_tmpfs_filetrans(initrc_t, initrc_var_run_t, dir)

Hi,

Quoted 5 lines

Apparently this patch has never been merged (but the first chunk is not applying anymore), should I repropose it or would you have the time to do it?

Cheers,

I lost the passphrase of my ssh key for contrib so probably best to resumbit a new patch because i wont be able to commit this

Quoted 2 lines

Laurent Bigonville

#64 lore raw

PATCH 29/39 init: exim init script runs various helper apps that create and manage /var/lib/exim4/config.autogenerated.tmp file

In reply to Dominick Grift
---
 policy/modules/system/init.te | 4 ++++
 1 file changed, 4 insertions(+)
policy/modules/system/init.te +4 -0
index 4691035..7f8797a 100644
@@ -450,6 +450,10 @@ ifdef(`distro_debian',`
 	storage_tmpfs_filetrans_fixed_disk(initrc_t)
 
 	files_setattr_etc_dirs(initrc_t)
+
+	optional_policy(`
+		exim_manage_var_lib_files(initrc_t)
+	')
 ')
 
 ifdef(`distro_gentoo',`
Signature · 1 line
1.8.3.1
#65 lore raw

PATCH 29/39 init: exim init script runs various helper apps that create and manage /var/lib/exim4/config.autogenerated.tmp file

Quoted 10 lines · Dominick Grift
---
 policy/modules/system/init.te | 4 ++++
 1 file changed, 4 insertions(+)
policy/modules/system/init.te +0 -0
index 4691035..7f8797a 100644

policy/modules/system/init.te ifdef(`distro_debian',` · line 459

Quoted 10 lines
policy/modules/system/init.te +4 -0
@@ -450,6 +450,10 @@ ifdef(`distro_debian',`
 	storage_tmpfs_filetrans_fixed_disk(initrc_t)
 
 	files_setattr_etc_dirs(initrc_t)
+
+	optional_policy(`
+		exim_manage_var_lib_files(initrc_t)
+	')
 ')
 
 ifdef(`distro_gentoo',`

Merged.

Signature · 3 lines
Chris PeBenito
Tresys Technology, LLC
www.tresys.com | oss.tresys.com
#66 lore raw

PATCH 30/39 init: the gdomap and minissdpd init scripts read the respective environ files in /etc/default. We need to give them a private type so that we can give the gdomap_admin() and minissdpd_admin() access to it, but it seems overengineering to create private environ types for these files

In reply to Dominick Grift
---
 policy/modules/system/init.te | 8 ++++++++
 1 file changed, 8 insertions(+)
policy/modules/system/init.te +8 -0
index 7f8797a..cd97c98 100644
@@ -454,6 +454,14 @@ ifdef(`distro_debian',`
 	optional_policy(`
 		exim_manage_var_lib_files(initrc_t)
 	')
+
+	optional_policy(`
+		gdomap_read_config(initrc_t)
+	')
+
+	optional_policy(`
+		minissdpd_read_config(initrc_t)
+	')
 ')
 
 ifdef(`distro_gentoo',`
Signature · 1 line
1.8.3.1
#67 lore raw

PATCH 30/39 init: the gdomap and minissdpd init scripts read the respective environ files in /etc/default. We need to give them a private type so that we can give the gdomap_admin() and minissdpd_admin() access to it, but it seems overengineering to create private environ types for these files

Quoted 14 lines · Dominick Grift
---
 policy/modules/system/init.te | 8 ++++++++
 1 file changed, 8 insertions(+)
policy/modules/system/init.te +1 -0
index 7f8797a..cd97c98 100644
@@ -454,6 +454,14 @@ ifdef(`distro_debian',`
 	optional_policy(`
 		exim_manage_var_lib_files(initrc_t)
 	')
+

policy/modules/system/init.te ifdef(`distro_debian',` · line 467

Quoted 10 lines
policy/modules/system/init.te +7 -0
+	optional_policy(`
+		gdomap_read_config(initrc_t)
+	')
+
+	optional_policy(`
+		minissdpd_read_config(initrc_t)
+	')
 ')
 
 ifdef(`distro_gentoo',`

Merged.

Signature · 3 lines
Chris PeBenito
Tresys Technology, LLC
www.tresys.com | oss.tresys.com
#68 lore raw

PATCH 31/39 udev: in debian udevadm is located in /bin/udevadm

In reply to Dominick Grift
---
 policy/modules/system/udev.fc | 1 +
 1 file changed, 1 insertion(+)
policy/modules/system/udev.fc +1 -0
index dd1a887..0b4df21 100644
@@ -12,6 +12,7 @@
 /lib/udev/udev-acl --	gen_context(system_u:object_r:udev_exec_t,s0)
 
 ifdef(`distro_debian',`
+/bin/udevadm	--	gen_context(system_u:object_r:udev_exec_t,s0)
 /lib/udev/create_static_nodes -- gen_context(system_u:object_r:udev_exec_t,s0)
 ')
 
Signature · 1 line
1.8.3.1
#69 lore raw

PATCH 32/39 sshd/setrans: make respective init scripts create pid dirs with proper contexts

In reply to Dominick Grift
---
 policy/modules/services/ssh.te   | 4 ++++
 policy/modules/system/setrans.te | 4 ++++
 2 files changed, 8 insertions(+)
policy/modules/services/ssh.te +4 -0
index cc877c7..d7559d8 100644
@@ -33,6 +33,10 @@ corecmd_executable_file(sshd_exec_t)
 ssh_server_template(sshd)
 init_daemon_domain(sshd_t, sshd_exec_t)
 
+ifdef(`distro_debian',`
+	init_daemon_run_dir(sshd_var_run_t, "sshd")
+')
+
 type sshd_key_t;
 files_type(sshd_key_t)
 
policy/modules/system/setrans.te +4 -0
index 48aefa2..dcd7c62 100644
@@ -20,6 +20,10 @@ type setrans_var_run_t;
 files_pid_file(setrans_var_run_t)
 mls_trusted_object(setrans_var_run_t)
 
+ifdef(`distro_debian',`
+	init_daemon_run_dir(setrans_var_run_t, "setrans")
+')
+
 ifdef(`enable_mcs',`
 	init_ranged_daemon_domain(setrans_t, setrans_exec_t, s0 - mcs_systemhigh)
 ')
Signature · 1 line
1.8.3.1
#70 lore raw

PATCH 32/39 sshd/setrans: make respective init scripts create pid dirs with proper contexts

Quoted 26 lines · Dominick Grift
---
 policy/modules/services/ssh.te   | 4 ++++
 policy/modules/system/setrans.te | 4 ++++
 2 files changed, 8 insertions(+)
policy/modules/services/ssh.te +4 -0
index cc877c7..d7559d8 100644
@@ -33,6 +33,10 @@ corecmd_executable_file(sshd_exec_t)
 ssh_server_template(sshd)
 init_daemon_domain(sshd_t, sshd_exec_t)
 
+ifdef(`distro_debian',`
+	init_daemon_run_dir(sshd_var_run_t, "sshd")
+')
+
 type sshd_key_t;
 files_type(sshd_key_t)
 
policy/modules/system/setrans.te +0 -0
index 48aefa2..dcd7c62 100644

policy/modules/system/setrans.te type setrans_var_run_t; · line 29

Quoted 10 lines
policy/modules/system/setrans.te +4 -0
@@ -20,6 +20,10 @@ type setrans_var_run_t;
 files_pid_file(setrans_var_run_t)
 mls_trusted_object(setrans_var_run_t)
 
+ifdef(`distro_debian',`
+	init_daemon_run_dir(setrans_var_run_t, "setrans")
+')
+
 ifdef(`enable_mcs',`
 	init_ranged_daemon_domain(setrans_t, setrans_exec_t, s0 - mcs_systemhigh)
 ')

Merged.

Signature · 3 lines
Chris PeBenito
Tresys Technology, LLC
www.tresys.com | oss.tresys.com
#71 lore raw

PATCH 33/39 kernel: cryptomgr_test (kernel_t) requests kernel to load cryptd(__driver-ecb-aes-aesni

In reply to Dominick Grift
---
 policy/modules/kernel/kernel.te | 2 ++
 1 file changed, 2 insertions(+)
policy/modules/kernel/kernel.te +2 -0
index dd1e7e7..d7a9b47 100644
@@ -228,6 +228,8 @@ allow kernel_t unlabeled_t:dir mounton;
 # connections with invalidated labels:
 allow kernel_t unlabeled_t:packet send;
 
+kernel_request_load_module(kernel_t)
+
 # Allow unlabeled network traffic
 allow unlabeled_t unlabeled_t:packet { forward_in forward_out };
 corenet_in_generic_if(unlabeled_t)
Signature · 1 line
1.8.3.1
#72 lore raw

PATCH 33/39 kernel: cryptomgr_test (kernel_t) requests kernel to load cryptd(__driver-ecb-aes-aesni

Quoted 10 lines · Dominick Grift
---
 policy/modules/kernel/kernel.te | 2 ++
 1 file changed, 2 insertions(+)
policy/modules/kernel/kernel.te +0 -0
index dd1e7e7..d7a9b47 100644

policy/modules/kernel/kernel.te allow kernel_t unlabeled_t:dir mounton; · line 235

Quoted 8 lines
policy/modules/kernel/kernel.te +2 -0
@@ -228,6 +228,8 @@ allow kernel_t unlabeled_t:dir mounton;
 # connections with invalidated labels:
 allow kernel_t unlabeled_t:packet send;
 
+kernel_request_load_module(kernel_t)
+
 # Allow unlabeled network traffic
 allow unlabeled_t unlabeled_t:packet { forward_in forward_out };
 corenet_in_generic_if(unlabeled_t)

Merged.

Signature · 3 lines
Chris PeBenito
Tresys Technology, LLC
www.tresys.com | oss.tresys.com
#73 lore raw

PATCH 34/39 kernel: Edited the dev_(create|setattr)_all_(chr|blk)_files() interfaces:

In reply to Dominick Grift

1. device_t type was used but not required
2. the interface name suggest all dev files and that includes device_t chr/blk files as well. If the interface name would say all_dev_nodes then it would have been a different story

In debian kernel needs to set attributes of generic device_t blk files (/dev/dm-.*) Some how theyre created with generic device_t

In debian kernel needs to create, and set attributes of atleast the chr files that i added named file transtion rules for but i added permissions to kernel to create and set attributes of any chr file in /dev ( that includes generic device_t type chr files

---
 policy/modules/kernel/devices.if | 12 ++++++++----
 policy/modules/kernel/kernel.te  |  4 ++++
 2 files changed, 12 insertions(+), 4 deletions(-)
policy/modules/kernel/devices.if +8 -4
index 147170a..afcc522 100644
@@ -1072,9 +1072,10 @@ interface(`dev_dontaudit_getattr_all_chr_files',`
 interface(`dev_setattr_all_blk_files',`
 	gen_require(`
 		attribute device_node;
+		type device_t;
 	')
 
-	setattr_blk_files_pattern($1, device_t, device_node)
+	setattr_blk_files_pattern($1, device_t, { device_node device_t })
 ')
 
 ########################################
@@ -1091,9 +1092,10 @@ interface(`dev_setattr_all_blk_files',`
 interface(`dev_setattr_all_chr_files',`
 	gen_require(`
 		attribute device_node;
+		type device_t;
 	')
 
-	setattr_chr_files_pattern($1, device_t, device_node)
+	setattr_chr_files_pattern($1, device_t, { device_node device_t })
 ')
 
 ########################################
@@ -1181,9 +1183,10 @@ interface(`dev_dontaudit_write_all_chr_files',`
 interface(`dev_create_all_blk_files',`
 	gen_require(`
 		attribute device_node;
+		type device_t;
 	')
 
-	create_blk_files_pattern($1, device_t, device_node)
+	create_blk_files_pattern($1, device_t, { device_node device_t })
 ')
 
 ########################################
@@ -1199,9 +1202,10 @@ interface(`dev_create_all_blk_files',`
 interface(`dev_create_all_chr_files',`
 	gen_require(`
 		attribute device_node;
+		type device_t;
 	')
 
-	create_chr_files_pattern($1, device_t, device_node)
+	create_chr_files_pattern($1, device_t, { device_node device_t })
 ')
 
 ########################################
policy/modules/kernel/kernel.te +4 -0
index d7a9b47..b9d6a3a 100644
@@ -288,6 +288,10 @@ mls_file_write_all_levels(kernel_t)
 mls_file_read_all_levels(kernel_t)
 
 ifdef(`distro_debian',`
+	dev_create_all_chr_files(kernel_t)
+	dev_setattr_all_blk_files(kernel_t)
+	dev_setattr_all_chr_files(kernel_t)
+
 	dev_filetrans_input(kernel_t, "event0")
 	dev_filetrans_input(kernel_t, "event1")
 	dev_filetrans_input(kernel_t, "event2")
Signature · 1 line
1.8.3.1
#74 lore raw

PATCH 34/39 kernel: Edited the dev_(create|setattr)_all_(chr|blk)_files() interfaces:

Quoted 5 lines · Dominick Grift

1. device_t type was used but not required
2. the interface name suggest all dev files and that includes device_t chr/blk files as well. If the interface name would say all_dev_nodes then it would have been a different story

Quoted 7 lines

In debian kernel needs to set attributes of generic device_t blk files (/dev/dm-.*) Some how theyre created with generic device_t

In debian kernel needs to create, and set attributes of atleast the chr files that i added named file transtion rules for but i added permissions to kernel to create and set attributes of any chr file in /dev ( that includes generic device_t type chr files

Fails to apply for me.

Quoted 74 lines
---
 policy/modules/kernel/devices.if | 12 ++++++++----
 policy/modules/kernel/kernel.te  |  4 ++++
 2 files changed, 12 insertions(+), 4 deletions(-)
policy/modules/kernel/devices.if +8 -4
index 147170a..afcc522 100644
@@ -1072,9 +1072,10 @@ interface(`dev_dontaudit_getattr_all_chr_files',`
 interface(`dev_setattr_all_blk_files',`
 	gen_require(`
 		attribute device_node;
+		type device_t;
 	')
 
-	setattr_blk_files_pattern($1, device_t, device_node)
+	setattr_blk_files_pattern($1, device_t, { device_node device_t })
 ')
 
 ########################################
@@ -1091,9 +1092,10 @@ interface(`dev_setattr_all_blk_files',`
 interface(`dev_setattr_all_chr_files',`
 	gen_require(`
 		attribute device_node;
+		type device_t;
 	')
 
-	setattr_chr_files_pattern($1, device_t, device_node)
+	setattr_chr_files_pattern($1, device_t, { device_node device_t })
 ')
 
 ########################################
@@ -1181,9 +1183,10 @@ interface(`dev_dontaudit_write_all_chr_files',`
 interface(`dev_create_all_blk_files',`
 	gen_require(`
 		attribute device_node;
+		type device_t;
 	')
 
-	create_blk_files_pattern($1, device_t, device_node)
+	create_blk_files_pattern($1, device_t, { device_node device_t })
 ')
 
 ########################################
@@ -1199,9 +1202,10 @@ interface(`dev_create_all_blk_files',`
 interface(`dev_create_all_chr_files',`
 	gen_require(`
 		attribute device_node;
+		type device_t;
 	')
 
-	create_chr_files_pattern($1, device_t, device_node)
+	create_chr_files_pattern($1, device_t, { device_node device_t })
 ')
 
 ########################################
policy/modules/kernel/kernel.te +4 -0
index d7a9b47..b9d6a3a 100644
@@ -288,6 +288,10 @@ mls_file_write_all_levels(kernel_t)
 mls_file_read_all_levels(kernel_t)
 
 ifdef(`distro_debian',`
+	dev_create_all_chr_files(kernel_t)
+	dev_setattr_all_blk_files(kernel_t)
+	dev_setattr_all_chr_files(kernel_t)
+
 	dev_filetrans_input(kernel_t, "event0")
 	dev_filetrans_input(kernel_t, "event1")
 	dev_filetrans_input(kernel_t, "event2")
Signature · 3 lines
Chris PeBenito
Tresys Technology, LLC
www.tresys.com | oss.tresys.com
#75 lore raw

PATCH 35/39 users: calls pulseaudio_role() for restricted xwindows users and staff_t/user_t

In reply to Dominick Grift
---
 policy/modules/roles/staff.te       | 4 ++++
 policy/modules/roles/unprivuser.te  | 4 ++++
 policy/modules/system/userdomain.if | 4 ++++
 3 files changed, 12 insertions(+)
policy/modules/roles/staff.te +4 -0
index 0fef1fc..5fd339b 100644
@@ -82,6 +82,10 @@ ifndef(`distro_redhat',`
 		optional_policy(`
 			gnome_role_template(staff, staff_r, staff_t)
 		')
+
+		optional_policy(`
+			pulseaudio_role(staff_r, staff_t)
+		')
 	')
 
 	optional_policy(`
policy/modules/roles/unprivuser.te +4 -0
index 6d77e81..acc9ff7 100644
@@ -55,6 +55,10 @@ ifndef(`distro_redhat',`
 		optional_policy(`
 			gnome_role_template(user, user_r, user_t)
 		')
+
+		optional_policy(`
+			pulseaudio_role(user_r, user_t)
+		')
 	')
 
 	optional_policy(`
policy/modules/system/userdomain.if +4 -0
index 189f786..dc03698 100644
@@ -946,6 +946,10 @@ template(`userdom_restricted_xwindows_user_template',`
 			gnome_role_template($1, $1_r, $1_t)
 			wm_role_template($1, $1_r, $1_t)
 		')
+
+		optional_policy(`
+			pulseaudio_role($1_r, $1_t)
+		')
 	')
 
 	optional_policy(`
Signature · 1 line
1.8.3.1
#76 lore raw

PATCH 35/39 users: calls pulseaudio_role() for restricted xwindows users and staff_t/user_t

Quoted 42 lines · Dominick Grift
---
 policy/modules/roles/staff.te       | 4 ++++
 policy/modules/roles/unprivuser.te  | 4 ++++
 policy/modules/system/userdomain.if | 4 ++++
 3 files changed, 12 insertions(+)
policy/modules/roles/staff.te +4 -0
index 0fef1fc..5fd339b 100644
@@ -82,6 +82,10 @@ ifndef(`distro_redhat',`
 		optional_policy(`
 			gnome_role_template(staff, staff_r, staff_t)
 		')
+
+		optional_policy(`
+			pulseaudio_role(staff_r, staff_t)
+		')
 	')
 
 	optional_policy(`
policy/modules/roles/unprivuser.te +4 -0
index 6d77e81..acc9ff7 100644
@@ -55,6 +55,10 @@ ifndef(`distro_redhat',`
 		optional_policy(`
 			gnome_role_template(user, user_r, user_t)
 		')
+
+		optional_policy(`
+			pulseaudio_role(user_r, user_t)
+		')
 	')
 
 	optional_policy(`
policy/modules/system/userdomain.if +0 -0
index 189f786..dc03698 100644

policy/modules/system/userdomain.if template(`userdom_restricted_xwindows_user_template',` · line 954

Quoted 9 lines
policy/modules/system/userdomain.if +4 -0
@@ -946,6 +946,10 @@ template(`userdom_restricted_xwindows_user_template',`
 			gnome_role_template($1, $1_r, $1_t)
 			wm_role_template($1, $1_r, $1_t)
 		')
+
+		optional_policy(`
+			pulseaudio_role($1_r, $1_t)
+		')
 	')
 

Merged.

Signature · 3 lines
Chris PeBenito
Tresys Technology, LLC
www.tresys.com | oss.tresys.com
#77 lore raw

PATCH 36/39 init: creates /run/utmp

In reply to Dominick Grift
---
 policy/modules/system/init.te | 2 ++
 1 file changed, 2 insertions(+)
policy/modules/system/init.te +2 -0
index cd97c98..95f2284 100644
@@ -181,6 +181,8 @@ miscfiles_read_localization(init_t)
 
 ifdef(`distro_debian',`
 fs_tmpfs_filetrans(init_t, initctl_t, fifo_file, "initctl")
+
+allow init_t initrc_var_run_t:file manage_file_perms;
 fs_tmpfs_filetrans(init_t, initrc_var_run_t, file, "utmp")
 ')
 
Signature · 1 line
1.8.3.1
#78 lore raw

PATCH 36/39 init: creates /run/utmp

Quoted 10 lines · Dominick Grift
---
 policy/modules/system/init.te | 2 ++
 1 file changed, 2 insertions(+)
policy/modules/system/init.te +0 -0
index cd97c98..95f2284 100644

policy/modules/system/init.te miscfiles_read_localization(init_t) · line 187

Quoted 7 lines
policy/modules/system/init.te +2 -0
@@ -181,6 +181,8 @@ miscfiles_read_localization(init_t)
 
 ifdef(`distro_debian',`
 fs_tmpfs_filetrans(init_t, initctl_t, fifo_file, "initctl")
+
+allow init_t initrc_var_run_t:file manage_file_perms;
 fs_tmpfs_filetrans(init_t, initrc_var_run_t, file, "utmp")
 ')

Merged manually due to a whitespace fix on the prior patch.

Signature · 3 lines
Chris PeBenito
Tresys Technology, LLC
www.tresys.com | oss.tresys.com
#79 lore raw

PATCH 37/39 xserver: already allowed by auth_login_pgm_domain(xdm_t)

In reply to Dominick Grift
---
 policy/modules/services/xserver.te | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
policy/modules/services/xserver.te +1 -1
index 8b40377..a7faaad 100644
@@ -301,7 +301,7 @@ optional_policy(`
 #
 
 allow xdm_t self:capability { setgid setuid sys_resource kill sys_tty_config mknod chown dac_override dac_read_search fowner fsetid ipc_owner sys_nice sys_rawio net_bind_service };
-allow xdm_t self:process { setexec setpgid getsched setsched setrlimit signal_perms setkeycreate };
+allow xdm_t self:process { setexec setpgid getsched setsched setrlimit signal_perms };
 allow xdm_t self:fifo_file rw_fifo_file_perms;
 allow xdm_t self:shm create_shm_perms;
 allow xdm_t self:sem create_sem_perms;
Signature · 1 line
1.8.3.1
#80 lore raw

PATCH 37/39 xserver: already allowed by auth_login_pgm_domain(xdm_t)

Quoted 10 lines · Dominick Grift
---
 policy/modules/services/xserver.te | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
policy/modules/services/xserver.te +0 -0
index 8b40377..a7faaad 100644

policy/modules/services/xserver.te optional_policy(` · line 307

Quoted 8 lines
policy/modules/services/xserver.te +1 -1
@@ -301,7 +301,7 @@ optional_policy(`
 #
 
 allow xdm_t self:capability { setgid setuid sys_resource kill sys_tty_config mknod chown dac_override dac_read_search fowner fsetid ipc_owner sys_nice sys_rawio net_bind_service };
-allow xdm_t self:process { setexec setpgid getsched setsched setrlimit signal_perms setkeycreate };
+allow xdm_t self:process { setexec setpgid getsched setsched setrlimit signal_perms };
 allow xdm_t self:fifo_file rw_fifo_file_perms;
 allow xdm_t self:shm create_shm_perms;
 allow xdm_t self:sem create_sem_perms;

Merged.

Signature · 3 lines
Chris PeBenito
Tresys Technology, LLC
www.tresys.com | oss.tresys.com
#81 lore raw

PATCH 38/39 xserver: review this

In reply to Dominick Grift
---
 policy/modules/services/xserver.te | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)
policy/modules/services/xserver.te +4 -4
index a7faaad..2ae8acb 100644
@@ -741,10 +741,10 @@ userdom_rw_user_tmpfs_files(xserver_t)
 
 xserver_use_user_fonts(xserver_t)
 
-ifndef(`distro_redhat',`
-	allow xserver_t self:process { execmem execheap execstack };
-	domain_mmap_low_uncond(xserver_t)
-')
+# ifndef(`distro_redhat',`
+#	allow xserver_t self:process { execmem execheap execstack };
+#	domain_mmap_low_uncond(xserver_t)
+# ')
 
 ifdef(`distro_rhel4',`
 	allow xserver_t self:process { execmem execheap execstack };
Signature · 1 line
1.8.3.1
#82 lore raw

PATCH 38/39 xserver: review this

Quoted 15 lines · Dominick Grift
---
 policy/modules/services/xserver.te | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)
policy/modules/services/xserver.te +0 -1
index a7faaad..2ae8acb 100644
@@ -741,10 +741,10 @@ userdom_rw_user_tmpfs_files(xserver_t)
 
 xserver_use_user_fonts(xserver_t)
 
-ifndef(`distro_redhat',`

policy/modules/services/xserver.te userdom_rw_user_tmpfs_files(xserver_t) · line 750

Quoted 10 lines
policy/modules/services/xserver.te +4 -3
-	allow xserver_t self:process { execmem execheap execstack };
-	domain_mmap_low_uncond(xserver_t)
-')
+# ifndef(`distro_redhat',`
+#	allow xserver_t self:process { execmem execheap execstack };
+#	domain_mmap_low_uncond(xserver_t)
+# ')
 
 ifdef(`distro_rhel4',`
 	allow xserver_t self:process { execmem execheap execstack };

I suspect this can be removed, not just commented out. Sven, can you confirm on Gentoo?

Signature · 3 lines
Chris PeBenito
Tresys Technology, LLC
www.tresys.com | oss.tresys.com
#83 lore raw

PATCH 38/39 xserver: review this

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Quoted 18 lines · Christopher J. PeBenito
Quoted 17 lines · Dominick Grift

policy/modules/services/xserver.te | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-)

(quoted diff) +0 -0

b/policy/modules/services/xserver.te index a7faaad..2ae8acb 100644 --- a/policy/modules/services/xserver.te +++ b/policy/modules/services/xserver.te @@ -741,10 +741,10 @@ userdom_rw_user_tmpfs_files(xserver_t)

xserver_use_user_fonts(xserver_t)

-ifndef(distro_redhat', - allow xserver_t self:process { execmem
execheap execstack }; - domain_mmap_low_uncond(xserver_t) -') +#
ifndef(distro_redhat', +# allow xserver_t self:process { execmem
execheap execstack }; +# domain_mmap_low_uncond(xserver_t) +# ')

Quoted 7 lines
Quoted 3 lines

ifdef(distro_rhel4', allow xserver_t self:process { execmem execheap execstack };

I suspect this can be removed, not just commented out. Sven, can you confirm on Gentoo?

Yes just remove it.
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.15 (GNU/Linux)
Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/

iEYEARECAAYFAlKgjKEACgkQrlYvE4MpobMu3gCfTnyROmzZDASGXSFwLRShAh+M ulAAn30rmZ8uS+vMFVVADisay/CnTfh9
=rxIQ
-----END PGP SIGNATURE-----

#84 lore raw

PATCH 38/39 xserver: review this

In reply to Christopher J. PeBenito

I auditallow'ed the statements to see if they were triggered during a normal x session (startup, some spps, shutdown) and they were not, so ok to remove.

Quoted 31 lines · Christopher J. PeBenito

Review

Quoted 6 lines · Dominick Grift
---
 policy/modules/services/xserver.te | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)
(quoted diff) +0 -0

b/policy/modules/services/xserver.te

Quoted 9 lines

index a7faaad..2ae8acb 100644

policy/modules/services/xserver.te +0 -1
@@ -741,10 +741,10 @@ userdom_rw_user_tmpfs_files(xserver_t)
 
 xserver_use_user_fonts(xserver_t)
 
-ifndef(`distro_redhat',`

policy/modules/services/xserver.te userdom_rw_user_tmpfs_files(xserver_t) · line 750

Quoted 10 lines
policy/modules/services/xserver.te +4 -3
-     allow xserver_t self:process { execmem execheap execstack };
-     domain_mmap_low_uncond(xserver_t)
-')
+# ifndef(`distro_redhat',`
+#    allow xserver_t self:process { execmem execheap execstack };
+#    domain_mmap_low_uncond(xserver_t)
+# ')
 
 ifdef(`distro_rhel4',`
      allow xserver_t self:process { execmem execheap execstack };

I suspect this can be removed, not just commented out. Sven, can you confirm on Gentoo?

Quoted 5 lines

--
Chris PeBenito
Tresys Technology, LLC
www.tresys.com | oss.tresys.com

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://oss.tresys.com/pipermail/refpolicy/attachments/20131206/f55466a5/attachment.html

#85 lore raw

PATCH 38/39 xserver: review this

Quoted 3 lines · Sven Vermeulen

I auditallow'ed the statements to see if they were triggered during a normal x session (startup, some spps, shutdown) and they were not, so ok to remove.

Thanks, i will submit a patch that removes these

#86 lore raw

PATCH 39/39 unconfined: Do not domain transition to xserver_t (unconfined_t is xserver_unconfined)

In reply to Dominick Grift

It would not be sufficient in the current shape anyways because unconfined_r is not associated with xserver_t

---
 policy/modules/system/unconfined.te | 4 ----
 1 file changed, 4 deletions(-)
policy/modules/system/unconfined.te +0 -4
index 4e4a4c5..bb1696d 100644
@@ -198,10 +198,6 @@ optional_policy(`
 	wine_domtrans(unconfined_t)
 ')
 
-optional_policy(`
-	xserver_domtrans(unconfined_t)
-')
-
 ########################################
 #
 # Unconfined Execmem Local policy
Signature · 1 line
1.8.3.1
#87 lore raw

PATCH 39/39 unconfined: Do not domain transition to xserver_t (unconfined_t is xserver_unconfined)

Quoted 13 lines · Dominick Grift

It would not be sufficient in the current shape anyways because unconfined_r is not associated with xserver_t

---
 policy/modules/system/unconfined.te | 4 ----
 1 file changed, 4 deletions(-)
policy/modules/system/unconfined.te +0 -0
index 4e4a4c5..bb1696d 100644

policy/modules/system/unconfined.te optional_policy(` · line 203

Quoted 10 lines
policy/modules/system/unconfined.te +0 -4
@@ -198,10 +198,6 @@ optional_policy(`
 	wine_domtrans(unconfined_t)
 ')
 
-optional_policy(`
-	xserver_domtrans(unconfined_t)
-')
-
 ########################################
 #
 # Unconfined Execmem Local policy

Merged.

Signature · 3 lines
Chris PeBenito
Tresys Technology, LLC
www.tresys.com | oss.tresys.com
#88 lore raw

PATCH 1/39 mount: fs_list_auto_mountpoint() is now redundant because autofs_t is covered by files_list_all_mountpoints()

In reply to Dominick Grift
Quoted 10 lines · Dominick Grift
---
 policy/modules/system/mount.te | 1 -
 1 file changed, 1 deletion(-)
policy/modules/system/mount.te +0 -0
index 459a0ef..ea1016d 100644

policy/modules/system/mount.te fs_mount_all_fs(mount_t) · line 112

Quoted 7 lines
policy/modules/system/mount.te +0 -1
@@ -107,7 +107,6 @@ fs_mount_all_fs(mount_t)
 fs_unmount_all_fs(mount_t)
 fs_remount_all_fs(mount_t)
 fs_relabelfrom_all_fs(mount_t)
-fs_list_auto_mountpoints(mount_t)
 fs_rw_tmpfs_chr_files(mount_t)
 fs_read_tmpfs_symlinks(mount_t)
 fs_dontaudit_write_tmpfs_dirs(mount_t)

Merged.

Signature · 3 lines
Chris PeBenito
Tresys Technology, LLC
www.tresys.com | oss.tresys.com