All of lore.kernel.org
 help / color / mirror / Atom feed
From: Joshua Brindle <jbrindle@tresys.com>
To: Daniel J Walsh <dwalsh@redhat.com>
Cc: SE Linux <selinux@tycho.nsa.gov>
Subject: Re: I would like to propose that we add compression to handle all policy files on disk.
Date: Thu, 09 Nov 2006 09:34:25 -0500	[thread overview]
Message-ID: <45533C71.3080802@tresys.com> (raw)
In-Reply-To: <45533208.6050806@redhat.com>

Daniel J Walsh wrote:
> We are currently storing three sets of pp files on disk in Fedora as 
> well as a policy.21 file
3 policy.21 files (deceptively named policy.kern in the module store...) 
plus 2 fully linked copies (base.linked) which is essentially a copy of 
all the policy packages concatenated (which is much larger than the 
policy.21 file)

As of right now base.linked is unused, we had some plans to eventually 
use it for 1) verification of the policy via external tools (libsemanage 
already supports this but noone is using it) and 2) a while back I 
suggested we could do incremental linking to speed up the process.

Getting rid of it almost halves the store size alone:

[root@poisonivy targeted]# du -sh modules/
38M     modules/
[root@poisonivy targeted]# rm modules/*/base.linked
[root@poisonivy targeted]# du -sh modules/        
21M     modules/

> To get an idea of how much space we can save, I did this little 
> experiment.    I believe this change is
> critical for minimal installs, and if we want to eventually use 
> SELinux on certain small platforms.
>
> I think just changing libsemanage to handle compressed policy packages 
> and to create its itermediary files as compressed files and changing 
> libselinux able to read a compressed policy.21 file.
>
libsepol does all the reading and writing, if we were to support 
compressed policies it would have to be there, not in libsemanage.

> # tar cvf /tmp/selinux /etc/selinux/targeted /usr/share/selinux/targeted/
there are files in here that we probably wouldn't want to compress like 
contexts/*, conf files, etc. (granted they are very small compared to 
policy packages and kernel policy..
> # gzip -c /tmp/selinux > /tm/selinux.gz
>
> # du /tmp/selinux*
> 57380   /tmp/selinux
> 3772    /tmp/selinux.gz

I wouldn't be adverse to someone adding a libsemanage option to not save 
the previous directory on success, we don't actually provide a revert 
interface as of now (though we probably should if we are going to keep 
it around..)

[root@poisonivy targeted]# rm -rf modules/previous/
[root@poisonivy targeted]# du -sh modules/
11M     modules/

(this was after the base.linked getting deleted above, add 9 meg to this 
if we keep that around..)

so there we've cut the module directory by 1/4 potentially, just how 
much space are we needing to save?

The main concern I have with this is that libz hasn't had an awesome 
security record and it would have to be used by the component of the 
toolchain closest to the kernel, load_policy.

Additionally, on Fedora libz is in /usr/lib which means init won't be 
able to use it to decompress the policy at boot time, I really don't 
think we should be pulling a static libz into libselinux and libsepol.


--
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:[~2006-11-09 14:34 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-11-09 13:50 I would like to propose that we add compression to handle all policy files on disk Daniel J Walsh
2006-11-09 14:34 ` Joshua Brindle [this message]
2006-11-09 15:13   ` Stephen Smalley
2006-11-09 15:23     ` Stephen Smalley
2006-11-09 15:55       ` Joshua Brindle
2006-11-09 17:00       ` I would like to propose that we add compression to handle allpolicy " Joshua Brindle
2006-11-09 17:49         ` Daniel J Walsh
2006-11-09 18:43         ` Karl MacMillan
2006-11-09 18:50           ` I would like to propose that we add compression to handleallpolicy " Joshua Brindle
2006-11-09 19:11             ` Karl MacMillan
2006-11-09 19:47               ` I would like to propose that we add compression tohandleallpolicy " Chris Stone
2006-11-09 21:01           ` I would like to propose that we add compression to handle allpolicy " Stephen Smalley
2006-11-09 21:10             ` Stephen Smalley
2006-11-09 21:54             ` Karl MacMillan
2006-11-09 22:05               ` Stephen Smalley
2006-11-13 18:27                 ` Karl MacMillan
2006-11-13 18:40                   ` Joshua Brindle
2006-11-14 14:45             ` Daniel J Walsh
2006-11-14 15:13               ` Joshua Brindle
2006-11-14 16:17                 ` Karl MacMillan
2006-11-09 20:59         ` 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=45533C71.3080802@tresys.com \
    --to=jbrindle@tresys.com \
    --cc=dwalsh@redhat.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.