Skip to contentSkip to conversation

Policy error of the day

DISCUSSION Dale Amon 3 participants 15 messages Nov 29, 2003 – Dec 4, 2003 SELinux security module

lore
Share & tools
lore

Dale Amon

author
#0 lore raw

Ah...Russ... did you do something naughty? I note all of these are failing after the postinst.d/selinux. I wonder if you are expecting these installs to be occuring under selinux rather than on a non-selinux 'factory' machine in a chroot:

run-parts: /etc/dpkg/postinst.d/selinux exited with return code 1
dpkg: error processing selinux-policy-default (--configure):
1Error running trigger postinst: No such file or directory
run-parts: /etc/dpkg/postinst.d/selinux exited with return code 1
dpkg: error processing modutils (--configure):
1Error running trigger postinst: No such file or directory
run-parts: /etc/dpkg/postinst.d/selinux exited with return code 1
dpkg: error processing strace (--configure):
1Error running trigger postinst: No such file or directory
run-parts: /etc/dpkg/postinst.d/selinux exited with return code 1
dpkg: error processing hdparm (--configure):
1Error running trigger postinst: No such file or directory
run-parts: /etc/dpkg/postinst.d/selinux exited with return code 1
dpkg: error processing dash (--configure):
1Error running trigger postinst: No such file or directory
run-parts: /etc/dpkg/postinst.d/selinux exited with return code 1
dpkg: error processing cramfsprogs (--configure):
1Error running trigger postinst: No such file or directory
dpkg: dependency problems prevent configuration of initrd-tools:
initrd-tools depends on cramfsprogs; however:
Package cramfsprogs is not configured yet.
initrd-tools depends on dash | ash; however:
Package dash is not configured yet.
Package ash is not installed.
dpkg: error processing initrd-tools (--configure):
dependency problems - leaving unconfigured
Errors were encountered while processing:
selinux-policy-default
modutils
strace
hdparm
dash
cramfsprogs
initrd-tools
E: Sub-process /usr/bin/dpkg returned an error code (1)

Signature · 12 lines
------------------------------------------------------
   Dale Amon     [email protected]    +44-7802-188325
       International linux systems consultancy
     Hardware & software system design, security
    and networking, systems programming and Admin
	      "Have Laptop, Will Travel"
------------------------------------------------------

--
This message was distributed to subscribers of the selinux mailing list.
If you no longer wish to subscribe, send mail to [email protected] with
the words "unsubscribe selinux" without quotes as the message.
author
#1 lore raw
Quoted 4 lines · Dale Amon

Ah...Russ... did you do something naughty? I note all of these are failing after the postinst.d/selinux. I wonder if you are expecting these installs to be occuring under selinux rather than on a non-selinux 'factory' machine in a chroot:

I haven't heard back from you. Any ideas on what went wrong? I can work around it if necessary by putting a rm postinst.d/selinux in my script at that point so that package installation doesn't get broken, but sweeping things under the rug is hardly ever a good idea.

Signature · 12 lines
------------------------------------------------------
   Dale Amon     [email protected]    +44-7802-188325
       International linux systems consultancy
     Hardware & software system design, security
    and networking, systems programming and Admin
	      "Have Laptop, Will Travel"
------------------------------------------------------

--
This message was distributed to subscribers of the selinux mailing list.
If you no longer wish to subscribe, send mail to [email protected] with
the words "unsubscribe selinux" without quotes as the message.
#2 lore raw
Quoted 4 lines · Dale Amon

rm postinst.d/selinux in my script at that point so that package installation doesn't get broken, but sweeping things under the rug is hardly ever a good idea.

I don't sweep things under the rug.

Building Debian packages is not difficult. Getting the source to a package and modifying it to work the way you want should be easy enough.

Signature · 10 lines
http://www.coker.com.au/selinux/   My NSA Security Enhanced Linux packages
http://www.coker.com.au/bonnie++/  Bonnie++ hard drive benchmark
http://www.coker.com.au/postal/    Postal SMTP/POP benchmark
http://www.coker.com.au/~russell/  My home page


