Skip to contentSkip to conversation

security: introduce fs caps

PATCH chris friedhoff 5 participants 7 messages Nov 3, 2006 – Nov 6, 2006

lore
Share & tools
lore
#0 lore raw

The patch applies cleanly , compiles and runs smoothly against 2.6.18.1.

I'm running slackware-current with a 2.6.18.1 kernel on an ext3 filesystem.

Background why I use the patch:
With 2.6.18 to create a tuntap interface CAP_NET_ADMIN is required. Qemu uses tuntap to create a tap interface as a virtual net interface. Instead now running qemu with root privileges to give it the right to create a tap interface, i granted qemu with the help of the patch and Kaigai Kohei's userspace tools the cap-net_admin capability. So qemu runs again without root privilege but has now the right to create the tap interface.

Thanks for the patch. It reduces my the need of suid-bit progs. It should be given a spin in -mm.

I will document my experiences on http://www.friedhoff.org/fscaps.html

Chris

please cc me on my email-address

--------------------
Chris Friedhoff
[email protected]

#1 lore raw
Quoted 14 lines · chris friedhoff

The patch applies cleanly , compiles and runs smoothly against 2.6.18.1.

I'm running slackware-current with a 2.6.18.1 kernel on an ext3 filesystem.

Background why I use the patch:
With 2.6.18 to create a tuntap interface CAP_NET_ADMIN is required. Qemu uses tuntap to create a tap interface as a virtual net interface. Instead now running qemu with root privileges to give it the right to create a tap interface, i granted qemu with the help of the patch and Kaigai Kohei's userspace tools the cap-net_admin capability. So qemu runs again without root privilege but has now the right to create the tap interface.

Quoted 2 lines

Thanks for the patch. It reduces my the need of suid-bit progs. It should be given a spin in -mm.

One question is, if this were to be tested in -mm, do we want to keep this mutually exclusive from selinux through config, or should selinux stack on top of this?

Quoted 1 line

I will document my experiences on http://www.friedhoff.org/fscaps.html

Cool.

thanks,
-serge

#2 lore raw
Quoted 15 lines · Serge E. Hallyn
Quoted 14 lines · chris friedhoff

The patch applies cleanly , compiles and runs smoothly against 2.6.18.1.

I'm running slackware-current with a 2.6.18.1 kernel on an ext3 filesystem.

Background why I use the patch:
With 2.6.18 to create a tuntap interface CAP_NET_ADMIN is required. Qemu uses tuntap to create a tap interface as a virtual net interface. Instead now running qemu with root privileges to give it the right to create a tap interface, i granted qemu with the help of the patch and Kaigai Kohei's userspace tools the cap-net_admin capability. So qemu runs again without root privilege but has now the right to create the tap interface.

Quoted 6 lines
Quoted 2 lines

Thanks for the patch. It reduces my the need of suid-bit progs. It should be given a spin in -mm.

One question is, if this were to be tested in -mm, do we want to keep this mutually exclusive from selinux through config, or should selinux stack on top of this?

Given that SELinux already stacks with capability and you aren't using the security fields (last I looked), it would seem trivial to enable stacking with fscaps (just add a few secondary_ops calls to the SELinux hooks, right?).

Signature · 2 lines
Stephen Smalley
National Security Agency
#3 lore raw
Quoted 19 lines · Stephen Smalley
Quoted 18 lines · Serge E. Hallyn
Quoted 16 lines · chris friedhoff

The patch applies cleanly , compiles and runs smoothly against 2.6.18.1.

I'm running slackware-current with a 2.6.18.1 kernel on an ext3 filesystem.

Background why I use the patch:
With 2.6.18 to create a tuntap interface CAP_NET_ADMIN is required. Qemu uses tuntap to create a tap interface as a virtual net interface. Instead now running qemu with root privileges to give it the right to create a tap interface, i granted qemu with the help of the patch and Kaigai Kohei's userspace tools the cap-net_admin capability. So qemu runs again without root privilege but has now the right to create the tap interface.

Thanks for the patch. It reduces my the need of suid-bit progs. It should be given a spin in -mm.

Quoted 8 lines
Quoted 3 lines

