E Eric W. Biederman #
Message details and related content
As well as in these patches the code is also available from: git://git.kernel.org/pub/scm/linux/kernel/git/ebiederm/user-namespace.git for-testing v2 is slightly simplified. During the review I realized the previous quota changes while perhaps not wrong were in a part of the code I don't want people to think is ready for use on unprivileged filesystems yet. It has been a long time in coming but recently in the userns tree the superblock has been expanded with a s_user_ns field indicating the user namespace that owns a superblock. The s_user_ns owner of a superblock has three implications. - Only kuids and kgids that map into s_user_ns are allowed to be sent to a filesystem from the vfs. - If the uid or gid on the filesystem does not map into s_user_ns i_uid is set to INVALID_UID and i_gid is set to INVALID_GID. - The scope of permission checks can be changed from global to a capabilitiy check in s_user_ns. The overall strategy is to handle as much of this as possible in the VFS so that what is happening is consistent between filesystems and has widespread review, and so that individual filesystems don't need to duplicate code. This set of patches inserts checks to ensure only kuids and kgids that map into s_user_ns are sent to filesystems. This set of patches updates the vfs to deal with potentially unmapped uids and gids in the i_uid and i_gid fields. The strategy adopted is to deny any activity that causes inodes with unmapped uids or gid to be written to disk except for a chown that causes makes i_uid and i_gid to map into s_user_ns. Relaxing of the capability checks and adding new filesystems that would benefit from the changes is held off until the vfs support is complete. I believe this work is complete so if there anything questionable you see please let me know.