--
This message was distributed to subscribers of the selinux mailing list.
If you no longer wish to subscribe, send mail to [email protected] with
the words "unsubscribe selinux" without quotes as the message.
author
#3 lore raw
Quoted 7 lines · Russell Coker
Quoted 4 lines · Dale Amon

rm postinst.d/selinux in my script at that point so that package installation doesn't get broken, but sweeping things under the rug is hardly ever a good idea.

I don't sweep things under the rug.

Russ, that's not what I said. I said that me doing it in my script is sweeping it under the rug.

Quoted 2 lines

Building Debian packages is not difficult. Getting the source to a package and modifying it to work the way you want should be easy enough.

Certainly, if I was only doing this for a one time install or just for myself. I'm trying to beat on them to show up the problems so that someone else who can't sort in on their own doesn't have to.

Signature · 12 lines
------------------------------------------------------
   Dale Amon     [email protected]    +44-7802-188325
       International linux systems consultancy
     Hardware & software system design, security
    and networking, systems programming and Admin
	      "Have Laptop, Will Travel"
------------------------------------------------------

--
This message was distributed to subscribers of the selinux mailing list.
If you no longer wish to subscribe, send mail to [email protected] with
the words "unsubscribe selinux" without quotes as the message.
#4 lore raw
In reply to Dale Amon
Quoted 4 lines · Dale Amon

Ah...Russ... did you do something naughty? I note all of these are failing after the postinst.d/selinux. I wonder if you are expecting these installs to be occuring under selinux rather than on a non-selinux 'factory' machine in a chroot:

setfiles is supposed to operate on a non-SE machine. The current version apparently still has the code to check for validity of a context before applying it, the plan is to fix this and I thought it was already fixed. It will be fixed soon.

Signature · 10 lines
http://www.coker.com.au/selinux/   My NSA Security Enhanced Linux packages
http://www.coker.com.au/bonnie++/  Bonnie++ hard drive benchmark
http://www.coker.com.au/postal/    Postal SMTP/POP benchmark
http://www.coker.com.au/~russell/  My home page


--
This message was distributed to subscribers of the selinux mailing list.
If you no longer wish to subscribe, send mail to [email protected] with
the words "unsubscribe selinux" without quotes as the message.
author
#5 lore raw
Quoted 4 lines · Russell Coker

setfiles is supposed to operate on a non-SE machine. The current version apparently still has the code to check for validity of a context before applying it, the plan is to fix this and I thought it was already fixed. It will be fixed soon.

Thanks. That's the sort of thing I'm trying to shake out of the system. I'm not getting on you, just pointing out things so you can find 'em and fix 'em.

Signature · 12 lines
------------------------------------------------------
   Dale Amon     [email protected]    +44-7802-188325
       International linux systems consultancy
     Hardware & software system design, security
    and networking, systems programming and Admin
	      "Have Laptop, Will Travel"
------------------------------------------------------

--
This message was distributed to subscribers of the selinux mailing list.
If you no longer wish to subscribe, send mail to [email protected] with
the words "unsubscribe selinux" without quotes as the message.
author
#6 lore raw
In reply to Russell Coker
Quoted 4 lines · Russell Coker

setfiles is supposed to operate on a non-SE machine. The current version apparently still has the code to check for validity of a context before applying it, the plan is to fix this and I thought it was already fixed. It will be fixed soon.

BTW, this would be doubly good. I'm ever so slowly working my way towards a CD and to do so I'll need to run setfiles in a chroot on a non-selinux machine. If setfiles could still mark, that would be really good.

I might also note that during much of my builds I
temporarily replace setfiles with a script that
always returns true; (debootstrap does this also)
I had to do this for a few other things like
hostname and such or else script mediated package
installs in a chroot get horrible messed up.

If setfiles can now act reasonably on a non-selinux build machine, perhaps I should drop the temporary override?

