Skip to contentSkip to conversation

some errors in installing pp

DISCUSSION Applied Nerazzurri.YANG 3 participants 10 messages Mar 23, 2007 – Mar 26, 2007 SELinux security module

lore
Share & tools
lore
#0 lore raw

hi all,

i install a local pp in fc7 rawhide, but there are some errors, i do not understand:

libsepol.print_missing_requirements: mymono's global requirements were not met: type/attribute self libsemanage.semanage_link_sandbox: Link packages failed
semodule: Failed!

my ".te" file is as:

module mymono 1.0;

require {
	type unconfined_t;
	type automount_t;
	type init_t;
	type pcscd_t;
	type default_t;
	type sysfs_t;
	type semanage_t;
	type setroubleshootd_t;
	type xdm_t;
	type initrc_t;
	type bluetooth_t;
	type insmod_t;
	type gpm_t;
	type var_lib_t;
	type hplip_t;
	type unlabeled_t;
	type var_run_t;
	type kernel_t;
	type locate_t;
	type consolekit_t;
	type klogd_t;
	type xdm_xserver_t;
	type httpd_t;
	type hald_acl_t;
	type cupsd_t;
	type nscd_var_run_t;
	type udev_t;
	type rpcd_t;
	type hald_t;
	type rpm_t;
	type getty_t;
	type mono_t;
	type crond_t;
	type random_device_t;
	type self;
	class sock_file write;
	class file { write setattr };
	class dir { search getattr };
	class chr_file read;
}

#============= automount_t ==============
allow automount_t random_device_t:chr_file read;

#============= consolekit_t ==============
allow consolekit_t var_lib_t:dir search;

#============= hald_acl_t ==============
allow hald_acl_t nscd_var_run_t:dir search;

#============= insmod_t ==============
allow insmod_t sysfs_t:file write;

#============= locate_t ==============
allow locate_t unlabeled_t:dir getattr;

#============= mono_t ==============
allow mono_t bluetooth_t:file write;
allow mono_t crond_t:file write;
allow mono_t cupsd_t:file write;
allow mono_t getty_t:file write;
allow mono_t gpm_t:file write;
allow mono_t hald_t:file write;
allow mono_t hplip_t:file write;
allow mono_t httpd_t:file write;
allow mono_t init_t:file write;
allow mono_t initrc_t:file write;
allow mono_t kernel_t:file write;
allow mono_t klogd_t:file write;
allow mono_t pcscd_t:file write;
allow mono_t rpcd_t:file write;
allow mono_t rpm_t:file write;
allow mono_t self:file setattr;
allow mono_t udev_t:file write;
allow mono_t unconfined_t:file { write setattr };
allow mono_t xdm_t:file write;
allow mono_t xdm_xserver_t:file write;

#============= semanage_t ==============
allow semanage_t default_t:dir search;

#============= setroubleshootd_t ============== allow setroubleshootd_t var_run_t:sock_file write;

the '.te' file is generated by audit2allow:

"cat /var/log/audit/audit.log | audit2allow -M test"

can any guide me the way to understand above errors generated by semodule.

thanks in advance.

--
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.

#1 lore raw
Quoted 44 lines · Nerazzurri.YANG

hi all,

i install a local pp in fc7 rawhide, but there are some errors, i do not understand:

libsepol.print_missing_requirements: mymono's global requirements were not met: type/attribute self libsemanage.semanage_link_sandbox: Link packages failed
semodule: Failed!

my ".te" file is as:

module mymono 1.0;

