* bug report: semodule doesn't reject policices with duplicate fc's
@ 2022-09-30 14:39 Petr Lautrbach
0 siblings, 0 replies; only message in thread
From: Petr Lautrbach @ 2022-09-30 14:39 UTC (permalink / raw)
To: selinux, Milos Malik
Hi,
I've got a bug report from Milos Malik <mmalik@redhat.com> that the
current semodule does not reject policies with duplicate fc entries.
[root@fedora selinux]# semanage fcontext -l | grep '/var/run/passenger'
/var/run/passenger(/.*)? all files system_u:object_r:passenger_var_run_t:s0
[root@fedora selinux]# cat mypolicy.fc
/var/run/passenger(/.*)? system_u:object_r:mail_home_rw_t:s0
...
[root@fedora selinux]# semodule -i mypolicy.pp
[root@fedora selinux]#
Using -v, semodule rejects the policy as expected:
[root@fedora selinux]# semodule -v -i mypolicy.pp
Attempting to install module 'mypolicy.pp':
Ok: return value of 0.
Committing changes:
Found conflicting filecon rules
at /var/lib/selinux/targeted/tmp/modules/400/mypolicy/cil:3
at /var/lib/selinux/targeted/tmp/modules/100/passenger/cil:343
Problems processing filecon rules
Failed post db handling
Post process failed
semodule: Failed!
I've bisected the problem to the commit
bc26ddc59c8dc76aefb841166f6e18672fb88adc ("libsepol/cil: Limit the
amount of reporting for context rule conflicts")
Before this commit semodule rejects duplicate fc's with/without -v:
[root@fedora selinux]# semodule -i mypolicy.pp
Problems processing filecon rules
Failed post db handling
Post process failed
semodule: Failed!
[root@fedora selinux]# semodule -v -i mypolicy.pp
Attempting to install module 'mypolicy.pp':
Ok: return value of 0.
Committing changes:
Found conflicting filecon rules
at /var/lib/selinux/targeted/tmp/modules/100/passenger/cil:343
at /var/lib/selinux/targeted/tmp/modules/400/mypolicy/cil:3
Problems processing filecon rules
Failed post db handling
Post process failed
semodule: Failed!
Petr
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2022-09-30 14:39 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-09-30 14:39 bug report: semodule doesn't reject policices with duplicate fc's Petr Lautrbach
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.