One question is, if this were to be tested in -mm, do we want to keep this mutually exclusive from selinux through config, or should selinux stack on top of this?

Given that SELinux already stacks with capability and you aren't using the security fields (last I looked), it would seem trivial to enable stacking with fscaps (just add a few secondary_ops calls to the SELinux hooks, right?).

Yup, I just wasn't sure if there would be actual objections to the idea of enabling both at once.

I'll send out a patch - just as soon as I figure out where I left the src to begin with :)

thanks,
-serge

#4 lore raw
Quoted 6 lines · Serge E. Hallyn
Quoted 5 lines · Stephen Smalley
Quoted 3 lines · Serge E. Hallyn

One question is, if this were to be tested in -mm, do we want to keep this mutually exclusive from selinux through config, or should selinux stack on top of this?

Quoted 8 lines
Quoted 4 lines

Given that SELinux already stacks with capability and you aren't using the security fields (last I looked), it would seem trivial to enable stacking with fscaps (just add a few secondary_ops calls to the SELinux hooks, right?).

Yup, I just wasn't sure if there would be actual objections to the idea of enabling both at once.

I'll send out a patch - just as soon as I figure out where I left the src to begin with :)

To be honest from my understanding of SELinux there is no need at all to use FS caps on an SELinux system. Anything that could be done with FS caps would be done in a much more fine-grained method with SELinux, and the inheritance of filesystem-based capabilities should be masked by SELinux-allowed capabilities anyways. I guess it _can_ be done, but why? It's possible to set up an SELinux system so that there aren't even any SUID binaries, right? /etc/passwd can run as whatever random user and it will automatically transition to the appropriate domain such that it can read and modify /etc/shadow.

Cheers,
Kyle Moffett

#5 lore raw
Quoted 5 lines · Kyle Moffett

capabilities anyways. I guess it _can_ be done, but why? It's possible to set up an SELinux system so that there aren't even any SUID binaries, right? /etc/passwd can run as whatever random user and it will automatically transition to the appropriate domain such that it can read and modify /etc/shadow.

SELinux will not override DAC permissions. You can theoretically configure a system with no effective DAC security and just use MAC, but it is definitely not advised.

- James

Signature · 2 lines
James Morris
<[email protected]>
#6 lore raw
In reply to Kyle Moffett
Quoted 22 lines · Kyle Moffett
Quoted 15 lines · Serge E. Hallyn
Quoted 7 lines · Stephen Smalley
Quoted 5 lines · Serge E. Hallyn

One question is, if this were to be tested in -mm, do we want to keep
this mutually exclusive from selinux through config, or should selinux
stack on top of this?

Quoted 6 lines

Given that SELinux already stacks with capability and you aren't using
the security fields (last I looked), it would seem trivial to enable stacking with fscaps (just add a few secondary_ops calls to the SELinux
hooks, right?).

Quoted 5 lines

Yup, I just wasn't sure if there would be actual objections to the idea of enabling both at once.

I'll send out a patch - just as soon as I figure out where I left the src to begin with :)

Quoted 9 lines

To be honest from my understanding of SELinux there is no need at all to use FS caps on an SELinux system. Anything that could be done with FS caps would be done in a much more fine-grained method with SELinux, and the inheritance of filesystem-based capabilities should be masked by SELinux-allowed capabilities anyways. I guess it _can_ be done, but why? It's possible to set up an SELinux system so that there aren't even any SUID binaries, right? /etc/passwd can run as whatever random user and it will automatically transition to the appropriate domain such that it can read and modify /etc/shadow.

Not currently, no. SELinux typically applies its MAC checks after any DAC checks have already been applied, and will only further restrict access. Hence, you can use SELinux to limit what a process with capabilities can do, since it must also have the corresponding SELinux permissions, but you still need a way of gaining those capabilities in order to pass the usual Linux checks.

Using SELinux to authoritatively grant capabilities based on role/domain would be useful, and has been done by some people (via custom kernels), but doing so safely requires quite a bit of work in userspace and policy configuration. That wasn't viewed as practical for an initial deployment of MAC, and we didn't want to expose systems to greater risk.

Signature · 2 lines
Stephen Smalley
National Security Agency