Chris PeBenito 23a444
Chris PeBenito 23a444
policy_module(xdm,1.0)
Chris PeBenito 23a444
Chris PeBenito 23a444
########################################
Chris PeBenito 23a444
#
Chris PeBenito 23a444
# Declarations
Chris PeBenito 23a444
#
Chris PeBenito 23a444
Chris PeBenito 375c24
ifdef(`targeted_policy',`
Chris PeBenito 375c24
	unconfined_alias_domain(xdm_t)
Chris PeBenito 375c24
',`
Chris PeBenito 375c24
	type xdm_t;
Chris PeBenito 23a444
')
Chris PeBenito 23a444
Chris PeBenito 23a444
# real declaration moved to mls until
Chris PeBenito 23a444
# range_transition works in loadable modules
Chris PeBenito 23a444
gen_require(`
Chris PeBenito 23a444
	type xdm_exec_t;
Chris PeBenito 23a444
')
Chris PeBenito 23a444
init_domain(xdm_t,xdm_exec_t)
Chris PeBenito 23a444
init_daemon_domain(xdm_t,xdm_exec_t)
Chris PeBenito 23a444
Chris PeBenito 23a444
type xsession_exec_t;
Chris PeBenito 23a444
files_type(xsession_exec_t)
Chris PeBenito 23a444
Chris PeBenito d1b9d9
# temp:
Chris PeBenito d1b9d9
typeattribute xsession_exec_t entry_type;
Chris PeBenito d1b9d9
Chris PeBenito 23a444
type xserver_log_t;
Chris PeBenito 23a444
files_type(xserver_log_t)
Chris PeBenito 23a444
Chris PeBenito 23a444
type xdm_xserver_tmp_t;
Chris PeBenito 23a444
files_type(xdm_xserver_tmp_t)
Chris PeBenito 23a444
Chris PeBenito 23a444
type xdm_lock_t;
Chris PeBenito 23a444
files_lock_file(xdm_lock_t)
Chris PeBenito 23a444
Chris PeBenito 23a444
type xdm_rw_etc_t;
Chris PeBenito 23a444
files_type(xdm_rw_etc_t)
Chris PeBenito 23a444
Chris PeBenito 23a444
type xdm_var_run_t;
Chris PeBenito 23a444
files_type(xdm_var_run_t)
Chris PeBenito 23a444
Chris PeBenito 23a444
type xdm_var_lib_t;
Chris PeBenito 23a444
files_type(xdm_var_lib_t)
Chris PeBenito 23a444
Chris PeBenito 23a444
type xdm_tmp_t;
Chris PeBenito 23a444
files_tmp_file(xdm_tmp_t)
Chris PeBenito 23a444
Chris PeBenito 23a444
type xdm_tmpfs_t;
Chris PeBenito 23a444
files_tmpfs_file(xdm_tmpfs_t)
Chris PeBenito 23a444
Chris PeBenito 23a444
########################################
Chris PeBenito 23a444
#
Chris PeBenito 23a444
# Local policy
Chris PeBenito 23a444
#
Chris PeBenito 23a444
Chris PeBenito f3936d
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 };
Chris PeBenito f3936d
allow xdm_t self:process { setexec setpgid setsched setrlimit };
Chris PeBenito f3936d
allow xdm_t self:fifo_file rw_file_perms;
Chris PeBenito f3936d
allow xdm_t self:shm create_shm_perms;
Chris PeBenito f3936d
allow xdm_t self:unix_stream_socket { connectto create_stream_socket_perms };
Chris PeBenito f3936d
allow xdm_t self:unix_dgram_socket create_socket_perms;
Chris PeBenito cac3ec
Chris PeBenito f3936d
kernel_read_system_state(xdm_t)
Chris PeBenito f3936d
kernel_read_kernel_sysctl(xdm_t)
Chris PeBenito f3936d
Chris PeBenito f3936d
dev_read_rand(xdm_t)
Chris PeBenito f3936d
dev_read_urand(xdm_t)
Chris PeBenito f3936d
Chris PeBenito f3936d
selinux_get_fs_mount(xdm_t)
Chris PeBenito f3936d
selinux_validate_context(xdm_t)
Chris PeBenito f3936d
selinux_compute_access_vector(xdm_t)
Chris PeBenito f3936d
selinux_compute_create_context(xdm_t)
Chris PeBenito f3936d
selinux_compute_relabel_context(xdm_t)
Chris PeBenito f3936d
selinux_compute_user_contexts(xdm_t)
Chris PeBenito f3936d
Chris PeBenito f3936d
files_read_etc_runtime_files(xdm_t)
Chris PeBenito f3936d
Chris PeBenito f3936d
ifdef(`targeted_policy',`
Chris PeBenito f3936d
	unconfined_domain_template(xdm_t)
Chris PeBenito f3936d
',`
Chris PeBenito cac3ec
	allow xdm_t xdm_lock_t:file create_file_perms;
Chris PeBenito cac3ec
	files_create_lock(xdm_t,xdm_lock_t)
Chris PeBenito cac3ec
Chris PeBenito cac3ec
	allow xdm_t xdm_tmp_t:dir create_dir_perms;
Chris PeBenito cac3ec
	allow xdm_t xdm_tmp_t:file create_file_perms;
Chris PeBenito cac3ec
	allow xdm_t xdm_tmp_t:file create_file_perms;
Chris PeBenito cac3ec
	files_create_tmp_files(xdm_t, xdm_tmp_t, { file dir sock_file })
Chris PeBenito cac3ec
Chris PeBenito cac3ec
	allow xdm_t xdm_tmpfs_t:dir { read getattr lock search ioctl add_name remove_name write };
Chris PeBenito cac3ec
	allow xdm_t xdm_tmpfs_t:file { create ioctl read getattr lock write setattr append link unlink rename };
Chris PeBenito cac3ec
	allow xdm_t xdm_tmpfs_t:lnk_file { create read getattr setattr link unlink rename };
Chris PeBenito cac3ec
	allow xdm_t xdm_tmpfs_t:sock_file { create ioctl read getattr lock write setattr append link unlink rename };
Chris PeBenito cac3ec
	allow xdm_t xdm_tmpfs_t:fifo_file { create ioctl read getattr lock write setattr append link unlink rename };
Chris PeBenito cac3ec
	fs_create_tmpfs_data(xdm_t,xdm_tmpfs_t,{ dir file lnk_file sock_file fifo_file })
Chris PeBenito cac3ec
Chris PeBenito cac3ec
	allow xdm_t xdm_var_lib_t:file create_file_perms;
Chris PeBenito cac3ec
	allow xdm_t xdm_var_lib_t:dir create_dir_perms;
Chris PeBenito cac3ec
	files_create_var_lib(xdm_t,xdm_var_lib_t)
Chris PeBenito f3936d
')
Chris PeBenito f3936d
Chris PeBenito f3936d
ifdef(`TODO',`
Chris PeBenito f3936d
# cjp: TODO: integrate strict policy:
Chris PeBenito f3936d
daemon_domain(xdm, `, privuser, privrole, auth_chkpwd, privowner, privmem, nscd_client_domain')
Chris PeBenito f3936d
Chris PeBenito f3936d
allow xdm_t xdm_var_run_t:dir setattr;
Chris PeBenito f3936d
Chris PeBenito f3936d
# for xdmctl
Chris PeBenito f3936d
allow xdm_t xdm_var_run_t:fifo_file create_file_perms;
Chris PeBenito f3936d
allow initrc_t xdm_var_run_t:fifo_file unlink;
Chris PeBenito f3936d
file_type_auto_trans(xdm_t, var_run_t, xdm_var_run_t, fifo_file)
Chris PeBenito f3936d
file_type_auto_trans(xdm_t, var_run_t, xdm_var_run_t, dir)
Chris PeBenito f3936d
Chris PeBenito f3936d
# NB we do NOT allow xdm_xserver_t xdm_var_lib_t:dir, only access to an open
Chris PeBenito f3936d
# handle of a file inside the dir!!!
Chris PeBenito f3936d
allow xdm_xserver_t xdm_var_lib_t:file { getattr read };
Chris PeBenito f3936d
dontaudit xdm_xserver_t xdm_var_lib_t:dir search;
Chris PeBenito f3936d
allow xdm_xserver_t xdm_var_run_t:file { getattr read };
Chris PeBenito f3936d
Chris PeBenito f3936d
allow xdm_t default_context_t:dir search;
Chris PeBenito f3936d
allow xdm_t default_context_t:{ file lnk_file } { read getattr };
Chris PeBenito f3936d
Chris PeBenito f3936d
can_network(xdm_t)
Chris PeBenito f3936d
allow xdm_t port_type:tcp_socket name_connect;
Chris PeBenito f3936d
Chris PeBenito f3936d
allow xdm_t xdm_xserver_tmp_t:dir r_dir_perms;
Chris PeBenito f3936d
allow xdm_t xdm_xserver_t:process signal;
Chris PeBenito f3936d
can_unix_connect(xdm_t, xdm_xserver_t)
Chris PeBenito f3936d
allow xdm_t xdm_xserver_tmp_t:sock_file rw_file_perms;
Chris PeBenito f3936d
allow xdm_t xdm_xserver_tmp_t:dir { setattr r_dir_perms };
Chris PeBenito f3936d
allow xdm_xserver_t xdm_t:process signal;
Chris PeBenito f3936d
# for reboot
Chris PeBenito f3936d
allow xdm_t initctl_t:fifo_file write;
Chris PeBenito f3936d
Chris PeBenito f3936d
# init script wants to check if it needs to update windowmanagerlist
Chris PeBenito f3936d
allow initrc_t xdm_rw_etc_t:file { getattr read };
Chris PeBenito f3936d
ifdef(`distro_suse', `
Chris PeBenito f3936d
# set permissions on /tmp/.X11-unix
Chris PeBenito f3936d
allow initrc_t xdm_tmp_t:dir setattr;
Chris PeBenito f3936d
')
Chris PeBenito f3936d
Chris PeBenito f3936d
# Transition to user domains for user sessions.
Chris PeBenito f3936d
domain_trans(xdm_t, xsession_exec_t, unpriv_userdomain)
Chris PeBenito f3936d
allow unpriv_userdomain xdm_xserver_t:unix_stream_socket connectto;
Chris PeBenito f3936d
allow unpriv_userdomain xdm_xserver_t:shm r_shm_perms;
Chris PeBenito f3936d
allow unpriv_userdomain xdm_xserver_t:fd use;
Chris PeBenito f3936d
allow unpriv_userdomain xdm_xserver_tmpfs_t:file { getattr read };
Chris PeBenito f3936d
allow xdm_xserver_t unpriv_userdomain:shm rw_shm_perms;
Chris PeBenito f3936d
allow xdm_xserver_t unpriv_userdomain:fd use;
Chris PeBenito f3936d
Chris PeBenito f3936d
# Do not audit user access to the X log files due to file handle inheritance
Chris PeBenito f3936d
dontaudit unpriv_userdomain xserver_log_t:file { write append };
Chris PeBenito f3936d
Chris PeBenito f3936d
# gnome-session creates socket under /tmp/.ICE-unix/
Chris PeBenito f3936d
allow unpriv_userdomain xdm_tmp_t:dir rw_dir_perms;
Chris PeBenito f3936d
allow unpriv_userdomain xdm_tmp_t:sock_file create;
Chris PeBenito f3936d
Chris PeBenito f3936d
# Allow xdm logins as sysadm_r:sysadm_t
Chris PeBenito f3936d
bool xdm_sysadm_login false;
Chris PeBenito f3936d
if (xdm_sysadm_login) {
Chris PeBenito f3936d
domain_trans(xdm_t, xsession_exec_t, sysadm_t)
Chris PeBenito f3936d
allow sysadm_t xdm_xserver_t:unix_stream_socket connectto;
Chris PeBenito f3936d
allow sysadm_t xdm_xserver_t:shm r_shm_perms;
Chris PeBenito f3936d
allow sysadm_t xdm_xserver_t:fd use;
Chris PeBenito f3936d
allow sysadm_t xdm_xserver_tmpfs_t:file { getattr read };
Chris PeBenito f3936d
allow xdm_xserver_t sysadm_t:shm rw_shm_perms;
Chris PeBenito f3936d
allow xdm_xserver_t sysadm_t:fd use;
Chris PeBenito f3936d
}
Chris PeBenito f3936d
Chris PeBenito f3936d
# Label pid and temporary files with derived types.
Chris PeBenito f3936d
rw_dir_create_file(xdm_xserver_t, xdm_tmp_t)
Chris PeBenito f3936d
allow xdm_xserver_t xdm_tmp_t:sock_file create_file_perms;
Chris PeBenito f3936d
Chris PeBenito f3936d
# Run helper programs.
Chris PeBenito f3936d
allow xdm_t etc_t:file { getattr read };
Chris PeBenito f3936d
allow xdm_t bin_t:dir { getattr search };
Chris PeBenito f3936d
# lib_t is for running cpp
Chris PeBenito f3936d
can_exec(xdm_t, { shell_exec_t etc_t bin_t sbin_t lib_t })
Chris PeBenito f3936d
allow xdm_t { bin_t sbin_t }:lnk_file read;
Chris PeBenito f3936d
ifdef(`hostname.te', `can_exec(xdm_t, hostname_exec_t)')
Chris PeBenito f3936d
ifdef(`loadkeys.te', `can_exec(xdm_t, loadkeys_exec_t)')
Chris PeBenito f3936d
allow xdm_t xdm_xserver_t:process sigkill;
Chris PeBenito f3936d
allow xdm_t xdm_xserver_tmp_t:file unlink;
Chris PeBenito f3936d
Chris PeBenito f3936d
# Access devices.
Chris PeBenito f3936d
allow xdm_t device_t:dir { read search };
Chris PeBenito f3936d
allow xdm_t console_device_t:chr_file setattr;
Chris PeBenito f3936d
allow xdm_t xconsole_device_t:fifo_file { getattr setattr };
Chris PeBenito f3936d
allow xdm_t framebuf_device_t:chr_file { getattr setattr };
Chris PeBenito f3936d
allow xdm_t mouse_device_t:chr_file { getattr setattr };
Chris PeBenito f3936d
allow xdm_t apm_bios_t:chr_file { setattr getattr read write };
Chris PeBenito f3936d
allow xdm_t dri_device_t:chr_file rw_file_perms;
Chris PeBenito f3936d
allow xdm_t device_t:dir rw_dir_perms;
Chris PeBenito f3936d
allow xdm_t agp_device_t:chr_file rw_file_perms;
Chris PeBenito f3936d
allow xdm_t { xserver_misc_device_t misc_device_t }:chr_file { setattr getattr };
Chris PeBenito f3936d
allow xdm_t v4l_device_t:chr_file { setattr getattr };
Chris PeBenito f3936d
allow xdm_t scanner_device_t:chr_file { setattr getattr };
Chris PeBenito f3936d
allow xdm_t tty_device_t:chr_file { ioctl read write setattr getattr };
Chris PeBenito f3936d
allow xdm_t device_t:lnk_file read;
Chris PeBenito f3936d
can_resmgrd_connect(xdm_t)
Chris PeBenito f3936d
Chris PeBenito f3936d
# Access xdm log files.
Chris PeBenito f3936d
file_type_auto_trans(xdm_t, var_log_t, xserver_log_t, file)
Chris PeBenito f3936d
allow xdm_t xserver_log_t:dir rw_dir_perms;
Chris PeBenito f3936d
allow xdm_t xserver_log_t:dir setattr;
Chris PeBenito f3936d
# Access /var/gdm/.gdmfifo.
Chris PeBenito f3936d
allow xdm_t xserver_log_t:fifo_file create_file_perms;
Chris PeBenito f3936d
Chris PeBenito f3936d
allow { xdm_t unpriv_userdomain } xdm_xserver_t:unix_stream_socket connectto;
Chris PeBenito f3936d
allow { xdm_t unpriv_userdomain } xdm_xserver_t:shm rw_shm_perms;
Chris PeBenito f3936d
allow { xdm_t unpriv_userdomain } xdm_xserver_t:fd use;
Chris PeBenito f3936d
allow { xdm_t unpriv_userdomain } xdm_xserver_tmpfs_t:file { getattr read };
Chris PeBenito f3936d
allow xdm_xserver_t { xdm_t unpriv_userdomain }:shm rw_shm_perms;
Chris PeBenito f3936d
allow xdm_xserver_t { xdm_t unpriv_userdomain }:fd use;
Chris PeBenito f3936d
Chris PeBenito f3936d
# Remove /tmp/.X11-unix/X0.
Chris PeBenito f3936d
allow xdm_t xdm_xserver_tmp_t:dir { remove_name write };
Chris PeBenito f3936d
allow xdm_t xdm_xserver_tmp_t:sock_file unlink;
Chris PeBenito f3936d
Chris PeBenito f3936d
ifdef(`gpm.te', `
Chris PeBenito f3936d
# Talk to the console mouse server.
Chris PeBenito f3936d
allow xdm_t gpmctl_t:sock_file { getattr setattr write };
Chris PeBenito f3936d
allow xdm_t gpm_t:unix_stream_socket connectto;
Chris PeBenito f3936d
')
Chris PeBenito f3936d
Chris PeBenito f3936d
allow xdm_t sysfs_t:dir search;
Chris PeBenito f3936d
Chris PeBenito f3936d
# Update utmp and wtmp.
Chris PeBenito f3936d
allow xdm_t initrc_var_run_t: file { read write lock };
Chris PeBenito f3936d
allow xdm_t wtmp_t:file append;
Chris PeBenito f3936d
Chris PeBenito f3936d
# Update lastlog.
Chris PeBenito f3936d
allow xdm_t lastlog_t:file rw_file_perms;
Chris PeBenito f3936d
Chris PeBenito f3936d
# Need to further investigate these permissions and
Chris PeBenito f3936d
# perhaps define derived types.
Chris PeBenito f3936d
allow xdm_t var_lib_t:dir { write search add_name remove_name  create unlink };
Chris PeBenito f3936d
allow xdm_t var_lib_t:file { create write unlink };
Chris PeBenito f3936d
Chris PeBenito f3936d
# Connect to xfs.
Chris PeBenito f3936d
ifdef(`xfs.te', `
Chris PeBenito f3936d
allow xdm_t xfs_tmp_t:dir search;
Chris PeBenito f3936d
allow xdm_t xfs_tmp_t:sock_file write;
Chris PeBenito f3936d
can_unix_connect(xdm_t, xfs_t)
Chris PeBenito f3936d
')
Chris PeBenito f3936d
Chris PeBenito f3936d
allow xdm_t etc_t:lnk_file read;
Chris PeBenito f3936d
Chris PeBenito f3936d
# wdm has its own config dir /etc/X11/wdm
Chris PeBenito f3936d
# this is ugly, daemons should not create files under /etc!
Chris PeBenito f3936d
allow xdm_t xdm_rw_etc_t:dir rw_dir_perms;
Chris PeBenito f3936d
allow xdm_t xdm_rw_etc_t:file create_file_perms;
Chris PeBenito f3936d
Chris PeBenito f3936d
# Signal any user domain.
Chris PeBenito f3936d
allow xdm_t userdomain:process signal_perms;
Chris PeBenito f3936d
Chris PeBenito f3936d
# Search /proc for any user domain processes.
Chris PeBenito f3936d
allow xdm_t userdomain:dir r_dir_perms;
Chris PeBenito f3936d
allow xdm_t userdomain:{ file lnk_file } r_file_perms;
Chris PeBenito f3936d
Chris PeBenito f3936d
# Allow xdm access to the user domains
Chris PeBenito f3936d
allow xdm_t home_root_t:dir search;
Chris PeBenito f3936d
allow xdm_xserver_t home_root_t:dir search;
Chris PeBenito f3936d
Chris PeBenito f3936d
# Do not audit denied attempts to access devices.
Chris PeBenito f3936d
dontaudit xdm_t {removable_device_t fixed_disk_device_t}:{ chr_file blk_file } {setattr rw_file_perms};
Chris PeBenito f3936d
dontaudit xdm_t device_t:file_class_set rw_file_perms;
Chris PeBenito f3936d
dontaudit xdm_t misc_device_t:file_class_set rw_file_perms;
Chris PeBenito f3936d
dontaudit xdm_t removable_device_t:file_class_set rw_file_perms;
Chris PeBenito f3936d
dontaudit xdm_t scsi_generic_device_t:file_class_set rw_file_perms;
Chris PeBenito f3936d
dontaudit xdm_t devpts_t:dir search;
Chris PeBenito f3936d
Chris PeBenito f3936d
# Do not audit denied probes of /proc.
Chris PeBenito f3936d
dontaudit xdm_t domain:dir r_dir_perms;
Chris PeBenito f3936d
dontaudit xdm_t domain:{ file lnk_file } r_file_perms;
Chris PeBenito f3936d
Chris PeBenito f3936d
# Read /usr/share/terminfo/l/linux and /usr/share/icons/default/index.theme...
Chris PeBenito f3936d
allow xdm_t usr_t:{ lnk_file file } { getattr read };
Chris PeBenito f3936d
Chris PeBenito f3936d
# Read fonts
Chris PeBenito f3936d
read_fonts(xdm_t)
Chris PeBenito f3936d
Chris PeBenito f3936d
# Do not audit attempts to write to index files under /usr
Chris PeBenito f3936d
dontaudit xdm_t usr_t:file write;
Chris PeBenito cac3ec
Chris PeBenito f3936d
# Do not audit access to /root
Chris PeBenito f3936d
dontaudit xdm_t sysadm_home_dir_t:dir { getattr search };
Chris PeBenito f3936d
Chris PeBenito f3936d
# Do not audit user access to the X log files due to file handle inheritance
Chris PeBenito f3936d
dontaudit unpriv_userdomain xserver_log_t:file { write append };
Chris PeBenito f3936d
Chris PeBenito f3936d
# Do not audit attempts to check whether user root has email
Chris PeBenito f3936d
dontaudit xdm_t { var_spool_t mail_spool_t }:dir search;
Chris PeBenito f3936d
dontaudit xdm_t mail_spool_t:file getattr;
Chris PeBenito f3936d
Chris PeBenito f3936d
# Access sound device.
Chris PeBenito f3936d
allow xdm_t sound_device_t:chr_file { setattr getattr };
Chris PeBenito f3936d
Chris PeBenito f3936d
# Allow setting of attributes on power management devices.
Chris PeBenito f3936d
allow xdm_t power_device_t:chr_file { getattr setattr };
Chris PeBenito f3936d
Chris PeBenito f3936d
# Run the X server in a derived domain.
Chris PeBenito f3936d
xserver_domain(xdm)
Chris PeBenito f3936d
Chris PeBenito f3936d
ifdef(`rhgb.te', `
Chris PeBenito f3936d
allow xdm_xserver_t ramfs_t:dir rw_dir_perms;
Chris PeBenito f3936d
allow xdm_xserver_t ramfs_t:file create_file_perms;
Chris PeBenito f3936d
allow rhgb_t xdm_xserver_t:process signal;
Chris PeBenito f3936d
')
Chris PeBenito f3936d
Chris PeBenito f3936d
# Unrestricted inheritance.
Chris PeBenito f3936d
allow xdm_t xdm_xserver_t:process { noatsecure siginh rlimitinh };
Chris PeBenito f3936d
Chris PeBenito f3936d
# Run xkbcomp.
Chris PeBenito f3936d
allow xdm_xserver_t var_lib_t:dir search;
Chris PeBenito f3936d
allow xdm_xserver_t xkb_var_lib_t:lnk_file read;
Chris PeBenito f3936d
can_exec(xdm_xserver_t, xkb_var_lib_t)
Chris PeBenito f3936d
Chris PeBenito f3936d
# Insert video drivers.  
Chris PeBenito f3936d
allow xdm_xserver_t self:capability mknod;
Chris PeBenito f3936d
allow xdm_xserver_t sysctl_modprobe_t:file { getattr read };
Chris PeBenito f3936d
domain_auto_trans(xdm_xserver_t, insmod_exec_t, insmod_t)
Chris PeBenito f3936d
allow insmod_t xserver_log_t:file write;
Chris PeBenito f3936d
allow insmod_t xdm_xserver_t:unix_stream_socket { read write };
Chris PeBenito f3936d
Chris PeBenito f3936d
# Read /proc/dri/.*
Chris PeBenito f3936d
allow xdm_xserver_t proc_t:dir { search read };
Chris PeBenito f3936d
Chris PeBenito f3936d
# Search /var/run.
Chris PeBenito f3936d
allow xdm_xserver_t var_run_t:dir search;
Chris PeBenito f3936d
Chris PeBenito f3936d
# FIXME: After per user fonts are properly working
Chris PeBenito f3936d
# xdm_xserver_t may no longer have any reason
Chris PeBenito f3936d
# to read ROLE_home_t - examine this in more detail
Chris PeBenito f3936d
# (xauth?)
Chris PeBenito f3936d
Chris PeBenito f3936d
# Search home directories.
Chris PeBenito f3936d
allow xdm_xserver_t user_home_type:dir search;
Chris PeBenito f3936d
allow xdm_xserver_t user_home_type:file { getattr read };
Chris PeBenito f3936d
Chris PeBenito f3936d
if (use_nfs_home_dirs) {
Chris PeBenito f3936d
allow { xdm_t xdm_xserver_t } autofs_t:dir { search getattr };
Chris PeBenito f3936d
allow { xdm_t xdm_xserver_t } nfs_t:dir create_dir_perms;
Chris PeBenito f3936d
allow { xdm_t xdm_xserver_t } nfs_t:{file lnk_file} create_file_perms;
Chris PeBenito f3936d
can_exec(xdm_t, nfs_t)
Chris PeBenito f3936d
}
Chris PeBenito f3936d
Chris PeBenito f3936d
if (use_samba_home_dirs) {
Chris PeBenito f3936d
allow { xdm_t xdm_xserver_t } cifs_t:dir create_dir_perms;
Chris PeBenito f3936d
allow { xdm_t xdm_xserver_t } cifs_t:{file lnk_file} create_file_perms;
Chris PeBenito f3936d
can_exec(xdm_t, cifs_t)
Chris PeBenito f3936d
}
Chris PeBenito f3936d
Chris PeBenito f3936d
# for .dmrc
Chris PeBenito f3936d
allow xdm_t user_home_dir_type:dir { getattr search };
Chris PeBenito f3936d
allow xdm_t user_home_type:file { getattr read };
Chris PeBenito f3936d
Chris PeBenito f3936d
ifdef(`support_polyinstatiation', `
Chris PeBenito f3936d
# xdm_t can polyinstantiate
Chris PeBenito f3936d
polyinstantiater(xdm_t)
Chris PeBenito f3936d
# xdm needs access for linking .X11-unix to poly /tmp
Chris PeBenito f3936d
allow xdm_t polymember:dir { add_name remove_name write };
Chris PeBenito f3936d
allow xdm_t polymember:lnk_file { create unlink };
Chris PeBenito f3936d
# xdm needs access for copying .Xauthority into new home
Chris PeBenito f3936d
allow xdm_t polymember:file { create getattr write };
Chris PeBenito f3936d
')
Chris PeBenito f3936d
Chris PeBenito f3936d
allow xdm_t mnt_t:dir { getattr read search };
Chris PeBenito f3936d
#
Chris PeBenito f3936d
# Wants to delete .xsession-errors file
Chris PeBenito f3936d
#
Chris PeBenito f3936d
allow xdm_t user_home_type:file unlink;
Chris PeBenito f3936d
#
Chris PeBenito f3936d
# Should fix exec of pam_timestamp_check is not closing xdm file descriptor
Chris PeBenito f3936d
#
Chris PeBenito f3936d
ifdef(`pam.te', `
Chris PeBenito f3936d
allow xdm_t pam_var_run_t:dir create_dir_perms;
Chris PeBenito f3936d
allow xdm_t pam_var_run_t:file create_file_perms;
Chris PeBenito f3936d
allow pam_t xdm_t:fifo_file { getattr ioctl write };
Chris PeBenito f3936d
domain_auto_trans(xdm_t, pam_console_exec_t, pam_console_t)
Chris PeBenito f3936d
can_exec(xdm_t, pam_exec_t)
Chris PeBenito f3936d
# For pam_console
Chris PeBenito f3936d
rw_dir_create_file(xdm_t, pam_var_console_t)
Chris PeBenito 23a444
')
Chris PeBenito f3936d
Chris PeBenito f3936d
# Pamconsole/alsa 
Chris PeBenito f3936d
ifdef(`alsa.te', `
Chris PeBenito f3936d
domain_auto_trans(xdm_t, alsa_exec_t, alsa_t)
Chris PeBenito f3936d
') dnl ifdef
Chris PeBenito f3936d
Chris PeBenito f3936d
allow xdm_t var_log_t:file { getattr read };
Chris PeBenito f3936d
allow xdm_t wtmp_t:file { getattr read };
Chris PeBenito f3936d
Chris PeBenito f3936d
domain_auto_trans(initrc_t, xserver_exec_t, xdm_xserver_t)
Chris PeBenito f3936d
#
Chris PeBenito f3936d
# Poweroff wants to create the /poweroff file when run from xdm
Chris PeBenito f3936d
#
Chris PeBenito f3936d
file_type_auto_trans(xdm_t, root_t, etc_runtime_t, file)
Chris PeBenito f3936d
Chris PeBenito f3936d
#
Chris PeBenito f3936d
# xdm tries to bind to biff_port_t
Chris PeBenito f3936d
#
Chris PeBenito f3936d
dontaudit xdm_t port_type:tcp_socket name_bind;
Chris PeBenito f3936d
Chris PeBenito f3936d
# VNC v4 module in X server
Chris PeBenito f3936d
allow xdm_xserver_t vnc_port_t:tcp_socket name_bind; 
Chris PeBenito f3936d
ifdef(`crack.te', `
Chris PeBenito f3936d
allow xdm_t crack_db_t:file r_file_perms;
Chris PeBenito f3936d
')
Chris PeBenito f3936d
r_dir_file(xdm_t, selinux_config_t)
Chris PeBenito f3936d
Chris PeBenito f3936d
# Run telinit->init to shutdown.
Chris PeBenito f3936d
can_exec(xdm_t, init_exec_t)
Chris PeBenito f3936d
allow xdm_t self:sem create_sem_perms;
Chris PeBenito f3936d
Chris PeBenito f3936d
# Allow gdm to run gdm-binary
Chris PeBenito f3936d
can_exec(xdm_t, xdm_exec_t)
Chris PeBenito f3936d
Chris PeBenito f3936d
# Supress permission check on .ICE-unix
Chris PeBenito f3936d
dontaudit xdm_t ice_tmp_t:dir { getattr setattr };
Chris PeBenito f3936d
') dnl end TODO