It would be really nice if I could get by just with a policy.15 file instead of needing to write the disk image to a test machine, boot, label and then save the disk image.

Signature · 12 lines
------------------------------------------------------
   Dale Amon     [email protected]    +44-7802-188325
       International linux systems consultancy
     Hardware & software system design, security
    and networking, systems programming and Admin
	      "Have Laptop, Will Travel"
------------------------------------------------------

--
This message was distributed to subscribers of the selinux mailing list.
If you no longer wish to subscribe, send mail to [email protected] with
the words "unsubscribe selinux" without quotes as the message.
author
#7 lore raw
Quoted 4 lines · Dale Amon

temporarily replace setfiles with a script that always returns true; (debootstrap does this also) I had to do this for a few other things like hostname and such or else script mediated package

Just to avoid misunderstanding since I put the () in the wrong place. debootstrap overrides hostname and daemon-start-stop; I do those two PLUS setfiles.

Signature · 12 lines
------------------------------------------------------
   Dale Amon     [email protected]    +44-7802-188325
       International linux systems consultancy
     Hardware & software system design, security
    and networking, systems programming and Admin
	      "Have Laptop, Will Travel"
------------------------------------------------------

--
This message was distributed to subscribers of the selinux mailing list.
If you no longer wish to subscribe, send mail to [email protected] with
the words "unsubscribe selinux" without quotes as the message.
#8 lore raw
In reply to Russell Coker
Quoted 4 lines · Russell Coker

setfiles is supposed to operate on a non-SE machine. The current version apparently still has the code to check for validity of a context before applying it, the plan is to fix this and I thought it was already fixed. It will be fixed soon.

The fix wasn't in the last public release, but is in our current tree (and the sourceforge tree). It checks the errno from a security_check_context failure to see if it was just ENOENT (i.e. /selinux/context didn't exist), and doesn't generate an error in that case.

Signature · 8 lines
Stephen Smalley <[email protected]>
National Security Agency


--
This message was distributed to subscribers of the selinux mailing list.
If you no longer wish to subscribe, send mail to [email protected] with
the words "unsubscribe selinux" without quotes as the message.
#9 lore raw
Quoted 11 lines · Stephen Smalley
Quoted 4 lines · Russell Coker

setfiles is supposed to operate on a non-SE machine. The current version apparently still has the code to check for validity of a context before applying it, the plan is to fix this and I thought it was already fixed. It will be fixed soon.

The fix wasn't in the last public release, but is in our current tree (and the sourceforge tree). It checks the errno from a security_check_context failure to see if it was just ENOENT (i.e. /selinux/context didn't exist), and doesn't generate an error in that case.

BTW, this doesn't eliminate the need to have an xattr handler for the security namespace; setfiles cannot work without such a handler in the kernel.

Signature · 8 lines
Stephen Smalley <[email protected]>
National Security Agency


--
This message was distributed to subscribers of the selinux mailing list.
If you no longer wish to subscribe, send mail to [email protected] with
the words "unsubscribe selinux" without quotes as the message.
author
#10 lore raw
Quoted 3 lines · Stephen Smalley

BTW, this doesn't eliminate the need to have an xattr handler for the security namespace; setfiles cannot work without such a handler in the kernel.

Can it deal with a loopback image with xattr, where it is running in a chroot on a non-selinux system? ie, can it label the files on the loopback? I thought it would not be able to without an /selinux and a make load of the policy before hand, neither of which can be done in this situation. (ie building an image to be used on a CDROM)

Signature · 12 lines
------------------------------------------------------
   Dale Amon     [email protected]    +44-7802-188325
       International linux systems consultancy
     Hardware & software system design, security
    and networking, systems programming and Admin
	      "Have Laptop, Will Travel"
------------------------------------------------------

--
This message was distributed to subscribers of the selinux mailing list.
If you no longer wish to subscribe, send mail to [email protected] with
the words "unsubscribe selinux" without quotes as the message.
author
#11 lore raw

Stephen: I've sorted out my upgrades so it's time to get back to the selinux building...

