All of lore.kernel.org
 help / color / mirror / Atom feed
From: Vikram Ambrose <Vikram.Ambrose@windriver.com>
To: selinux@tycho.nsa.gov
Subject: file_contexts duplicates
Date: Fri, 15 Aug 2008 10:42:20 -0400	[thread overview]
Message-ID: <48A595CC.2020508@windriver.com> (raw)

I have a problem in which file_contexts gets to 11mb (152kb unique) 
because of duplicates.

Using selinux-svn2950 and refpolicy-svn2780 I built the standard policy
distro=redhat
unknown perms=deny
no direct admin init

Now using the .pp files that got installed into /usr/share/selinux/standard

I attempted to create a 2nd policy by hand using semodule.

# export NAME=vikram
# mkdir -v -p \
   /etc/selinux/$NAME/modules/active \
   /etc/selinux/$NAME/contexts/files \
   /etc/selinux/$NAME/policy
# cd /usr/share/selinux/standard
# semodule -v -n -s $NAME -b base.pp $(for i in *.pp ; do  if [ "$i" != 
"base.pp" ] ; then echo -n "-i $i "; fi; done)

This command appears to run for eternity. But after investigation, it 
seems setfiles is getting stuck up reading file_contexts. And is 
relabeling the file system again and again because of the duplicate 
definitions.

Shorting out setfiles lets the command complete in 30mins. ie 
Transaction return 0. However because the file_contexts is 11mb of 
duplicates. It cannot be used. Doing a:

# sort /etc/selinux/$NAME/contexts/files/file_contexts | uniq > clean
# mv clean /etc/selinux/$NAME/contexts/files/file_contexts

Produces a 152kb file.
Note: /etc/selinux/standard/context/files/file_contexts is 156kb

Relabeling the file system now with the new 152kb file. Causes 
/usr/lib64 to get usr_t which causes massive denial at boot up. And 
eventually haults login.

What in the world is going on? Where would I begin to debug these 
problems: 1) Duplicates in file_contexts and 2) Missing contexts

Vikram

--
This message was distributed to subscribers of the selinux mailing list.
If you no longer wish to subscribe, send mail to majordomo@tycho.nsa.gov with
the words "unsubscribe selinux" without quotes as the message.

             reply	other threads:[~2008-08-15 14:42 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-08-15 14:42 Vikram Ambrose [this message]
2008-08-15 16:50 ` file_contexts duplicates Stephen Smalley
2008-08-15 16:57   ` Vikram Ambrose
2008-08-15 17:27     ` Stephen Smalley

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=48A595CC.2020508@windriver.com \
    --to=vikram.ambrose@windriver.com \
    --cc=selinux@tycho.nsa.gov \
    /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.