Actually I had to introduce a new LSM hook to filter /proc pid listings.
And I'm far happier with the pid namespaces :)
But given that namespaces are making it upstream, what else is to be
gained from the bsdail module? What exactly are you looking for?
1. are you looking to cover all the corner cases - i.e. prevent killing
a process in another namespace through F_SETOWN or mqueue, etc?
2. are you looking for a potentially easier fix to the current absence
of isolation in the user namespace?
3. are you just generally looking to make lsm/selinux easier for
yourself to configure?
If 1, an selinux policy should cover you. So you can then skip to 3.
Or, alternatively, I do plan - as soon as my free time clears up a bit -
on demonstrating how to write some selinux policy to create a secure
container based on current -mm + your experimental network namespace
patches.
If 2, well, see 1. But for the long term solution, I don't think we
want that in an LSM. Rather we want to implement proper user namespace
enforcement in the kernel, then put 'policy' basically at the filesystem
layer and further in userspace. So maybe not exactly what I've outlined
before, but certainly similar. The filesystem can decide what user
namespace a file belongs to, whether based on cryptographic keys stored
with the file, or based on mount arguments, or something else. Users
can get access to those files using keys stored with their task_struct
if they are not in the right user namespace to otherwise access it.
Otherwise access to a file in another user namespace defaults to
the 3d mode bit, so you default to being 'other'. Further isolation
probably still belongs in selinux or another lsm.
If 3, then selinux policy modules may actually help you, else either
a new LSM (maybe like LIDS) or a userspace tool which is a front-end to
selinux policy, emulating the iptables rules formats, may be what you
want?
Actually with policy modules it gets much much better. I have in fact
been able to pretty easily write a short policy module to, say, create
an selinux user which ran as root and had full access to the system to
do system setup for automated testing. There is a learning curve in
having to look at existing modules for maybe a few days to get started,
but once you get started the policy modules do make it very easy to
add to current policy.
-serge
-