All of lore.kernel.org
 help / color / mirror / Atom feed
From: Ivan Gyurdiev <ivg2@cornell.edu>
To: Chris PeBenito <pebenito@gentoo.org>
Cc: Joshua Brindle <method@gentoo.org>,
	Stephen Smalley <sds@tycho.nsa.gov>,
	SELinux Mail List <selinux@tycho.nsa.gov>
Subject: Re: semanage non MLS breakage
Date: Sun, 19 Feb 2006 07:10:29 -0500	[thread overview]
Message-ID: <43F86035.1010401@cornell.edu> (raw)
In-Reply-To: <43F77E2B.3050108@cornell.edu>


>
> What I don't like about this is that libsemanage skips the MLS check 
> now, but still proceeds to write any MLS range found to disk. It 
> should invalidate an MLS range if it sees one. Will submit another 
> patch on top of the previous one...
Hmm, I don't know what to do about this...
There's several options:

1) Treat this as fatal error. This is by far the simplest solution - we 
already know when it happens, just make it fatal. Commit is aborted, and 
there's no problem. It seems a bit.... ugly, however, to abort a commit 
for which we clearly have all the data, and the user simply has extra 
data like MLS attached. Nevertheless, considering the options below, I 
think this is probably the best solution.

2) Ignore the problem, call it a feature. The user added MLS context 
into a non-MLS supporting policy - it's his/her fault. He or she can 
clean up the resulting mess. I don't like this approach though - the 
library should be proactive about preventing things that are incorrect, 
instead of creating a bigger problem.

3) Invalidate MLS at the beginning so it never proceeds in the library. 
This means:
       - adding a function to look in the policydb header, and determine 
whether it allows mls - I started to write this once before...
       - using this function in file parsers
       - performing partial validation on individual records through the 
dbase_* functions - I don't like this - I prefer full validation when we 
have information to do it - i.e. with all modules loaded, after the full 
policy has been constructed. This also requires knowing whether the 
policydb allows mls, without having a full policydb (while validation at 
the end doesn't require that).

4) Invalidate MLS where validation is currently done. The problem is that:
       - certain records are validated when they're copied from local 
dbase into sepol, where sepol treats this as non-fatal error, so it 
doesn't fail, informing the caller. No validation occurs directly on the 
local record (so MLS data remains, and can be written to disk)
        - In other cases, validation is done in an iterate() handler. 
Iterate handlers work on a const copy of the record, and the dbase. We'd 
have to change those requirements. This might actually be useful - but 
would require a bit more work in sepol to apply changes after iterate() 
was called with a temporary record.

5) Don't invalidate MLS, simply don't write it to disk. This looks kind 
of like a hack, and not a very good solution - the same problem might 
come up elsewhere. It requires:
     - passing an argument into the print() function that says MLS or no 
MLS.
     - informing database_file.c about that argument, which seems a bit 
wrong - complication created unnecessarily.

--
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-02-19 12:10 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-02-17  4:24 semanage non MLS breakage Chris PeBenito
2006-02-17  5:41 ` Ivan Gyurdiev
2006-02-17 14:23   ` Joshua Brindle
2006-02-17 15:04     ` Ivan Gyurdiev
2006-02-17 15:10       ` Joshua Brindle
2006-02-17 15:19         ` Ivan Gyurdiev
2006-02-17 15:28           ` Joshua Brindle
2006-02-17 15:39             ` Ivan Gyurdiev
2006-02-17 21:30               ` Ivan Gyurdiev
2006-02-18 18:44                 ` Chris PeBenito
2006-02-18 20:06                   ` Ivan Gyurdiev
2006-02-19 12:10                     ` Ivan Gyurdiev [this message]
2006-02-19 16:54                       ` Joshua Brindle
2006-02-19 17:17                         ` Ivan Gyurdiev
2006-02-22 15:49                           ` 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=43F86035.1010401@cornell.edu \
    --to=ivg2@cornell.edu \
    --cc=method@gentoo.org \
    --cc=pebenito@gentoo.org \
    --cc=sds@tycho.nsa.gov \
    --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.