require {
	type unconfined_t;
	type automount_t;
	type init_t;
	type pcscd_t;
	type default_t;
	type sysfs_t;
	type semanage_t;
	type setroubleshootd_t;
	type xdm_t;
	type initrc_t;
	type bluetooth_t;
	type insmod_t;
	type gpm_t;
	type var_lib_t;
	type hplip_t;
	type unlabeled_t;
	type var_run_t;
	type kernel_t;
	type locate_t;
	type consolekit_t;
	type klogd_t;
	type xdm_xserver_t;
	type httpd_t;
	type hald_acl_t;
	type cupsd_t;
	type nscd_var_run_t;
	type udev_t;
Quoted 8 lines
	type rpcd_t;
	type hald_t;
	type rpm_t;
	type getty_t;
	type mono_t;
	type crond_t;
	type random_device_t;
	type self;

Remove the 'type self;' line. Did you add that manually or was it generated by the new audit2allow? If the latter, that is a bug.

Quoted 64 lines
	class sock_file write;
	class file { write setattr };
	class dir { search getattr };
	class chr_file read;
}

#============= automount_t ==============
allow automount_t random_device_t:chr_file read;

#============= consolekit_t ==============
allow consolekit_t var_lib_t:dir search;

#============= hald_acl_t ==============
allow hald_acl_t nscd_var_run_t:dir search;

#============= insmod_t ==============
allow insmod_t sysfs_t:file write;

#============= locate_t ==============
allow locate_t unlabeled_t:dir getattr;

#============= mono_t ==============
allow mono_t bluetooth_t:file write;
allow mono_t crond_t:file write;
allow mono_t cupsd_t:file write;
allow mono_t getty_t:file write;
allow mono_t gpm_t:file write;
allow mono_t hald_t:file write;
allow mono_t hplip_t:file write;
allow mono_t httpd_t:file write;
allow mono_t init_t:file write;
allow mono_t initrc_t:file write;
allow mono_t kernel_t:file write;
allow mono_t klogd_t:file write;
allow mono_t pcscd_t:file write;
allow mono_t rpcd_t:file write;
allow mono_t rpm_t:file write;
allow mono_t self:file setattr;
allow mono_t udev_t:file write;
allow mono_t unconfined_t:file { write setattr };
allow mono_t xdm_t:file write;
allow mono_t xdm_xserver_t:file write;

#============= semanage_t ==============
allow semanage_t default_t:dir search;

#============= setroubleshootd_t ============== allow setroubleshootd_t var_run_t:sock_file write;

the '.te' file is generated by audit2allow:

"cat /var/log/audit/audit.log | audit2allow -M test"

can any guide me the way to understand above errors generated by semodule.

thanks in advance.

--
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
Stephen Smalley
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.
#2 lore raw
Quoted 6 lines · Stephen Smalley
Quoted 1 line · Nerazzurri.YANG
	type self;

Remove the 'type self;' line. Did you add that manually or was it generated by the new audit2allow? If the latter, that is a bug.

