From: Petr Lautrbach <plautrba@redhat.com>
To: selinux@vger.kernel.org, Milos Malik <mmalik@redhat.com>
Subject: bug report: semodule doesn't reject policices with duplicate fc's
Date: Fri, 30 Sep 2022 16:39:03 +0200 [thread overview]
Message-ID: <87y1u1rkoo.fsf@redhat.com> (raw)
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
reply other threads:[~2022-09-30 14:39 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=87y1u1rkoo.fsf@redhat.com \
--to=plautrba@redhat.com \
--cc=mmalik@redhat.com \
--cc=selinux@vger.kernel.org \
/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.