Skip to content

pkg-shadow support subordinate ids with user namespaces

Eric W. Biederman containers 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest11 patches 45 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/11Documentation for /etc/subuid and /etc/subgidman/Makefile.am man/subgid.5.xml man/subuid.5.xml+244 -00 replies
2/11login.defs.5: Document the new variables in login.defsman/Makefile.am man/login.defs.5.xml man/login.defs.d/SUB_GID_COUNT.xml +1 more+102 -00 replies
3/11Implement commonio_append.lib/commonio.c lib/commonio.h+31 -00 replies
3/11Implement commonio_append.lib/commonio.c lib/commonio.h+31 -00 replies
4/11Add backend support for suboridnate uids and gidsetc/login.defs lib/Makefile.am lib/getdef.c +2 more+566 -05 replies
5/11Implement find_new_sub_uids find_new_sub_gidslib/prototypes.h libmisc/Makefile.am libmisc/find_new_sub_gids.c +1 more+185 -00 replies
6/11userdel: Add support for removing subordinate user and group ids.src/userdel.c+115 -00 replies
7/11useradd: Add support for subordinate user identifierssrc/useradd.c+140 -10 replies
8/11Add support for detecting busy subordinate user idslibmisc/user_busy.c+13 -50 replies
9/11usermod: Add support for subordinate uids and gids.man/usermod.8.xml src/usermod.c+332 -30 replies
10/11newusers: Add support for assiging subordinate uids and gids.src/newusers.c+124 -00 replies
11/11newuidmap, newgidmap: New suid helpers for using subordinate uids and gidslibmisc/Makefile.am libmisc/idmapping.c libmisc/idmapping.h +6 more+856 -210 replies

Reviews trailers per patch

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

Read the v1 thread

Cover letter [PATCH 00/11] pkg-shadow support subordinate ids with user namespaces

The kernel support for user namespaces allows ordinary users to use multiple uids and gids if they can get a trusted program to tell the kernel the set of subordinate uids and gids they are allowed to use.

This is my work to make that trusted program.
Two new files are added /etc/subuid /etc/subgid that specify ranges of uids and gids that users may uses.

useradd, and newusers are modifed to add users to those files.

userdel is modeifed to remove users from those files.

usermod is modified to give manual control of what goes in those files.

newuidmap and newgidmap read the new files and update /proc/[pid]/uid_map and /proc/[pid]/gid_map respectively as requested by their command line parameters and as allowed by the /etc/subuid and /etc/subgid.

The following patches are against the current developent trunk of pkg-shadow svn rev 3745. With minor tweaking of man/Makefile.am these patches also apply to shadow 4.1.5.

Eric W. Biederman (11):
Documentation for /etc/subuid and /etc/subgid
login.defs.5: Document the new variables in login.defs Implement commonio_append.
Add backend support for suboridnate uids and gids
Implement find_new_sub_uids find_new_sub_gids
userdel: Add support for removing subordinate user and group ids.
useradd: Add support for subordinate user identifiers
Add support for detecting busy subordinate user ids
usermod: Add support for subordinate uids and gids.
newusers: Add support for assiging subordinate uids and gids. newuidmap,newgidmap: New suid helpers for using subordinate uids and gids
---

 etc/login.defs                     |    8 +
 lib/Makefile.am                    |    2 +
 lib/commonio.c                     |   30 ++
 lib/commonio.h                     |    1 +
 lib/getdef.c                       |    6 +
 lib/prototypes.h                   |    9 +
 lib/subordinateio.c                |  512 ++++++++++++++++++++++++++++++++++++
 lib/subordinateio.h                |   38 +++
 libmisc/Makefile.am                |    4 +
 libmisc/find_new_sub_gids.c        |   87 ++++++
 libmisc/find_new_sub_uids.c        |   87 ++++++
 libmisc/idmapping.c                |  126 +++++++++
 libmisc/idmapping.h                |   44 +++
 libmisc/user_busy.c                |   18 +-
 man/Makefile.am                    |   10 +
 man/login.defs.5.xml               |    8 +
 man/login.defs.d/SUB_GID_COUNT.xml |   46 ++++
 man/login.defs.d/SUB_UID_COUNT.xml |   46 ++++
 man/newgidmap.1.xml                |  157 +++++++++++
 man/newuidmap.1.xml                |  154 +++++++++++
 man/subgid.5.xml                   |  120 +++++++++
 man/subuid.5.xml                   |  120 +++++++++
 man/usermod.8.xml                  |   80 ++++++
 src/Makefile.am                    |    5 +-
 src/newgidmap.c                    |  183 +++++++++++++
 src/newuidmap.c                    |  183 +++++++++++++
 src/newusers.c                     |  124 +++++++++
 src/useradd.c                      |  141 ++++++++++-
 src/userdel.c                      |  115 ++++++++
 src/usermod.c                      |  255 ++++++++++++++++++-
 30 files changed, 2708 insertions(+), 11 deletions(-)