smoverlay/app-emulation/vmware-modules/files/279-3.10-00-userns.patch

42 lines
1.7 KiB
Diff
Raw Normal View History

correctly initializes UID/GID values
gets UID correctly in light of user namespace API
origionally from https://462666.bugs.gentoo.org/attachment.cgi?id=342888
2014-05-01 18:11:14 +04:00
--- a/vmblock-only/linux/inode.c 2013-03-20 17:37:48.000000000 +0100
+++ b/vmblock-only/linux/inode.c 2013-03-20 17:41:22.000000000 +0100
@@ -135,7 +135,8 @@
inode->i_size = INODE_TO_IINFO(inode)->nameLen;
inode->i_version = 1;
inode->i_atime = inode->i_mtime = inode->i_ctime = CURRENT_TIME;
- inode->i_uid = inode->i_gid = 0;
+ inode->i_uid = GLOBAL_ROOT_UID;
+ inode->i_gid = GLOBAL_ROOT_GID;
inode->i_op = &LinkInodeOps;
d_add(dentry, inode);
--- a/vmci-only/linux/driver.c 2013-03-20 17:57:35.000000000 +0100
+++ b/vmci-only/linux/driver.c 2013-03-20 17:57:43.000000000 +0100
@@ -740,7 +740,7 @@
goto init_release;
}
- user = current_uid();
+ user = from_kuid(current_user_ns(), current_uid());
retval = VMCIContext_InitContext(initBlock.cid, initBlock.flags,
0 /* Unused */, vmciLinux->userVersion,
&user, &vmciLinux->context);
--- a/vsock-only/linux/af_vsock.c 2013-03-20 18:01:48.000000000 +0100
+++ b/vsock-only/linux/af_vsock.c 2013-03-20 18:01:58.000000000 +0100
@@ -2866,7 +2866,7 @@
vsk->connectTimeout = psk->connectTimeout;
} else {
vsk->trusted = capable(CAP_NET_ADMIN);
- vsk->owner = current_uid();
+ vsk->owner = from_kuid(current_user_ns(), current_uid());
vsk->queuePairSize = VSOCK_DEFAULT_QP_SIZE;
vsk->queuePairMinSize = VSOCK_DEFAULT_QP_SIZE_MIN;
vsk->queuePairMaxSize = VSOCK_DEFAULT_QP_SIZE_MAX;