Skip to content

RFC user namespaces: add ns to user_struct

Serge E. Hallyn containers 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 RFC Latest8 patches 1 replyIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/8user namespaces: add ns to user_structfs/dquot.c fs/ioprio.c include/linux/sched.h +5 more+107 -150 replies
2/8Bump the value of CAP_LAST_CAP to reflect the current last cap value.include/linux/capability.h+4 -40 replies
3/8containers: add CAP_NS_OVERRIDE capabilityinclude/linux/capability.h+8 -10 replies
4/8user namespace: enforce CAP_NS_OVERRIDE for cross-namespace killkernel/signal.c+5 -01 reply
5/8userns: handle user namespaces in file sigiofs/fcntl.c include/linux/fs.h+48 -70 replies
6/8userns: agp: remove uid comparison as security checkdrivers/char/agp/frontend.c+1 -10 replies
7/8userns: reiser4: replace uid==0 check with capabilityfs/reiser4/super.c+1 -10 replies
8/8userns: oom_kill: remove uid==0 checksmm/oom_kill.c+1 -10 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.

Read the v1 thread

Cover letter [RFC] [PATCH 0/8] user namespaces: add ns to user_struct

I'm working toward fixing up some of the remaining uid==0 and uid1==uid2 checks, and beginning to restrict capabilities within namespaces.

This patchset starts to do that by

1. improving per-ns user_struct storing
2. introducing CAP_NS_OVERRIDE
3. requiring CAP_NS_OVERRIDE to signal another user namespace
4. remove a few uid==0 checks

Especially the last 3 patches are a definite security improvement in the face of user namespaces.

The next steps would be

* add user_ns to siginfo
* signals delivered to another userns (like sigchld) send uid 0.
* fix up more uid and gid checks (sigh)
* convert struct key_user?
* introduce uid aliases
* per-process keyring
* stores (user_ns,uid) keys
* allows process which is really (user_ns1, uid1) to act as though it were (user_ns2, uid2) on objects in user_ns2
* convert struct kstat (may have serious lifetime issues)

That should leave us in a reasonable shape to start considering how to really handle file access.

I still have a set of patches which tag struct inode with user_ns and patch ext2+ext3. But it's at the end of my patch set for now.

Comments welcome, on these patches, on the outlined next steps, or on anything I'm forgetting.

(Against 2.6.24-rc3-mm2)

thanks,
-serge