aboutsummaryrefslogtreecommitdiff
blob: c2349ecf53cfdeb33101679bafcd3202bcc5e598 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
## <summary>Dump topology and locality information from hardware tables.</summary>

########################################
## <summary>
##	Execute hwloc dhwd in the hwloc dhwd domain.
## </summary>
## <param name="domain">
##	<summary>
##	Domain allowed to transition.
##	</summary>
## </param>
#
interface(`hwloc_domtrans_dhwd',`
	gen_require(`
		type hwloc_dhwd_t, hwloc_dhwd_exec_t;
	')

	domtrans_pattern($1, hwloc_dhwd_exec_t, hwloc_dhwd_t)
')

########################################
## <summary>
##	Execute hwloc dhwd in the hwloc dhwd domain, and
##	allow the specified role the hwloc dhwd domain,
## </summary>
## <param name="domain">
##	<summary>
##	Domain allowed to transition.
##	</summary>
## </param>
## <param name="role">
##	<summary>
##	Role allowed access.
##	</summary>
## </param>
## <rolecap/>
#
interface(`hwloc_run_dhwd',`
	gen_require(`
		attribute_role hwloc_dhwd_roles;
	')

	hwloc_domtrans_dhwd($1)
	roleattribute $2 hwloc_dhwd_roles;
')

########################################
## <summary>
##	Execute hwloc dhwd in the caller domain.
## </summary>
## <param name="domain">
##	<summary>
##	Domain allowed access.
##	</summary>
## </param>
#
interface(`hwloc_exec_dhwd',`
	gen_require(`
		type hwloc_dhwd_exec_t;
	')

	can_exec($1, hwloc_dhwd_exec_t)
')

########################################
## <summary>
##	Read hwloc runtime files.
## </summary>
## <param name="domain">
##	<summary>
##	Domain allowed access.
##	</summary>
## </param>
#
interface(`hwloc_read_runtime_files',`
	gen_require(`
		type hwloc_var_run_t;
	')

	files_search_pids($1)
	read_files_pattern($1, hwloc_var_run_t, hwloc_var_run_t)
')

########################################
## <summary>
##	All of the rules required to
##	administrate an hwloc environment.
## </summary>
## <param name="domain">
##	<summary>
##	Domain allowed access.
##	</summary>
## </param>
## <rolecap/>
#
interface(`hwloc_admin',`
	gen_require(`
		type hwloc_dhwd_t, hwloc_var_run_t;
	')

	allow $1 hwloc_dhwd_t:process { ptrace signal_perms };
	ps_process_pattern($1, hwloc_dhwd_t)

	admin_pattern($1, hwloc_var_run_t)
	files_pid_filetrans($1, hwloc_var_run_t, dir, "hwloc")
')