analysing optional policy
I'm having a problem with optional policy not being used when I think it should.
Is it possible to use apol to get information on optional policy for .pp files so I can try to work out why it doesn't get enabled?
unconfined_run_to(depmod_t, depmod_exec_t)
In the Debian policy I have the above in an optional section of base.pp but for reasons that I don't understand it's not being loaded (both tests and running apol on policy.24 show this).
I've inspected the contents of base.conf and they appear to be OK.
Any suggestions of other tools to analyse this will be appreciated.
Signature · 9 lines
[email protected] http://etbe.coker.com.au/ My Main Blog http://doc.coker.com.au/ My Documents Blog -- This message was distributed to subscribers of the selinux mailing list. If you no longer wish to subscribe, send mail to [email protected] with the words "unsubscribe selinux" without quotes as the message.
Quoted 8 lines · Russell Coker
I'm having a problem with optional policy not being used when I think it should.
Is it possible to use apol to get information on optional policy for .pp files so I can try to work out why it doesn't get enabled?
unconfined_run_to(depmod_t, depmod_exec_t)
Quoted 8 lines
In the Debian policy I have the above in an optional section of base.pp but for reasons that I don't understand it's not being loaded (both tests and running apol on policy.24 show this).
I've inspected the contents of base.conf and they appear to be OK.
Any suggestions of other tools to analyse this will be appreciated.
Is this with the policy found in selinux-policy-src_0.2.20100524-4_all.deb? I don't see unconfined_run_to being used in that policy.
It looks like modutils is part of base, so depmod_t and depmod_exec_t should be defined. But there is a requires statement at the top of modutils for "bool secure_mode_insmod". Is secure_mode_insmod in the policy?
Signature · 8 lines
James Carter <[email protected]> National Security Agency -- This message was distributed to subscribers of the selinux mailing list. If you no longer wish to subscribe, send mail to [email protected] with the words "unsubscribe selinux" without quotes as the message.
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Quoted 9 lines · James Carter
Quoted 8 lines · Russell Coker
I'm having a problem with optional policy not being used when I think it should.
Is it possible to use apol to get information on optional policy for .pp files so I can try to work out why it doesn't get enabled?
unconfined_run_to(depmod_t, depmod_exec_t)
Quoted 7 lines
Quoted 7 lines
In the Debian policy I have the above in an optional section of base.pp but for reasons that I don't understand it's not being loaded (both tests and running apol on policy.24 show this).
I've inspected the contents of base.conf and they appear to be OK.
Any suggestions of other tools to analyse this will be appreciated.
This may not be applicable here but do double check the module. I have experienced similar issues where optional policy blocks were not loaded, without any errors shown. I remember once requiring a type that did not exist. Compiler did not complain but some particular policy was not loaded.
When this happens to me, i check syntax of all policy, check that all used types exist and that there are no typos in types and other policy in the particular module (in this case modutils and or unconfined). In my erperience it is usually due to a syntax error or some other error in the module.
Other issues i have had with optional policy is for example attributes not being within scope or incorrectly nesting of optional policy.
But, i believe in both latter cases, the compiler or installer will complain about duplicate declaration or not within scope.
So in my experience, i suspect there is an error in your policy that the compiler did not catch.
What may help troubleshoot your issue is to try compiling and loading the policy without the optional tags. In some cases that may expose things errors.
These issues suck and can take ages to track down. The compiler is often not very helpful in these instances either.
Basically all you can do is keep checking the involved modules for any errors i believe.
I have been fighting with optional policy for quite some time, and i have blamed optional policy for a lot of things. But since i figured out how it works and how to nest optional policy i found out that it actually makes sense. It can be complicated but usually not with confining the system layer. When confining the user space, then nesting optional policy becomes a big issue.
Quoted 10 lines
Is this with the policy found in selinux-policy-src_0.2.20100524-4_all.deb? I don't see
unconfined_run_tobeing used in that policy.It looks like modutils is part of base, so
depmod_tanddepmod_exec_tshould be defined. But there is a requires statement at the top of modutils for "boolsecure_mode_insmod". Issecure_mode_insmodin the policy?
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.16 (GNU/Linux)
Comment: Using GnuPG with Fedora - http://enigmail.mozdev.org/
iEYEARECAAYFAkz1KhkACgkQMlxVo39jgT/yBgCcC0kTlimf8OvIgOYGZgzJftWW 9DcAn3fUPqRPaMGrsrq+00EvJ9JZ8eSK
=atLW
-----END PGP SIGNATURE-----
--
This message was distributed to subscribers of the selinux mailing list. If you no longer wish to subscribe, send mail to [email protected] with the words "unsubscribe selinux" without quotes as the message.
Quoted 17 lines · Dominick Grift
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1Quoted 13 lines · James Carter
Quoted 12 lines · Russell Coker
I'm having a problem with optional policy not being used when I think it should.
Is it possible to use apol to get information on optional policy for .pp files so I can try to work out why it doesn't get enabled?
unconfined_run_to(depmod_t, depmod_exec_t)In the Debian policy I have the above in an optional section of base.pp but for reasons that I don't understand it's not being loaded (both tests and running apol on policy.24 show this).
Quoted 7 lines
Quoted 3 lines
Quoted 3 lines
I've inspected the contents of base.conf and they appear to be OK.
Any suggestions of other tools to analyse this will be appreciated.
This may not be applicable here but do double check the module. I have experienced similar issues where optional policy blocks were not loaded, without any errors shown.
Not being defined is not an error in an optional block, it just means the optional block is not to be used.
It is expected that there will be a lot of unused optional blocks if only some modules are being used. Reporting everything not defined would not be helpful in this case.
This behavior of silently removing optional blocks can, however, cause real errors to be missed.
Quoted 59 lines
I remember once requiring a type that did not
exist. Compiler did not complain but some particular policy was not loaded.When this happens to me, i check syntax of all policy, check that all used types exist and that there are no typos in types and other policy in the particular module (in this case modutils and or unconfined). In my erperience it is usually due to a syntax error or some other error in the module.
Other issues i have had with optional policy is for example attributes not being within scope or incorrectly nesting of optional policy.
But, i believe in both latter cases, the compiler or installer will complain about duplicate declaration or not within scope.
So in my experience, i suspect there is an error in your policy that the compiler did not catch.
What may help troubleshoot your issue is to try compiling and loading the policy without the optional tags. In some cases that may expose things errors.
These issues suck and can take ages to track down. The compiler is often not very helpful in these instances either.
Basically all you can do is keep checking the involved modules for any errors i believe.
I have been fighting with optional policy for quite some time, and i have blamed optional policy for a lot of things. But since i figured out how it works and how to nest optional policy i found out that it actually makes sense. It can be complicated but usually not with confining the system layer. When confining the user space, then nesting optional policy becomes a big issue.
Quoted 10 lines
Is this with the policy found in selinux-policy-src_0.2.20100524-4_all.deb? I don't see
unconfined_run_tobeing used in that policy.It looks like modutils is part of base, so
depmod_tanddepmod_exec_tshould be defined. But there is a requires statement at the top of modutils for "boolsecure_mode_insmod". Issecure_mode_insmodin the policy?-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.16 (GNU/Linux)
Comment: Using GnuPG with Fedora - http://enigmail.mozdev.org/iEYEARECAAYFAkz1KhkACgkQMlxVo39jgT/yBgCcC0kTlimf8OvIgOYGZgzJftWW 9DcAn3fUPqRPaMGrsrq+00EvJ9JZ8eSK
=atLW
-----END PGP SIGNATURE-------
This message was distributed to subscribers of the selinux mailing list. If you no longer wish to subscribe, send mail to [email protected] with the words "unsubscribe selinux" without quotes as the message.
Signature · 8 lines
James Carter <[email protected]> National Security Agency -- This message was distributed to subscribers of the selinux mailing list. If you no longer wish to subscribe, send mail to [email protected] with the words "unsubscribe selinux" without quotes as the message.
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Quoted 15 lines · James Carter
On Tue, 2010-11-30 at 17:45 +0100, Dominick Grift wrote:
Quoted 13 lines · James Carter
Quoted 13 lines
Quoted 13 lines · Russell Coker
Quoted 12 lines
I'm having a problem with optional policy not being used when I think it should.
Is it possible to use apol to get information on optional policy for .pp files so I can try to work out why it doesn't get enabled?
unconfined_run_to(depmod_t, depmod_exec_t)In the Debian policy I have the above in an optional section of base.pp but for reasons that I don't understand it's not being loaded (both tests and running apol on policy.24 show this).
Quoted 17 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
I've inspected the contents of base.conf and they appear to be OK.
Any suggestions of other tools to analyse this will be appreciated.
This may not be applicable here but do double check the module. I have experienced similar issues where optional policy blocks were not loaded, without any errors shown.
Quoted 9 lines
Not being defined is not an error in an optional block, it just means the optional block is not to be used.
It is expected that there will be a lot of unused optional blocks if only some modules are being used. Reporting everything not defined would not be helpful in this case.
This behavior of silently removing optional blocks can, however, cause real errors to be missed.
Yes now i remember what happened:
1. i have a per_role_template that had a type in the require section that i removed. The per role template was called in an optional policy block.
2. Because the template required a type that did not exist, it was not used because it was called in an optional policy block.
3. Then later i found out about the required type that didnt exist and i removed that from the require block of the per role template, and that is when other errors were exposed in the per role template.
After fixing those , all was well.
An unlikely chain of events but it can happen and can be pretty confusing. (atleast it was to me. Took me a view hours to troubleshoot :)
Quoted 29 lines
I remember once requiring a type that did not
exist. Compiler did not complain but some particular policy was not loaded.When this happens to me, i check syntax of all policy, check that all used types exist and that there are no typos in types and other policy in the particular module (in this case modutils and or unconfined). In my erperience it is usually due to a syntax error or some other error in the module.
Other issues i have had with optional policy is for example attributes not being within scope or incorrectly nesting of optional policy.
But, i believe in both latter cases, the compiler or installer will complain about duplicate declaration or not within scope.
So in my experience, i suspect there is an error in your policy that the compiler did not catch.
What may help troubleshoot your issue is to try compiling and loading the policy without the optional tags. In some cases that may expose things errors.
These issues suck and can take ages to track down. The compiler is often not very helpful in these instances either.
Basically all you can do is keep checking the involved modules for any errors i believe.
Quoted 19 lines
I have been fighting with optional policy for quite some time, and i have blamed optional policy for a lot of things. But since i figured out how it works and how to nest optional policy i found out that it actually makes sense. It can be complicated but usually not with confining the system layer. When confining the user space, then nesting optional policy becomes a big issue.
Quoted 12 lines
Quoted 10 lines
Quoted 10 lines
Is this with the policy found in selinux-policy-src_0.2.20100524-4_all.deb? I don't see
unconfined_run_tobeing used in that policy.It looks like modutils is part of base, so
depmod_tanddepmod_exec_tshould be defined. But there is a requires statement at the top of modutils for "boolsecure_mode_insmod". Issecure_mode_insmodin the policy?
- --
This message was distributed to subscribers of the selinux mailing list. If you no longer wish to subscribe, send mail to [email protected] with
the words "unsubscribe selinux" without quotes as the message.
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.16 (GNU/Linux)
Comment: Using GnuPG with Fedora - http://enigmail.mozdev.org/
iEYEARECAAYFAkz1QdAACgkQMlxVo39jgT8TtgCgsr6eKlqN0LCcwC5/3tcanjY2 NxIAoKFWqesRFBg8dAsIGsuuL6hg0AD0
=E0DG
-----END PGP SIGNATURE-----
--
This message was distributed to subscribers of the selinux mailing list. If you no longer wish to subscribe, send mail to [email protected] with the words "unsubscribe selinux" without quotes as the message.
Quoted 26 lines · James Carter
On Tue, 2010-11-30 at 17:45 +0100, Dominick Grift wrote:
Quoted 13 lines · James Carter
Quoted 13 lines
Quoted 13 lines · Russell Coker
Quoted 12 lines
I'm having a problem with optional policy not being used when I think it should.
Is it possible to use apol to get information on optional policy for .pp files so I can try to work out why it doesn't get enabled?
unconfined_run_to(depmod_t, depmod_exec_t)In the Debian policy I have the above in an optional section of base.pp but for reasons that I don't understand it's not being loaded (both tests and running apol on policy.24 show this).
Quoted 7 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
I've inspected the contents of base.conf and they appear to be OK.
Any suggestions of other tools to analyse this will be appreciated.
This may not be applicable here but do double check the module. I have experienced similar issues where optional policy blocks were not loaded, without any errors shown.
Not being defined is not an error in an optional block, it just means the optional block is not to be used.
Quoted 6 lines
It is expected that there will be a lot of unused optional blocks if only some modules are being used. Reporting everything not defined would not be helpful in this case.
This behavior of silently removing optional blocks can, however, cause real errors to be missed.
At first I was going to suggest an extra-verbose or a debug mode on the toolchain to help on this, but I suspect that identifying the block in a useful fashion wouldn't be possible. When resolving the blocks, is there even any reference to the module it comes from? Beyond that, there probably aren't line numbers either, so it couldn't have messages like "block disabled: optional beginning on line 123 from foo.pp."
Signature · 8 lines
Chris PeBenito Tresys Technology, LLC www.tresys.com | oss.tresys.com -- This message was distributed to subscribers of the selinux mailing list. If you no longer wish to subscribe, send mail to [email protected] with the words "unsubscribe selinux" without quotes as the message.
Quoted 34 lines · Christopher J. PeBenito
Quoted 26 lines · James Carter
On Tue, 2010-11-30 at 17:45 +0100, Dominick Grift wrote:
Quoted 13 lines · James Carter
Quoted 13 lines
Quoted 13 lines · Russell Coker
Quoted 12 lines
I'm having a problem with optional policy not being used when I think it should.
Is it possible to use apol to get information on optional policy for .pp files so I can try to work out why it doesn't get enabled?
unconfined_run_to(depmod_t, depmod_exec_t)In the Debian policy I have the above in an optional section of base.pp but for reasons that I don't understand it's not being loaded (both tests and running apol on policy.24 show this).
Quoted 7 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
I've inspected the contents of base.conf and they appear to be OK.
Any suggestions of other tools to analyse this will be appreciated.
This may not be applicable here but do double check the module. I have experienced similar issues where optional policy blocks were not loaded, without any errors shown.
Not being defined is not an error in an optional block, it just means the optional block is not to be used.
Quoted 6 lines
It is expected that there will be a lot of unused optional blocks if only some modules are being used. Reporting everything not defined would not be helpful in this case.
This behavior of silently removing optional blocks can, however, cause real errors to be missed.
Quoted 7 lines
At first I was going to suggest an extra-verbose or a debug mode on the toolchain to help on this, but I suspect that identifying the block in a useful fashion wouldn't be possible. When resolving the blocks, is there even any reference to the module it comes from? Beyond that, there probably aren't line numbers either, so it couldn't have messages like "block disabled: optional beginning on line 123 from foo.pp."
It seems like it would be helpful to Russell and others if there was a debug mode, even if it merely said something like "optional block
disabled: foo_t not defined". They would at least have a starting point.
Signature · 8 lines
James Carter <[email protected]> National Security Agency -- This message was distributed to subscribers of the selinux mailing list. If you no longer wish to subscribe, send mail to [email protected] with the words "unsubscribe selinux" without quotes as the message.
Quoted 8 lines · Russell Coker
I'm having a problem with optional policy not being used when I think it should.
Is it possible to use apol to get information on optional policy for .pp files so I can try to work out why it doesn't get enabled?
unconfined_run_to(depmod_t, depmod_exec_t)
Quoted 8 lines
In the Debian policy I have the above in an optional section of base.pp but for reasons that I don't understand it's not being loaded (both tests and running apol on policy.24 show this).
I've inspected the contents of base.conf and they appear to be OK.
Any suggestions of other tools to analyse this will be appreciated.
I have a policy compiler written in Lua that I used in the past to experiment with language extensions and that I am currently working towards being able to convert Refpolicy to CIL. It is not industrial strength and not friendly to anyone except its creator, but it does display more error messages.
Running it on the policy in selinux-policy-src_0.2.20100524-4_all.deb I found the following:
Same paramater used as a role and a type:
- Line 69 in ../debian_policy/policy/modules/apps/seunshare.if
Undefined macro calls:
- samba_run_smb at Line 180 in ../debian_policy/policy/modules/apps/qemu.if
- macro userdom_unpriv_usertype at Line 103 in ../debian_policy/policy/modules/apps/wine.if
- file_type_auto_trans at Line 308 in ../debian_policy/policy/modules/system/ipsec.te
Types used as an alias:
- procmail_t at Line 10 in ../debian_policy/policy/modules/services/lda.te
- procmail_exec_t at Line 12 in ../debian_policy/policy/modules/services/lda.te
- procmail_tmp_t at Line 17 in ../debian_policy/policy/modules/services/lda.te
Types not declared:
- httpd_nagios_script_exec_t
- httpd_cobbler_script_exec_t
- httpd_smokeping_cgi_script_exec_t
- httpd_nutups_cgi_script_exec_t
- lsassd_t
- dkim_var_run_t
- dkim_t
I believe that some of these errors are also in Refpolicy.
I don't see anything related to your problem here.
I've attached the current version of my compiler. Unfortunately, it treats Refpolicy pre m4 expansion as the policy language, so I need to patch a few things in the policy to make it work.
So apply the attached patch and then run something like the following:
./fpp.lua -p ../debian_policy/ > policy.conf
Signature · 2 lines
James Carter <[email protected]> National Security Agency
policy/constraints +15 -14
@@ -25,21 +25,15 @@ # name_list : name | name_list name # -define(`basic_ubac_conditions',` - ifdef(`enable_ubac',` - u1 == u2 - or u1 == system_u or u1 == unconfined_u - or u2 == system_u - or t1 != ubac_constrained_type - or t2 != ubac_constrained_type - ') -') - define(`basic_ubac_constraint',` ifdef(`enable_ubac',` constrain $1 all_$1_perms ( - basic_ubac_conditions + u1 == u2 + or u1 == system_u or u1 == unconfined_u + or u2 == system_u + or t1 != ubac_constrained_type + or t2 != ubac_constrained_type ); ') ')
@@ -48,7 +42,11 @@ ifdef(`enable_ubac',` constrain $1 all_$1_perms ( - basic_ubac_conditions + u1 == u2 + or u1 == system_u or u1 == unconfined_u + or u2 == system_u + or t1 != ubac_constrained_type + or t2 != ubac_constrained_type or t1 == $2 ); ')
@@ -82,7 +80,11 @@ ifdef(`enable_ubac',` constrain process { sigchld sigkill sigstop signull signal ptrace getsched setsched getsession getpgid setpgid getcap setcap share getattr setrlimit } ( - basic_ubac_conditions + u1 == u2 + or u1 == system_u or u1 == unconfined_u + or u2 == system_u + or t1 != ubac_constrained_type + or t2 != ubac_constrained_type or t1 == ubacproc ); ')
@@ -241,5 +243,4 @@ undefine(`basic_ubac_constraint') -undefine(`basic_ubac_conditions') undefine(`exempted_ubac_constraint')
policy/mcs +20 -15
@@ -71,18 +71,20 @@ mlsconstrain file { read ioctl lock execute execute_no_trans } (( h1 dom h2 ) or ( t1 == mcsreadall ) or ( t2 == domain )); -mlsconstrain file { write setattr append link rename } ifdef(`distro_debian', ` - ((( h1 dom h2 ) and ( l1 domby l2 )) or ( t1 == mcswriteall ) or (t2 == mcstrustedobject) or ( t2 == domain )); + mlsconstrain file { write setattr append link rename } + ((( h1 dom h2 ) and ( l1 domby l2 )) or ( t1 == mcswriteall ) or (t2 == mcstrustedobject) or ( t2 == domain )); ', ` + mlsconstrain file { write setattr append link rename } (( h1 dom h2 ) or ( t1 == mcswriteall ) or ( t2 == domain )); ') -mlsconstrain file { unlink } ifdef(`distro_debian', ` - ((( h1 dom h2 ) and ( l1 domby l2 )) or (( t1 == mcswriteall ) or ( t1 == mcsdeleteall )) or (t2 == mcstrustedobject) or ( t2 == domain )); + mlsconstrain file { unlink } + ((( h1 dom h2 ) and ( l1 domby l2 )) or (( t1 == mcswriteall ) or ( t1 == mcsdeleteall )) or (t2 == mcstrustedobject) or ( t2 == domain )); ', ` - (( h1 dom h2 ) or (( t1 == mcswriteall ) or ( t1 == mcsdeleteall )) or ( t2 == domain )); + mlsconstrain file { unlink } + (( h1 dom h2 ) or (( t1 == mcswriteall ) or ( t1 == mcsdeleteall )) or ( t2 == domain )); ') mlsconstrain dir { search read ioctl lock }
@@ -96,12 +98,12 @@ # New filesystem object labels must be dominated by the relabeling subject # clearance, also the objects are single-level. -mlsconstrain file { create relabelto } ifdef(`distro_debian', ` - (( h1 dom h2 ) and ( l2 eq h2 ) and - ((l1 domby l2) or (t2 == mcstrustedobject))); + mlsconstrain file { create relabelto } + (( h1 dom h2 ) and ( l2 eq h2 ) and ((l1 domby l2) or (t2 == mcstrustedobject))); ', ` - (( h1 dom h2 ) and ( l2 eq h2 )); + mlsconstrain file { create relabelto } + (( h1 dom h2 ) and ( l2 eq h2 )); ') # new file labels must be dominated by the relabeling subject clearance
@@ -112,19 +114,22 @@ mlsconstrain { dir lnk_file chr_file blk_file sock_file fifo_file } { create relabelto } (( h1 dom h2 ) and ( l2 eq h2 )); -mlsconstrain process { transition dyntransition } ifdef(`distro_debian', ` - (( ( h1 dom h2 ) and ((l1 domby l2) or (t1 == mcssetlow)) ) or ( t1 == mcssetcats )); + mlsconstrain process { transition dyntransition } + (( ( h1 dom h2 ) and ((l1 domby l2) or (t1 == mcssetlow)) ) or ( t1 == mcssetcats )); ', ` - (( h1 dom h2 ) or ( t1 == mcssetcats )); + mlsconstrain process { transition dyntransition } + (( h1 dom h2 ) or ( t1 == mcssetcats )); ') -mlsconstrain process { ptrace } + ifdef(`distro_debian', ` - ( (h1 dom h2) and ((l1 domby l2) or ( t1 == mcsptraceall )) ); + mlsconstrain process { ptrace } + ((h1 dom h2) and ((l1 domby l2) or ( t1 == mcsptraceall )) ); ', ` - (( h1 dom h2) or ( t1 == mcsptraceall )); + mlsconstrain process { ptrace } + (( h1 dom h2) or ( t1 == mcsptraceall )); ') mlsconstrain process { sigkill sigstop }
policy/modules/kernel/files.if +74 -18
144 lines not on this page · raw message
Only in debian_policy/policy/modules/kernel: files.if.orig
policy/modules/kernel/selinux.if +1 -1
@@ -40,7 +40,7 @@ # because of this statement, any module which # calls this interface must be in the base module: - genfscon selinuxfs /booleans/$2 gen_context(system_u:object_r:$1,s0) + #genfscon selinuxfs /booleans/$2 gen_context(system_u:object_r:$1,s0) ') ########################################
policy/modules/services/nx.te +1 -0
@@ -13,6 +13,7 @@ domain_user_exemption_target(nx_server_t) # we need an extra role because nxserver is called from sshd # cjp: do we really need this? +role nx_server_r; role nx_server_r types nx_server_t; allow system_r nx_server_r;
Only in debian_policy/policy/modules/services: nx.te.orig
policy/modules/system/authlogin.if +5 -5
@@ -1113,7 +1113,7 @@ type shadow_t; ') - files_read_all_dirs_except($1,$2 -shadow_t) + files_read_all_dirs_except($1, shadow_t) ') ########################################
@@ -1139,7 +1139,7 @@ type shadow_t; ') - files_read_all_files_except($1,$2 -shadow_t) + files_read_all_files_except($1, shadow_t) ') ########################################
@@ -1164,7 +1164,7 @@ type shadow_t; ') - files_read_all_symlinks_except($1,$2 -shadow_t) + files_read_all_symlinks_except($1, shadow_t) ') ########################################
@@ -1190,7 +1190,7 @@ type shadow_t; ') - files_relabel_all_files($1,$2 -shadow_t) + files_relabel_all_files_except($1, shadow_t) ') ########################################
@@ -1242,7 +1242,7 @@ type shadow_t; ') - files_manage_all_files($1,$2 -shadow_t) + files_manage_all_files_except($1, shadow_t) ') ########################################
policy/support/misc_macros.spt +0 -6
@@ -65,12 +65,6 @@ ######################################## # -# can_exec(domain,executable) -# -define(`can_exec',`allow $1 $2:file { mmap_file_perms ioctl lock execute_no_trans };') - -######################################## -# # gen_bool(name,default_value) # define(`gen_bool',`
policy/support/misc_patterns.spt +6 -0
@@ -62,3 +62,9 @@ allow $1 $2:lnk_file read_lnk_file_perms; allow $1 $2:process getattr; ') + +######################################## +# +# can_exec(domain,executable) +# +define(`can_exec',`allow $1 $2:file { mmap_file_perms ioctl lock execute_no_trans };')
policy/users +48 -9
75 lines not on this page · raw message
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Quoted 51 lines · James Carter
Quoted 8 lines · Russell Coker
I'm having a problem with optional policy not being used when I think it should.
Is it possible to use apol to get information on optional policy for .pp files so I can try to work out why it doesn't get enabled?
unconfined_run_to(depmod_t, depmod_exec_t)Quoted 8 lines
In the Debian policy I have the above in an optional section of base.pp but for reasons that I don't understand it's not being loaded (both tests and running apol on policy.24 show this).
I've inspected the contents of base.conf and they appear to be OK.
Any suggestions of other tools to analyse this will be appreciated.
I have a policy compiler written in Lua that I used in the past to experiment with language extensions and that I am currently working towards being able to convert Refpolicy to CIL. It is not industrial strength and not friendly to anyone except its creator, but it does display more error messages.
Running it on the policy in selinux-policy-src_0.2.20100524-4_all.deb I found the following:
Same paramater used as a role and a type:
- Line 69 in ../debian_policy/policy/modules/apps/seunshare.ifUndefined macro calls:
-samba_run_smbat Line 180 in ../debian_policy/policy/modules/apps/qemu.if
- macrouserdom_unpriv_usertypeat Line 103 in ../debian_policy/policy/modules/apps/wine.if
-file_type_auto_transat Line 308 in ../debian_policy/policy/modules/system/ipsec.teTypes used as an alias:
-procmail_tat Line 10 in ../debian_policy/policy/modules/services/lda.te
-procmail_exec_tat Line 12 in ../debian_policy/policy/modules/services/lda.te
-procmail_tmp_tat Line 17 in ../debian_policy/policy/modules/services/lda.teTypes not declared:
-httpd_nagios_script_exec_t
-httpd_cobbler_script_exec_t
-httpd_smokeping_cgi_script_exec_t
-httpd_nutups_cgi_script_exec_t
-lsassd_t
-dkim_var_run_t
-dkim_tI believe that some of these errors are also in Refpolicy.
Quoted 9 lines
I don't see anything related to your problem here.
I've attached the current version of my compiler. Unfortunately, it treats Refpolicy pre m4 expansion as the policy language, so I need to patch a few things in the policy to make it work.
So apply the attached patch and then run something like the following:
./fpp.lua -p ../debian_policy/ > policy.conf
One thing I got burned on last night was a gen_require block with a spelling mistake. So it pulled a hole section of policy out.
It would be cool, it we could check that all types that are required within an interface file are defined within the te file.
foobar.if should not require types that are not defined in foobar.te. -----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.11 (GNU/Linux)
Comment: Using GnuPG with Fedora - http://enigmail.mozdev.org/
iEYEARECAAYFAkz1bj0ACgkQrlYvE4MpobNVAACgzGbRdjVNBgDu6nDZaNvWjJJQ G1YAoMCnf+hV2RtkSRUNXS4HPr5KkmuL
=rJpA
-----END PGP SIGNATURE-----
--
This message was distributed to subscribers of the selinux mailing list. If you no longer wish to subscribe, send mail to [email protected] with the words "unsubscribe selinux" without quotes as the message.