From: david@hardeman.nu
To: selinux@tycho.nsa.gov
Subject: [patch 10/35] qemu policy update
Date: Mon, 04 Aug 2008 14:35:06 +0200 [thread overview]
Message-ID: <20080804123736.226368715@hardeman.nu> (raw)
In-Reply-To: 20080804123456.679565839@hardeman.nu
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain, Size: 6201 bytes --]
None of these changes seem controversial, mostly a couple of new
interfaces, note that this patch relies on the xen patch.
Originally submitted Jul 19
Index: refpolicy/policy/modules/apps/qemu.if
===================================================================
--- refpolicy.orig/policy/modules/apps/qemu.if 2008-08-03 13:09:35.000000000 +0200
+++ refpolicy/policy/modules/apps/qemu.if 2008-08-03 17:17:33.000000000 +0200
@@ -104,7 +104,71 @@
########################################
## <summary>
-## Execute a domain transition to run qemu unconfined.
+## Execute qemu programs in the qemu domain.
+## </summary>
+## <param name="domain">
+## <summary>
+## Domain allowed access.
+## </summary>
+## </param>
+## <param name="role">
+## <summary>
+## The role to allow the PAM domain.
+## </summary>
+## </param>
+## <param name="terminal">
+## <summary>
+## The type of the terminal allow the PAM domain to use.
+## </summary>
+## </param>
+#
+interface(`qemu_runas',`
+ gen_require(`
+ type qemu_t;
+ ')
+
+ qemu_domtrans($1)
+ allow qemu_t $3:chr_file rw_file_perms;
+')
+
+########################################
+## <summary>
+## Execute qemu programs in the role.
+## </summary>
+## <param name="role">
+## <summary>
+## The role to allow the PAM domain.
+## </summary>
+## </param>
+#
+interface(`qemu_role',`
+ gen_require(`
+ type qemu_t;
+ ')
+ role $1 types qemu_t;
+')
+
+########################################
+## <summary>
+## Execute qemu unconfined programs in the role.
+## </summary>
+## <param name="role">
+## <summary>
+## The role to allow the PAM domain.
+## </summary>
+## </param>
+#
+interface(`qemu_unconfined_role',`
+ gen_require(`
+ type qemu_unconfined_t;
+ ')
+ role $1 types qemu_unconfined_t;
+')
+
+
+########################################
+## <summary>
+## Execute a domain transition to run qemu.
## </summary>
## <param name="domain">
## <summary>
@@ -122,6 +186,36 @@
########################################
## <summary>
+## Execute qemu programs in the qemu unconfined domain.
+## </summary>
+## <param name="domain">
+## <summary>
+## Domain allowed access.
+## </summary>
+## </param>
+## <param name="role">
+## <summary>
+## The role to allow the PAM domain.
+## </summary>
+## </param>
+## <param name="terminal">
+## <summary>
+## The type of the terminal allow the PAM domain to use.
+## </summary>
+## </param>
+#
+interface(`qemu_runas_unconfined',`
+ gen_require(`
+ type qemu_unconfined_t;
+ ')
+
+ qemu_domtrans_unconfined($1)
+ allow qemu_unconfined_t $3:chr_file rw_file_perms;
+')
+
+
+########################################
+## <summary>
## Creates types and rules for a basic
## qemu process domain.
## </summary>
@@ -133,24 +227,23 @@
#
template(`qemu_domain_template',`
- ##############################
- #
- # Local Policy
- #
-
type $1_t;
domain_type($1_t)
type $1_tmp_t;
files_tmp_file($1_tmp_t)
+ type $1_tmpfs_t;
+ files_tmpfs_file($1_tmpfs_t)
+
##############################
#
# Local Policy
#
allow $1_t self:capability { dac_read_search dac_override };
- allow $1_t self:process { execstack execmem signal getsched };
+ allow $1_t self:process { execstack execmem signal getsched signull };
+
allow $1_t self:fifo_file rw_file_perms;
allow $1_t self:shm create_shm_perms;
allow $1_t self:unix_stream_socket create_stream_socket_perms;
@@ -160,6 +253,11 @@
manage_files_pattern($1_t, $1_tmp_t, $1_tmp_t)
files_tmp_filetrans($1_t, $1_tmp_t, { file dir })
+ manage_dirs_pattern($1_t, $1_tmpfs_t, $1_tmpfs_t)
+ manage_files_pattern($1_t, $1_tmpfs_t, $1_tmpfs_t)
+ manage_lnk_files_pattern($1_t, $1_tmpfs_t, $1_tmpfs_t)
+ fs_tmpfs_filetrans($1_t, $1_tmpfs_t, { dir file lnk_file })
+
kernel_read_system_state($1_t)
corenet_all_recvfrom_unlabeled($1_t)
@@ -171,7 +269,10 @@
corenet_tcp_bind_vnc_port($1_t)
corenet_rw_tun_tap_dev($1_t)
-# dev_rw_kvm($1_t)
+ dev_read_sound($1_t)
+ dev_write_sound($1_t)
+ dev_rw_kvm($1_t)
+ dev_rw_qemu($1_t)
domain_use_interactive_fds($1_t)
@@ -191,6 +292,8 @@
term_getattr_pty_fs($1_t)
term_use_generic_ptys($1_t)
+ auth_use_nsswitch($1_t)
+
libs_use_ld_so($1_t)
libs_use_shared_libs($1_t)
@@ -198,9 +301,9 @@
sysnet_read_config($1_t)
-# optional_policy(`
-# samba_domtrans_smb($1_t)
-# ')
+ optional_policy(`
+ samba_domtrans_smb($1_t)
+ ')
optional_policy(`
virt_manage_images($1_t)
@@ -212,6 +315,24 @@
xserver_stream_connect_xdm_xserver($1_t)
xserver_read_xdm_tmp_files($1_t)
xserver_read_xdm_pid($1_t)
-# xserver_xdm_rw_shm($1_t)
+ xserver_xdm_rw_shm($1_t)
')
')
+
+########################################
+## <summary>
+## Set the schedule on qemu.
+## </summary>
+## <param name="domain">
+## <summary>
+## Domain allowed access.
+## </summary>
+## </param>
+#
+interface(`qemu_setsched',`
+ gen_require(`
+ type qemu_t;
+ ')
+
+ allow $1 qemu_t:process setsched;
+')
Index: refpolicy/policy/modules/apps/qemu.te
===================================================================
--- refpolicy.orig/policy/modules/apps/qemu.te 2008-08-03 13:09:35.000000000 +0200
+++ refpolicy/policy/modules/apps/qemu.te 2008-08-03 17:17:33.000000000 +0200
@@ -13,6 +13,20 @@
## </desc>
gen_tunable(qemu_full_network, false)
+## <desc>
+## <p>
+## Allow qemu to use nfs file systems
+## </p>
+## </desc>
+gen_tunable(qemu_use_nfs, true)
+
+## <desc>
+## <p>
+## Allow qemu to use cifs/Samba file systems
+## </p>
+## </desc>
+gen_tunable(qemu_use_cifs, true)
+
type qemu_exec_t;
qemu_domain_template(qemu)
application_domain(qemu_t, qemu_exec_t)
@@ -35,6 +49,22 @@
corenet_tcp_connect_all_ports(qemu_t)
')
+tunable_policy(`qemu_use_nfs',`
+ fs_manage_nfs_files(qemu_t)
+')
+
+tunable_policy(`qemu_use_cifs',`
+ fs_manage_cifs_dirs(qemu_t)
+')
+
+optional_policy(`
+ xen_rw_image_files(qemu_t)
+')
+
+optional_policy(`
+ xen_rw_image_files(qemu_t)
+')
+
########################################
#
# qemu_unconfined local policy
--
David Härdeman
--
This message was distributed to subscribers of the selinux mailing list.
If you no longer wish to subscribe, send mail to majordomo@tycho.nsa.gov with
the words "unsubscribe selinux" without quotes as the message.
next prev parent reply other threads:[~2008-08-04 12:40 UTC|newest]
Thread overview: 89+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-08-04 12:34 [patch 00/35] Second round of Fedora/RedHat SELinux changes david
2008-08-04 12:34 ` [patch 01/35] anaconda policy update david
2008-08-07 14:22 ` Christopher J. PeBenito
2008-08-04 12:34 ` [patch 02/35] kudzu " david
2008-08-14 14:25 ` Christopher J. PeBenito
2008-08-04 12:34 ` [patch 03/35] logrotate " david
2008-08-14 13:26 ` Christopher J. PeBenito
2008-08-04 12:35 ` [patch 04/35] corenetwork " david
2008-08-21 14:40 ` Christopher J. PeBenito
2008-08-21 14:41 ` [refpolicy] " Christopher J. PeBenito
2008-08-25 17:25 ` [refpolicy] cyphesis policy Daniel J Walsh
2008-09-03 14:44 ` Christopher J. PeBenito
2008-08-25 17:29 ` [refpolicy] nsplugin policy Daniel J Walsh
2008-08-25 17:40 ` [refpolicy] Updated kerberos patch to add kprop port definition Daniel J Walsh
2008-08-25 17:44 ` [refpolicy] Updated munin support Daniel J Walsh
2008-08-25 17:52 ` [refpolicy] [patch 04/35] corenetwork policy update Daniel J Walsh
2008-09-03 14:44 ` Christopher J. PeBenito
2008-08-04 12:35 ` [patch 05/35] courier " david
2008-08-14 14:25 ` Christopher J. PeBenito
2008-08-04 12:35 ` [patch 06/35] soundserver " david
2008-08-07 13:33 ` Christopher J. PeBenito
2008-08-07 15:09 ` Daniel J Walsh
2008-08-11 13:18 ` Christopher J. PeBenito
2008-08-11 14:15 ` Daniel J Walsh
2008-08-11 14:19 ` Daniel J Walsh
2008-08-11 14:22 ` Daniel J Walsh
2008-08-04 12:35 ` [patch 07/35] w3c policy addition david
2008-08-21 14:00 ` [refpolicy] " Christopher J. PeBenito
2008-08-04 12:35 ` [patch 08/35] logging policy update david
2008-08-22 15:25 ` [refpolicy] " Christopher J. PeBenito
2008-08-04 12:35 ` [patch 09/35] xen " david
2008-08-04 12:35 ` david [this message]
2008-08-04 12:35 ` [patch 11/35] hotplug " david
2008-08-07 14:23 ` Christopher J. PeBenito
2008-08-04 12:35 ` [patch 12/35] getty " david
2008-08-14 14:25 ` Christopher J. PeBenito
2008-08-04 12:35 ` [patch 13/35] ricci " david
2008-08-07 14:22 ` Christopher J. PeBenito
2008-08-04 12:35 ` [patch 14/35] remotelogin " david
2008-08-14 13:44 ` Christopher J. PeBenito
2008-08-04 12:35 ` [patch 15/35] kernel terminal " david
2008-08-07 13:46 ` Christopher J. PeBenito
2008-08-04 12:35 ` [patch 16/35] usernet policy updates david
2008-08-07 14:22 ` Christopher J. PeBenito
2008-08-04 12:35 ` [patch 17/35] brctl policy update david
2008-08-07 13:47 ` Christopher J. PeBenito
2008-08-07 15:11 ` Daniel J Walsh
2008-08-11 13:20 ` Christopher J. PeBenito
2008-08-04 12:35 ` [patch 18/35] fsadm " david
2008-08-07 13:49 ` Christopher J. PeBenito
2008-08-07 14:10 ` Problem with MLS because /dev is labeled tmpfs_t Dennis Wronka
2008-08-08 2:00 ` Russell Coker
2008-08-09 8:49 ` Dennis Wronka
2008-08-04 12:35 ` [patch 19/35] kernel storage module policy updates david
2008-08-07 14:22 ` Christopher J. PeBenito
2008-08-04 12:35 ` [patch 20/35] rpc policy update david
2008-08-14 14:25 ` Christopher J. PeBenito
2008-08-04 12:35 ` [patch 21/35] kismet " david
2008-08-07 14:22 ` Christopher J. PeBenito
2008-08-04 12:35 ` [patch 22/35] oav policy updates david
2008-08-07 14:22 ` Christopher J. PeBenito
2008-08-04 12:35 ` [patch 23/35] iptables policy update david
2008-08-12 19:57 ` Christopher J. PeBenito
2008-08-04 12:35 ` [patch 24/35] bootloader policy updates david
2008-08-14 14:25 ` Christopher J. PeBenito
2008-08-04 12:35 ` [patch 25/35] rdisc policy update david
2008-08-14 14:25 ` Christopher J. PeBenito
2008-08-04 12:35 ` [patch 26/35] stunnel " david
2008-08-07 14:22 ` Christopher J. PeBenito
2008-08-04 12:35 ` [patch 27/35] inetd " david
2008-08-11 13:50 ` Christopher J. PeBenito
2008-08-04 12:35 ` [patch 28/35] iscsi " david
2008-08-11 14:09 ` Christopher J. PeBenito
2008-08-04 12:35 ` [patch 29/35] ipsec " david
2008-08-11 14:08 ` Christopher J. PeBenito
2008-08-04 12:35 ` [patch 30/35] fetchmail " david
2008-08-07 14:22 ` Christopher J. PeBenito
2008-08-04 12:35 ` [patch 31/35] amanda " david
2008-08-07 14:22 ` Christopher J. PeBenito
2008-08-04 12:35 ` [patch 32/35] rsync " david
2008-08-07 14:22 ` Christopher J. PeBenito
2008-08-04 12:35 ` [patch 33/35] mailscanner policy addition david
2008-08-21 14:06 ` [refpolicy] " Christopher J. PeBenito
2008-08-25 17:18 ` Daniel J Walsh
2008-09-05 12:54 ` Christopher J. PeBenito
2008-09-05 13:57 ` Daniel J Walsh
2008-08-04 12:35 ` [patch 34/35] qmail policy update david
2008-08-11 14:08 ` Christopher J. PeBenito
2008-08-04 12:35 ` [patch 35/35] livecd policy addition david
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20080804123736.226368715@hardeman.nu \
--to=david@hardeman.nu \
--cc=selinux@tycho.nsa.gov \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.