Skip to content

capabilities: per-process capbset

Serge E. Hallyn containers 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest3 patches 3 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/3capabilities: define CONFIG_COMMONCAPsecurity/Kconfig security/Makefile+7 -60 replies
2/3capabilities: introduce per-process capability bounding set (v3)include/linux/capability.h include/linux/init_task.h include/linux/prctl.h +8 more+63 -570 replies
3/3capabilities: reduce current's caps when reducing bsetsecurity/commoncap.c+6 -00 replies

Reviews trailers per patch

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

Read the v1 thread

Cover letter [PATCH 0/3] capabilities: per-process capbset

Here is a new per-process capability bounding set patchset which I expect to send to linux-kernel soon. It makes the capbset per-process. A process can only permanently remove bits from it's bounding set, not add them. To remove bits, CAP_SYS_ADMIN is currently needed. Maybe that's not the best choice, but some privilege should probably be required.

The intent is to allow a process tree to start with certain capabilities, i.e. CAP_MKNOD, permanently removed, so that running a setuid binary or one with file capabilities will still not result in those capabilities. The immediate use case for this is containers/virtual servers.

I am not taking the task_capability_lock during cap_prctl_setbset(), just as it is not taken when capabilities are calculated during fork. That means it can race with another task doing capsetp() on it, and with capgetp(). I'm still looking for comments on whether the fix I sent out last week is correct. If it is, then I'll take the task_capability_lock during cap_prctl_setbset().

thanks,
-serge