That is a strange bug (if it is - I can't reproduce locally):

* The way audit2allow works is that self is never stored in the rules, it is only converted at the point it is output. I did that specifically to avoid having to special case for self. So it should never add self as a require.

* None of the rules reference self.

So, if this was generated by audit2allow could you give me the rpm version for policycoreutils and the log file that generated the policy.

Thanks,

Karl

--
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.

#3 lore raw
Quoted 15 lines · Karl MacMillan
Quoted 6 lines · Stephen Smalley
Quoted 1 line · Nerazzurri.YANG
	type self;

Remove the 'type self;' line. Did you add that manually or was it generated by the new audit2allow? If the latter, that is a bug.

That is a strange bug (if it is - I can't reproduce locally):

* The way audit2allow works is that self is never stored in the rules, it is only converted at the point it is output. I did that specifically to avoid having to special case for self. So it should never add self as a require.

Quoted 4 lines

* None of the rules reference self.

So, if this was generated by audit2allow could you give me the rpm version for policycoreutils and the log file that generated the policy.

Reproduced with latest upstream version, via:

# audit2allow -a -r | grep self
        type self;
allow netutils_t self:capability sys_module;
# /sbin/ausearch -m avc | grep netutils
type=SYSCALL msg=audit(1171312181.384:47): arch=40000003 syscall=54
success=no exit=-19 a0=3 a1=8933 a2=bf961380 a3=bf961380 items=0
ppid=5860 pid=5961 auid=4204 uid=0 gid=0 euid=0 suid=0 fsuid=0 egid=0
sgid=0 fsgid=0 tty=pts0 comm="arping" exe="/sbin/arping"
subj=user_u:system_r:netutils_t:s0 key=(null)
type=AVC msg=audit(1171312181.384:47): avc:  denied  { sys_module } for
pid=5961 comm="arping" capability=16
scontext=user_u:system_r:netutils_t:s0
tcontext=user_u:system_r:netutils_t:s0 tclass=capability
Signature · 8 lines
Stephen Smalley
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.
#4 lore raw
Quoted 26 lines · Stephen Smalley
Quoted 15 lines · Karl MacMillan
Quoted 6 lines · Stephen Smalley
Quoted 1 line · Nerazzurri.YANG
	type self;

Remove the 'type self;' line. Did you add that manually or was it generated by the new audit2allow? If the latter, that is a bug.

That is a strange bug (if it is - I can't reproduce locally):

* The way audit2allow works is that self is never stored in the rules, it is only converted at the point it is output. I did that specifically to avoid having to special case for self. So it should never add self as a require.

Quoted 4 lines

* None of the rules reference self.

So, if this was generated by audit2allow could you give me the rpm version for policycoreutils and the log file that generated the policy.

Reproduced with latest upstream version, via:

# audit2allow -a -r | grep self
        type self;
allow netutils_t self:capability sys_module;
Quoted 10 lines
# /sbin/ausearch -m avc | grep netutils
type=SYSCALL msg=audit(1171312181.384:47): arch=40000003 syscall=54
success=no exit=-19 a0=3 a1=8933 a2=bf961380 a3=bf961380 items=0
ppid=5860 pid=5961 auid=4204 uid=0 gid=0 euid=0 suid=0 fsuid=0 egid=0
sgid=0 fsgid=0 tty=pts0 comm="arping" exe="/sbin/arping"
subj=user_u:system_r:netutils_t:s0 key=(null)
type=AVC msg=audit(1171312181.384:47): avc:  denied  { sys_module } for
pid=5961 comm="arping" capability=16
scontext=user_u:system_r:netutils_t:s0
tcontext=user_u:system_r:netutils_t:s0 tclass=capability

refpolicy.py adds "self" to target types in from_av.

Signature · 8 lines
Stephen Smalley
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.
#5 lore raw
Quoted 38 lines · Stephen Smalley
Quoted 26 lines · Stephen Smalley
Quoted 15 lines · Karl MacMillan
Quoted 6 lines · Stephen Smalley
Quoted 1 line · Nerazzurri.YANG
	type self;

Remove the 'type self;' line. Did you add that manually or was it generated by the new audit2allow? If the latter, that is a bug.

That is a strange bug (if it is - I can't reproduce locally):

* The way audit2allow works is that self is never stored in the rules, it is only converted at the point it is output. I did that specifically to avoid having to special case for self. So it should never add self as a require.

Quoted 4 lines

* None of the rules reference self.

So, if this was generated by audit2allow could you give me the rpm version for policycoreutils and the log file that generated the policy.

Reproduced with latest upstream version, via:

# audit2allow -a -r | grep self
        type self;
allow netutils_t self:capability sys_module;
Quoted 10 lines
# /sbin/ausearch -m avc | grep netutils
type=SYSCALL msg=audit(1171312181.384:47): arch=40000003 syscall=54
success=no exit=-19 a0=3 a1=8933 a2=bf961380 a3=bf961380 items=0
ppid=5860 pid=5961 auid=4204 uid=0 gid=0 euid=0 suid=0 fsuid=0 egid=0
sgid=0 fsgid=0 tty=pts0 comm="arping" exe="/sbin/arping"
subj=user_u:system_r:netutils_t:s0 key=(null)
type=AVC msg=audit(1171312181.384:47): avc:  denied  { sys_module } for
pid=5961 comm="arping" capability=16
scontext=user_u:system_r:netutils_t:s0
tcontext=user_u:system_r:netutils_t:s0 tclass=capability
Quoted 1 line

refpolicy.py adds "self" to target types in from_av.

r2279 | kmacmillan | 2007-03-01 14:08:38 -0500 (Thu, 01 Mar 2007) | 15 lines

Author: Karl MacMillan
Email: [email protected]
Subject: sepolgen: better match refpolicy style in output
Date: Thu, 01 Mar 2007 11:39:09 -0500

This patch makes the output of sepolgen better match the reference policy by:

* removing the space between target types and object classes (e.g., allow foo bar:file read).
* using self when the source and target match.

Signature · 8 lines
Stephen Smalley
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.
#6 lore raw
In reply to Stephen Smalley
Quoted 9 lines · Stephen Smalley
Quoted 8 lines · Karl MacMillan
Quoted 6 lines · Stephen Smalley
Quoted 1 line · Nerazzurri.YANG
	type self;

Remove the 'type self;' line. Did you add that manually or was it generated by the new audit2allow? If the latter, that is a bug.

Quoted 7 lines
Quoted 7 lines

That is a strange bug (if it is - I can't reproduce locally):

* The way audit2allow works is that self is never stored in the rules, it is only converted at the point it is output. I did that specifically to avoid having to special case for self. So it should never add self as a require.

Oops - this is what I wanted to do, but it is not actually possible. With multiple source types you can't detect self at output time.

Quoted 9 lines
Quoted 4 lines

* None of the rules reference self.

So, if this was generated by audit2allow could you give me the rpm version for policycoreutils and the log file that generated the policy.

Reproduced with latest upstream version, via:

# audit2allow -a -r | grep self
        type self;
allow netutils_t self:capability sys_module;

Patch below fixes this.

sepolgen/src/sepolgen/policygen.py +2 -0
diff -r 597d85c85841 sepolgen/src/sepolgen/policygen.py
@@ -334,6 +334,8 @@ def gen_requires(module):
                 # can actually figure those out.
                 r.types.add(arg)
 
+        r.types.discard("self")
+                
         node.children.insert(0, r)
 
     # FUTURE - this is untested on modules with any sort of

--
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.

#7 lore raw
Quoted 21 lines · Karl MacMillan
Quoted 7 lines · Stephen Smalley
Quoted 6 lines · Karl MacMillan
Quoted 5 lines · Stephen Smalley
Quoted 1 line · Nerazzurri.YANG
	type self;

Remove the 'type self;' line. Did you add that manually or was it generated by the new audit2allow? If the latter, that is a bug.

Quoted 7 lines
Quoted 7 lines

That is a strange bug (if it is - I can't reproduce locally):

* The way audit2allow works is that self is never stored in the rules, it is only converted at the point it is output. I did that specifically to avoid having to special case for self. So it should never add self as a require.

Oops - this is what I wanted to do, but it is not actually possible. With multiple source types you can't detect self at output time.

Quoted 2 lines
Quoted 2 lines

* None of the rules reference self.

Quoted 8 lines
Quoted 6 lines
Quoted 2 lines

So, if this was generated by audit2allow could you give me the rpm version for policycoreutils and the log file that generated the policy.

Reproduced with latest upstream version, via:

# audit2allow -a -r | grep self
        type self;
allow netutils_t self:capability sys_module;

Patch below fixes this.

sorry to reply late, you know it's weekend, and we are in different time zone.

it seems that the problem has been resolved. i will apply the patch and try again.

but i will still give the info you ask, i think it's helpful for you.

i am in fc7 rawhide (test3 6.92).
the rpm version of policycoreutils is: policycoreutils-2.0.7-4.fc7

now that there is patch for the problem, so i will not attach the log file, it's so big.

by the way, the reason i use audit2allow to generate pp, it's to resolve the problem of mono(beagle), i have sent the details to "fedora-selinux-list", and Mr walsh has posted it to the list.

anyway, thank you very much

Quoted 10 lines

diff -r 597d85c85841 sepolgen/src/sepolgen/policygen.py

sepolgen/src/sepolgen/policygen.py def gen_requires(module): · line 341

Quoted 8 lines
sepolgen/src/sepolgen/policygen.py +2 -0
@@ -334,6 +334,8 @@ def gen_requires(module):
                 # can actually figure those out.
                 r.types.add(arg)
 
+        r.types.discard("self")
+                
         node.children.insert(0, r)
 
     # FUTURE - this is untested on modules with any sort of

--
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.

#8 lore raw
Quoted 32 lines · Nerazzurri.YANG
Quoted 21 lines · Karl MacMillan
Quoted 7 lines · Stephen Smalley
Quoted 6 lines · Karl MacMillan
Quoted 5 lines · Stephen Smalley
Quoted 1 line · Nerazzurri.YANG
	type self;

Remove the 'type self;' line. Did you add that manually or was it generated by the new audit2allow? If the latter, that is a bug.

Quoted 7 lines
Quoted 7 lines

That is a strange bug (if it is - I can't reproduce locally):

* The way audit2allow works is that self is never stored in the rules, it is only converted at the point it is output. I did that specifically to avoid having to special case for self. So it should never add self as a require.

Oops - this is what I wanted to do, but it is not actually possible. With multiple source types you can't detect self at output time.

Quoted 2 lines
Quoted 2 lines

* None of the rules reference self.

Quoted 8 lines
Quoted 6 lines
Quoted 2 lines

So, if this was generated by audit2allow could you give me the rpm version for policycoreutils and the log file that generated the policy.

Reproduced with latest upstream version, via:

# audit2allow -a -r | grep self
        type self;
allow netutils_t self:capability sys_module;

Patch below fixes this.

Quoted 8 lines

sorry to reply late, you know it's weekend, and we are in different time zone.

it seems that the problem has been resolved. i will apply the patch and try again.

but i will still give the info you ask, i think it's helpful for you.

Thanks for the info. Let me know if the patch doesn't resolve things.

Karl

--
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.

#9 lore raw
In reply to Karl MacMillan
Quoted 39 lines · Karl MacMillan
Quoted 9 lines · Stephen Smalley
Quoted 8 lines · Karl MacMillan
Quoted 6 lines · Stephen Smalley
Quoted 1 line · Nerazzurri.YANG
	type self;

Remove the 'type self;' line. Did you add that manually or was it generated by the new audit2allow? If the latter, that is a bug.

Quoted 7 lines
Quoted 7 lines

That is a strange bug (if it is - I can't reproduce locally):

* The way audit2allow works is that self is never stored in the rules, it is only converted at the point it is output. I did that specifically to avoid having to special case for self. So it should never add self as a require.

Oops - this is what I wanted to do, but it is not actually possible. With multiple source types you can't detect self at output time.

Quoted 9 lines
Quoted 4 lines

* None of the rules reference self.

So, if this was generated by audit2allow could you give me the rpm version for policycoreutils and the log file that generated the policy.

Reproduced with latest upstream version, via:

# audit2allow -a -r | grep self
        type self;
allow netutils_t self:capability sys_module;

Patch below fixes this.

diff -r 597d85c85841 sepolgen/src/sepolgen/policygen.py

sepolgen/src/sepolgen/policygen.py def gen_requires(module): · line 341

Quoted 8 lines
sepolgen/src/sepolgen/policygen.py +2 -0
@@ -334,6 +334,8 @@ def gen_requires(module):
                 # can actually figure those out.
                 r.types.add(arg)
 
+        r.types.discard("self")
+                
         node.children.insert(0, r)
 
     # FUTURE - this is untested on modules with any sort of

Thanks, applied as sepolgen 1.0.7.

Signature · 8 lines
Stephen Smalley
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.