I'm preparing a new kernel for the machine I build on and have just hesitated over the enabling of xattr's in the kernel config. I'm pretty sure the file system won't be automatically affected, but I want to do a "tell me three times on it" because I simply cannot afford to make this machine unable to boot under old kernels.

So, do all swear on a stack of bible and assorted other holy or unholy books that booting a kernel with xattr ext2 support enabled will *NOT* touch an existing file system and make it unuseable in, say a 2.2 kernel?

I would be *most* upset if that were to happen.

Signature · 12 lines
------------------------------------------------------
   Dale Amon     [email protected]    +44-7802-188325
       International linux systems consultancy
     Hardware & software system design, security
    and networking, systems programming and Admin
	      "Have Laptop, Will Travel"
------------------------------------------------------

--
This message was distributed to subscribers of the selinux mailing list.
If you no longer wish to subscribe, send mail to [email protected] with
the words "unsubscribe selinux" without quotes as the message.
author
#12 lore raw

Actually not as much immediate worry as I thought:
the most important machine is all reiserfs so unless I build with my xattr patches, it is guaranteed safe. However I may want to add those patches so I can test build rfs loop images, so the question still stands... running into the issue is just delayed a bit.

Signature · 12 lines
------------------------------------------------------
   Dale Amon     [email protected]    +44-7802-188325
       International linux systems consultancy
     Hardware & software system design, security
    and networking, systems programming and Admin
	      "Have Laptop, Will Travel"
------------------------------------------------------

--
This message was distributed to subscribers of the selinux mailing list.
If you no longer wish to subscribe, send mail to [email protected] with
the words "unsubscribe selinux" without quotes as the message.
#13 lore raw
In reply to Dale Amon
Quoted 8 lines · Dale Amon

I'm preparing a new kernel for the machine I build on and have just hesitated over the enabling of xattr's in the kernel config. I'm pretty sure the file system won't be automatically affected, but I want to do a "tell me three times on it" because I simply cannot afford to make this machine unable to boot under old kernels.

Quoted 4 lines

So, do all swear on a stack of bible and assorted other holy or unholy books that booting a kernel with xattr ext2 support enabled will *NOT* touch an existing file system and make it unuseable in, say a 2.2 kernel?

XATTR's don't appear on their own. You can have a file system driver compiled with XATTR options and nothing will happen as long as no programs try to set an xattr. Of course it would only take one program to do this...

In practise I have not found this to be a problem, I've run machines for months with XATTR enabled and not had it get used.

Signature · 10 lines
http://www.coker.com.au/selinux/   My NSA Security Enhanced Linux packages
http://www.coker.com.au/bonnie++/  Bonnie++ hard drive benchmark
http://www.coker.com.au/postal/    Postal SMTP/POP benchmark
http://www.coker.com.au/~russell/  My home page


--
This message was distributed to subscribers of the selinux mailing list.
If you no longer wish to subscribe, send mail to [email protected] with
the words "unsubscribe selinux" without quotes as the message.
#14 lore raw
In reply to Dale Amon
Quoted 8 lines · Dale Amon

I'm preparing a new kernel for the machine I build on and have just hesitated over the enabling of xattr's in the kernel config. I'm pretty sure the file system won't be automatically affected, but I want to do a "tell me three times on it" because I simply cannot afford to make this machine unable to boot under old kernels.

Quoted 6 lines

So, do all swear on a stack of bible and assorted other holy or unholy books that booting a kernel with xattr ext2 support enabled will *NOT* touch an existing file system and make it unuseable in, say a 2.2 kernel?

I would be *most* upset if that were to happen.

No promises, but my experience has been that unless you set the attributes on the filesystem, there is no harm. I've never had a problem until _after_ I've run setfiles to label the filesystem.

Signature · 8 lines
Stephen Smalley <[email protected]>
National Security Agency


--
This message was distributed to subscribers of the selinux mailing list.
If you no longer wish to subscribe, send mail to [email protected] with
the words "unsubscribe selinux" without quotes as the message.