aboutsummaryrefslogtreecommitdiffstats
path: root/fs/ufs/inode.c
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2012-10-02 14:11:09 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2012-10-02 14:11:09 -0400
commit437589a74b6a590d175f86cf9f7b2efcee7765e7 (patch)
tree37bf8635b1356d80ef002b00e84f3faf3d555a63 /fs/ufs/inode.c
parent68d47a137c3bef754923bccf73fb639c9b0bbd5e (diff)
parent72235465864d84cedb2d9f26f8e1de824ee20339 (diff)
Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/ebiederm/user-namespace
Pull user namespace changes from Eric Biederman: "This is a mostly modest set of changes to enable basic user namespace support. This allows the code to code to compile with user namespaces enabled and removes the assumption there is only the initial user namespace. Everything is converted except for the most complex of the filesystems: autofs4, 9p, afs, ceph, cifs, coda, fuse, gfs2, ncpfs, nfs, ocfs2 and xfs as those patches need a bit more review. The strategy is to push kuid_t and kgid_t values are far down into subsystems and filesystems as reasonable. Leaving the make_kuid and from_kuid operations to happen at the edge of userspace, as the values come off the disk, and as the values come in from the network. Letting compile type incompatible compile errors (present when user namespaces are enabled) guide me to find the issues. The most tricky areas have been the places where we had an implicit union of uid and gid values and were storing them in an unsigned int. Those places were converted into explicit unions. I made certain to handle those places with simple trivial patches. Out of that work I discovered we have generic interfaces for storing quota by projid. I had never heard of the project identifiers before. Adding full user namespace support for project identifiers accounts for most of the code size growth in my git tree. Ultimately there will be work to relax privlige checks from "capable(FOO)" to "ns_capable(user_ns, FOO)" where it is safe allowing root in a user names to do those things that today we only forbid to non-root users because it will confuse suid root applications. While I was pushing kuid_t and kgid_t changes deep into the audit code I made a few other cleanups. I capitalized on the fact we process netlink messages in the context of the message sender. I removed usage of NETLINK_CRED, and started directly using current->tty. Some of these patches have also made it into maintainer trees, with no problems from identical code from different trees showing up in linux-next. After reading through all of this code I feel like I might be able to win a game of kernel trivial pursuit." Fix up some fairly trivial conflicts in netfilter uid/git logging code. * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/ebiederm/user-namespace: (107 commits) userns: Convert the ufs filesystem to use kuid/kgid where appropriate userns: Convert the udf filesystem to use kuid/kgid where appropriate userns: Convert ubifs to use kuid/kgid userns: Convert squashfs to use kuid/kgid where appropriate userns: Convert reiserfs to use kuid and kgid where appropriate userns: Convert jfs to use kuid/kgid where appropriate userns: Convert jffs2 to use kuid and kgid where appropriate userns: Convert hpfs to use kuid and kgid where appropriate userns: Convert btrfs to use kuid/kgid where appropriate userns: Convert bfs to use kuid/kgid where appropriate userns: Convert affs to use kuid/kgid wherwe appropriate userns: On alpha modify linux_to_osf_stat to use convert from kuids and kgids userns: On ia64 deal with current_uid and current_gid being kuid and kgid userns: On ppc convert current_uid from a kuid before printing. userns: Convert s390 getting uid and gid system calls to use kuid and kgid userns: Convert s390 hypfs to use kuid and kgid where appropriate userns: Convert binder ipc to use kuids userns: Teach security_path_chown to take kuids and kgids userns: Add user namespace support to IMA userns: Convert EVM to deal with kuids and kgids in it's hmac computation ...
Diffstat (limited to 'fs/ufs/inode.c')
-rw-r--r--fs/ufs/inode.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/fs/ufs/inode.c b/fs/ufs/inode.c
index dd7c89d8a1c1..eb6d0b7dc879 100644
--- a/fs/ufs/inode.c
+++ b/fs/ufs/inode.c
@@ -597,8 +597,8 @@ static int ufs1_read_inode(struct inode *inode, struct ufs_inode *ufs_inode)
597 /* 597 /*
598 * Linux now has 32-bit uid and gid, so we can support EFT. 598 * Linux now has 32-bit uid and gid, so we can support EFT.
599 */ 599 */
600 inode->i_uid = ufs_get_inode_uid(sb, ufs_inode); 600 i_uid_write(inode, ufs_get_inode_uid(sb, ufs_inode));
601 inode->i_gid = ufs_get_inode_gid(sb, ufs_inode); 601 i_gid_write(inode, ufs_get_inode_gid(sb, ufs_inode));
602 602
603 inode->i_size = fs64_to_cpu(sb, ufs_inode->ui_size); 603 inode->i_size = fs64_to_cpu(sb, ufs_inode->ui_size);
604 inode->i_atime.tv_sec = fs32_to_cpu(sb, ufs_inode->ui_atime.tv_sec); 604 inode->i_atime.tv_sec = fs32_to_cpu(sb, ufs_inode->ui_atime.tv_sec);
@@ -645,8 +645,8 @@ static int ufs2_read_inode(struct inode *inode, struct ufs2_inode *ufs2_inode)
645 /* 645 /*
646 * Linux now has 32-bit uid and gid, so we can support EFT. 646 * Linux now has 32-bit uid and gid, so we can support EFT.
647 */ 647 */
648 inode->i_uid = fs32_to_cpu(sb, ufs2_inode->ui_uid); 648 i_uid_write(inode, fs32_to_cpu(sb, ufs2_inode->ui_uid));
649 inode->i_gid = fs32_to_cpu(sb, ufs2_inode->ui_gid); 649 i_gid_write(inode, fs32_to_cpu(sb, ufs2_inode->ui_gid));
650 650
651 inode->i_size = fs64_to_cpu(sb, ufs2_inode->ui_size); 651 inode->i_size = fs64_to_cpu(sb, ufs2_inode->ui_size);
652 inode->i_atime.tv_sec = fs64_to_cpu(sb, ufs2_inode->ui_atime); 652 inode->i_atime.tv_sec = fs64_to_cpu(sb, ufs2_inode->ui_atime);
@@ -745,8 +745,8 @@ static void ufs1_update_inode(struct inode *inode, struct ufs_inode *ufs_inode)
745 ufs_inode->ui_mode = cpu_to_fs16(sb, inode->i_mode); 745 ufs_inode->ui_mode = cpu_to_fs16(sb, inode->i_mode);
746 ufs_inode->ui_nlink = cpu_to_fs16(sb, inode->i_nlink); 746 ufs_inode->ui_nlink = cpu_to_fs16(sb, inode->i_nlink);
747 747
748 ufs_set_inode_uid(sb, ufs_inode, inode->i_uid); 748 ufs_set_inode_uid(sb, ufs_inode, i_uid_read(inode));
749 ufs_set_inode_gid(sb, ufs_inode, inode->i_gid); 749 ufs_set_inode_gid(sb, ufs_inode, i_gid_read(inode));
750 750
751 ufs_inode->ui_size = cpu_to_fs64(sb, inode->i_size); 751 ufs_inode->ui_size = cpu_to_fs64(sb, inode->i_size);
752 ufs_inode->ui_atime.tv_sec = cpu_to_fs32(sb, inode->i_atime.tv_sec); 752 ufs_inode->ui_atime.tv_sec = cpu_to_fs32(sb, inode->i_atime.tv_sec);
@@ -789,8 +789,8 @@ static void ufs2_update_inode(struct inode *inode, struct ufs2_inode *ufs_inode)
789 ufs_inode->ui_mode = cpu_to_fs16(sb, inode->i_mode); 789 ufs_inode->ui_mode = cpu_to_fs16(sb, inode->i_mode);
790 ufs_inode->ui_nlink = cpu_to_fs16(sb, inode->i_nlink); 790 ufs_inode->ui_nlink = cpu_to_fs16(sb, inode->i_nlink);
791 791
792 ufs_inode->ui_uid = cpu_to_fs32(sb, inode->i_uid); 792 ufs_inode->ui_uid = cpu_to_fs32(sb, i_uid_read(inode));
793 ufs_inode->ui_gid = cpu_to_fs32(sb, inode->i_gid); 793 ufs_inode->ui_gid = cpu_to_fs32(sb, i_gid_read(inode));
794 794
795 ufs_inode->ui_size = cpu_to_fs64(sb, inode->i_size); 795 ufs_inode->ui_size = cpu_to_fs64(sb, inode->i_size);
796 ufs_inode->ui_atime = cpu_to_fs64(sb, inode->i_atime.tv_sec); 796 ufs_inode->ui_atime = cpu_to_fs64(sb, inode->i_atime.tv_sec);