Upgrade vmware-workstation to 11.1.0 and vmware-player to 7.1.0

This commit is contained in:
Sergey Morozov
2015-04-25 17:29:15 +03:00
parent 06f65a5d33
commit bf991051d0
35 changed files with 1427 additions and 351 deletions

View File

@@ -1,41 +0,0 @@
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
--- 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;

View File

@@ -1,89 +0,0 @@
undefines DEPRECATED which is unfortunately also defined (as a string)
in <linux/printk.h>. Realistically, this macro isn't even used, so this
doesn't matter much. But it hushes some very loud warnings.
diff -rupN vmblock-only/shared/vm_assert.h vmblock-only.new/shared/vm_assert.h
--- vmblock-only/shared/vm_assert.h 2014-04-14 17:41:41.000000000 -0400
+++ vmblock-only.new/shared/vm_assert.h 2014-10-11 17:37:23.010352172 -0400
@@ -251,11 +251,13 @@ void WarningThrottled(uint32 *count, con
#define LOG_ONCE(_s) DO_ONCE(Log _s)
#ifdef VMX86_DEVEL
+ #undef DEPRECATED
#define DEPRECATED(_fix) DO_ONCE( \
Warning("%s:%d: %s is DEPRECATED. %s\n", \
__FILE__, __LINE__, __FUNCTION__, \
_fix))
#else
+ #undef DEPRECATED
#define DEPRECATED(_fix) do {} while (0)
#endif
diff -rupN vmci-only/shared/vm_assert.h vmci-only.new/shared/vm_assert.h
--- vmci-only/shared/vm_assert.h 2014-04-14 17:41:41.000000000 -0400
+++ vmci-only.new/shared/vm_assert.h 2014-10-11 17:37:08.936352130 -0400
@@ -251,11 +251,13 @@ void WarningThrottled(uint32 *count, con
#define LOG_ONCE(_s) DO_ONCE(Log _s)
#ifdef VMX86_DEVEL
+ #undef DEPRECATED
#define DEPRECATED(_fix) DO_ONCE( \
Warning("%s:%d: %s is DEPRECATED. %s\n", \
__FILE__, __LINE__, __FUNCTION__, \
_fix))
#else
+ #undef DEPRECATED
#define DEPRECATED(_fix) do {} while (0)
#endif
diff -rupN vmmon-only/include/vm_assert.h vmmon-only.new/include/vm_assert.h
--- vmmon-only/include/vm_assert.h 2014-04-14 20:06:20.000000000 -0400
+++ vmmon-only.new/include/vm_assert.h 2014-10-11 17:36:45.289352058 -0400
@@ -251,11 +251,13 @@ void WarningThrottled(uint32 *count, con
#define LOG_ONCE(_s) DO_ONCE(Log _s)
#ifdef VMX86_DEVEL
+ #undef DEPRECATED
#define DEPRECATED(_fix) DO_ONCE( \
Warning("%s:%d: %s is DEPRECATED. %s\n", \
__FILE__, __LINE__, __FUNCTION__, \
_fix))
#else
+ #undef DEPRECATED
#define DEPRECATED(_fix) do {} while (0)
#endif
diff -rupN vmnet-only/vm_assert.h vmnet-only.new/vm_assert.h
--- vmnet-only/vm_assert.h 2014-04-14 20:06:21.000000000 -0400
+++ vmnet-only.new/vm_assert.h 2014-10-11 17:37:14.364352146 -0400
@@ -251,11 +251,13 @@ void WarningThrottled(uint32 *count, con
#define LOG_ONCE(_s) DO_ONCE(Log _s)
#ifdef VMX86_DEVEL
+ #undef DEPRECATED
#define DEPRECATED(_fix) DO_ONCE( \
Warning("%s:%d: %s is DEPRECATED. %s\n", \
__FILE__, __LINE__, __FUNCTION__, \
_fix))
#else
+ #undef DEPRECATED
#define DEPRECATED(_fix) do {} while (0)
#endif
diff -rupN vsock-only/shared/vm_assert.h vsock-only.new/shared/vm_assert.h
--- vsock-only/shared/vm_assert.h 2014-04-14 17:41:41.000000000 -0400
+++ vsock-only.new/shared/vm_assert.h 2014-10-11 17:37:02.778352111 -0400
@@ -251,11 +251,13 @@ void WarningThrottled(uint32 *count, con
#define LOG_ONCE(_s) DO_ONCE(Log _s)
#ifdef VMX86_DEVEL
+ #undef DEPRECATED
#define DEPRECATED(_fix) DO_ONCE( \
Warning("%s:%d: %s is DEPRECATED. %s\n", \
__FILE__, __LINE__, __FUNCTION__, \
_fix))
#else
+ #undef DEPRECATED
#define DEPRECATED(_fix) do {} while (0)
#endif

View File

@@ -1,34 +0,0 @@
starting with kernel 3.6, d_revalidate takes an unsigned int "flags"
as the second argument, not a nameidata pointer! see fs/namei.c
for implementation
diff -Naur vmblock-only/linux/dentry.c vmblock-only/linux/dentry.c
--- vmblock-only/linux/dentry.c 2013-11-05 23:33:26.000000000 -0500
+++ vmblock-only/linux/dentry.c 2014-04-26 10:58:03.062635343 -0400
@@ -32,7 +32,7 @@
#include "block.h"
-static int DentryOpRevalidate(struct dentry *dentry, struct nameidata *nd);
+static int DentryOpRevalidate(struct dentry *dentry, unsigned int flags);
struct dentry_operations LinkDentryOps = {
.d_revalidate = DentryOpRevalidate,
@@ -60,7 +60,7 @@
static int
DentryOpRevalidate(struct dentry *dentry, // IN: dentry revalidating
- struct nameidata *nd) // IN: lookup flags & intent
+ unsigned int flags) // IN: lookup flags & intent
{
VMBlockInodeInfo *iinfo;
struct nameidata actualNd;
@@ -101,7 +101,7 @@
if (actualDentry &&
actualDentry->d_op &&
actualDentry->d_op->d_revalidate) {
- return actualDentry->d_op->d_revalidate(actualDentry, nd);
+ return actualDentry->d_op->d_revalidate(actualDentry, flags);
}
if (compat_path_lookup(iinfo->name, 0, &actualNd)) {

View File

@@ -1,15 +0,0 @@
replacing usage of vfs_readlink with new readlink_copy API
see: http://permalink.gmane.org/gmane.linux.kernel.commits.head/445090
diff -rupN vmblock-only/linux/inode.c vmblock-only/linux/inode.c
--- vmblock-only/linux/inode.c 2014-10-05 23:20:14.545218357 -0400
+++ vmblock-only/linux/inode.c 2014-10-05 23:33:01.549259933 -0400
@@ -178,7 +178,7 @@ InodeOpReadlink(struct dentry *dentry,
return -EINVAL;
}
- return vfs_readlink(dentry, buffer, buflen, iinfo->name);
+ return readlink_copy(buffer, buflen, iinfo->name);
}

View File

@@ -1,46 +0,0 @@
removing the no longer existing second parameter to sk_data_ready
doesn't seem it ever served a purpose.
diff -rupN vsock-only/linux/notify.c vsock-only.new/linux/notify.c
--- vsock-only/linux/notify.c 2013-11-05 23:33:27.000000000 -0500
+++ vsock-only.new/linux/notify.c 2014-10-05 23:46:47.943304728 -0400
@@ -515,8 +515,11 @@ VSockVmciHandleWrote(struct sock *sk,
vsk = vsock_sk(sk);
PKT_FIELD(vsk, sentWaitingRead) = FALSE;
#endif
-
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 15, 0)
+ sk->sk_data_ready(sk);
+#else
sk->sk_data_ready(sk, 0);
+#endif
}
diff -rupN vsock-only/linux/notifyQState.c vsock-only.new/linux/notifyQState.c
--- vsock-only/linux/notifyQState.c 2013-11-05 23:33:27.000000000 -0500
+++ vsock-only.new/linux/notifyQState.c 2014-10-05 23:46:33.231303931 -0400
@@ -164,7 +164,11 @@ VSockVmciHandleWrote(struct sock *sk,
struct sockaddr_vm *dst, // IN: unused
struct sockaddr_vm *src) // IN: unused
{
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 15, 0)
+ sk->sk_data_ready(sk);
+#else
sk->sk_data_ready(sk, 0);
+#endif
}
@@ -566,7 +570,11 @@ VSockVmciNotifyPktRecvPostDequeue(struct
}
/* See the comment in VSockVmciNotifyPktSendPostEnqueue */
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 15, 0)
+ sk->sk_data_ready(sk);
+#else
sk->sk_data_ready(sk, 0);
+#endif
}
return err;

View File

@@ -1,16 +0,0 @@
new alloc_netdev requires a new parameter. All examples in the kernel i've seen just
use the constant NET_NAME_UNKNOWN.
origionally from: https://communities.vmware.com/message/2425189
diff -rupN vmnet-only/netif.c vmnet-only.new/netif.c
--- vmnet-only/netif.c 2013-11-06 00:40:52.000000000 -0500
+++ vmnet-only.new/netif.c 2014-10-09 17:29:12.361307961 -0400
@@ -149,7 +149,7 @@ VNetNetIf_Create(char *devName, // IN:
memcpy(deviceName, devName, sizeof deviceName);
NULL_TERMINATE_STRING(deviceName);
- dev = alloc_netdev(sizeof *netIf, deviceName, VNetNetIfSetup);
+ dev = alloc_netdev(sizeof *netIf, deviceName, NET_NAME_USER, VNetNetIfSetup);
if (!dev) {
retval = -ENOMEM;
goto out;

View File

@@ -0,0 +1,47 @@
--- vmblock-only/linux/inode.c 2014-04-14 23:25:31.755344470 +0200
+++ vmblock-only/linux/inode.c.new 2014-04-14 23:23:31.732337759 +0200
@@ -178,7 +178,11 @@
return -EINVAL;
}
+#if LINUX_VERSION_CODE <= KERNEL_VERSION(3, 14, 99)
return vfs_readlink(dentry, buffer, buflen, iinfo->name);
+#else
+ return readlink_copy(buffer, buflen, iinfo->name);
+#endif
}
diff -rupN vsock-only/linux/notify.c vsock-only-mod/linux/notify.c
--- vsock-only/linux/notify.c 2014-04-15 03:11:41.000000000 +0530
+++ vsock-only-mod/linux/notify.c 2014-05-27 21:36:56.713291909 +0530
@@ -516,7 +516,7 @@ VSockVmciHandleWrote(struct sock *sk,
PKT_FIELD(vsk, sentWaitingRead) = FALSE;
#endif
- sk->sk_data_ready(sk, 0);
+ sk->sk_data_ready(sk);
}
diff -rupN vsock-only/linux/notifyQState.c vsock-only-mod/linux/notifyQState.c
--- vsock-only/linux/notifyQState.c 2014-04-15 03:11:41.000000000 +0530
+++ vsock-only-mod/linux/notifyQState.c 2014-05-27 21:38:52.561286734 +0530
@@ -164,7 +164,7 @@ VSockVmciHandleWrote(struct sock *sk,
struct sockaddr_vm *dst, // IN: unused
struct sockaddr_vm *src) // IN: unused
{
- sk->sk_data_ready(sk, 0);
+ sk->sk_data_ready(sk);
}
@@ -566,7 +566,7 @@ VSockVmciNotifyPktRecvPostDequeue(struct
}
/* See the comment in VSockVmciNotifyPktSendPostEnqueue */
- sk->sk_data_ready(sk, 0);
+ sk->sk_data_ready(sk);
}
return err;

View File

@@ -0,0 +1,236 @@
diff -u vmnet-only/driver.c vmnet-only.new/driver.c
--- vmnet-only/driver.c 2014-11-20 20:13:56.000000000 -0500
+++ vmnet-only.new/driver.c 2015-02-09 11:53:18.000000000 -0500
@@ -264,11 +264,17 @@
struct file * filp) // IN:
{
int ret = -ENOTTY;
-
- if (filp && filp->f_op && filp->f_op->ioctl == VNetFileOpIoctl) {
- ret = VNetFileOpIoctl(filp->f_dentry->d_inode, filp, iocmd, ioarg);
- }
- return ret;
+#if LINUX_VERSION_CODE < KERNEL_VERSION(3, 19, 0)
+ if (filp && filp->f_op && filp->f_op->ioctl == VNetFileOpIoctl) {
+ ret = VNetFileOpIoctl(filp->f_dentry->d_inode, filp, iocmd, ioarg);
+ }
+ return ret;
+#else
+ if (filp && filp->f_op && filp->f_op->ioctl == VNetFileOpIoctl) {
+ ret = VNetFileOpIoctl(filp->f_path.dentry->d_inode, filp, iocmd, ioarg);
+ }
+ return ret;
+#endif
}
@@ -1191,11 +1197,20 @@
struct inode *inode = NULL;
long err;
- if (filp && filp->f_dentry) {
- inode = filp->f_dentry->d_inode;
- }
- err = VNetFileOpIoctl(inode, filp, iocmd, ioarg);
- return err;
+ #if LINUX_VERSION_CODE < KERNEL_VERSION(3, 19, 0)
+ if (filp && filp->f_dentry) {
+ inode = filp->f_dentry->d_inode;
+ }
+ err = VNetFileOpIoctl(inode, filp, iocmd, ioarg);
+ return err;
+#else
+ if (filp && filp->f_path.dentry) {
+ inode = filp->f_path.dentry->d_inode;
+ }
+ err = VNetFileOpIoctl(inode, filp, iocmd, ioarg);
+ return err;
+#endif
+
}
#endif
diff -u vmnet-only/userif.c vmnet-only.new/userif.c
--- vmnet-only/userif.c 2014-11-20 20:13:56.000000000 -0500
+++ vmnet-only.new/userif.c 2015-02-09 11:56:03.000000000 -0500
@@ -523,7 +523,13 @@
.iov_base = buf,
.iov_len = len,
};
- return skb_copy_datagram_iovec(skb, 0, &iov, len);
+#if LINUX_VERSION_CODE < KERNEL_VERSION(3, 19, 0)
+ return skb_copy_datagram_iovec(skb, 0, &iov, len);
+#else
+ struct iov_iter to;
+ iov_iter_init(&to, READ, &iov, 1, len);
+ return skb_copy_datagram_iter(skb, 0, &to, len);
+#endif
}
diff -u vmblock-only.orig/linux/file.c vmblock-only/linux/file.c
--- vmblock-only.orig/linux/file.c 2015-02-11 12:18:29.000000000 -0500
+++ vmblock-only/linux/file.c 2015-02-11 12:41:41.000000000 -0500
@@ -92,7 +92,7 @@
* and that would try to acquire the inode's semaphore; if the two inodes
* are the same we'll deadlock.
*/
- if (actualFile->f_dentry && inode == actualFile->f_dentry->d_inode) {
+ if (actualFile->f_path.dentry && inode == actualFile->f_path.dentry->d_inode) {
Warning("FileOpOpen: identical inode encountered, open cannot succeed.\n");
if (filp_close(actualFile, current->files) < 0) {
Warning("FileOpOpen: unable to close opened file.\n");
diff -rupN vmblock-only.orig/linux/dentry.c vmblock-only/linux/dentry.c
--- vmblock-only.orig/linux/dentry.c 2015-02-14 18:05:46.000000000 -0500
+++ vmblock-only/linux/dentry.c 2015-02-14 18:09:59.000000000 -0500
@@ -63,7 +63,7 @@ DentryOpRevalidate(struct dentry *dentry
unsigned int flags) // IN: lookup flags & intent
{
VMBlockInodeInfo *iinfo;
- struct nameidata actualNd;
+ struct path actualNd;
struct dentry *actualDentry;
int ret;
diff -rupN vmblock-only.orig/linux/filesystem.c vmblock-only/linux/filesystem.c
--- vmblock-only.orig/linux/filesystem.c 2014-11-20 19:29:15.000000000 -0500
+++ vmblock-only/linux/filesystem.c 2015-02-14 18:10:49.000000000 -0500
@@ -322,7 +322,7 @@ Iget(struct super_block *sb, // IN: f
{
VMBlockInodeInfo *iinfo;
struct inode *inode;
- struct nameidata actualNd;
+ struct path actualNd;
ASSERT(sb);
diff -rupN vmblock-only.orig/shared/compat_namei.h vmblock-only/shared/compat_namei.h
--- vmblock-only.orig/shared/compat_namei.h 2014-11-20 19:29:15.000000000 -0500
+++ vmblock-only/shared/compat_namei.h 2015-02-14 18:08:38.000000000 -0500
@@ -26,21 +26,21 @@
* struct. They were both replaced with a struct path.
*/
#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 25)
-#define compat_vmw_nd_to_dentry(nd) (nd).path.dentry
+#define compat_vmw_nd_to_dentry(nd) (nd).dentry
#else
#define compat_vmw_nd_to_dentry(nd) (nd).dentry
#endif
/* In 2.6.25-rc2, path_release(&nd) was replaced with path_put(&nd.path). */
#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 25)
-#define compat_path_release(nd) path_put(&(nd)->path)
+#define compat_path_release(nd) path_put(nd)
#else
#define compat_path_release(nd) path_release(nd)
#endif
/* path_lookup was removed in 2.6.39 merge window VFS merge */
#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 38)
-#define compat_path_lookup(name, flags, nd) kern_path(name, flags, &((nd)->path))
+#define compat_path_lookup(name, flags, nd) kern_path(name, flags, nd)
#else
#define compat_path_lookup(name, flags, nd) path_lookup(name, flags, nd)
#endif
diff -ur vmci-only.orig/linux/vmciKernelIf.c vmci-only/linux/vmciKernelIf.c
--- vmci-only.orig/linux/vmciKernelIf.c 2014-06-13 01:20:45.000000000 +0200
+++ vmci-only/linux/vmciKernelIf.c 2015-02-21 17:59:47.011588979 +0100
@@ -1249,6 +1249,23 @@
return VMCI_SUCCESS;
}
+int memcpy_toiovec(struct iovec *iov, unsigned char *kdata, int len)
+{
+ while (len > 0) {
+ if (iov->iov_len) {
+ int copy = min_t(unsigned int, iov->iov_len, len);
+ if (copy_to_user(iov->iov_base, kdata, copy))
+ return -EFAULT;
+ kdata += copy;
+ len -= copy;
+ iov->iov_len -= copy;
+ iov->iov_base += copy;
+ }
+ iov++;
+ }
+
+ return 0;
+}
/*
*-----------------------------------------------------------------------------
diff -ur vsock-only.orig/linux/af_vsock.c vsock-only/linux/af_vsock.c
--- vsock-only.orig/linux/af_vsock.c 2015-02-21 18:09:14.147266976 +0100
+++ vsock-only/linux/af_vsock.c 2015-02-21 18:14:07.134285068 +0100
@@ -233,13 +233,13 @@
char __user *optval, int __user * optlen);
static int VSockVmciDgramSendmsg(struct kiocb *kiocb,
- struct socket *sock, struct msghdr *msg, size_t len);
+ struct socket *sock, struct user_msghdr *msg, size_t len);
static int VSockVmciDgramRecvmsg(struct kiocb *kiocb, struct socket *sock,
- struct msghdr *msg, size_t len, int flags);
+ struct user_msghdr *msg, size_t len, int flags);
static int VSockVmciStreamSendmsg(struct kiocb *kiocb,
- struct socket *sock, struct msghdr *msg, size_t len);
+ struct socket *sock, struct user_msghdr *msg, size_t len);
static int VSockVmciStreamRecvmsg(struct kiocb *kiocb, struct socket *sock,
- struct msghdr *msg, size_t len, int flags);
+ struct user_msghdr *msg, size_t len, int flags);
static int VSockVmciCreate(
#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 24)
@@ -4195,7 +4195,7 @@
static int
VSockVmciDgramSendmsg(struct kiocb *kiocb, // UNUSED
struct socket *sock, // IN: socket to send on
- struct msghdr *msg, // IN: message to send
+ struct user_msghdr *msg, // IN: message to send
size_t len) // IN: length of message
{
int err;
@@ -4525,7 +4525,7 @@
static int
VSockVmciStreamSendmsg(struct kiocb *kiocb, // UNUSED
struct socket *sock, // IN: socket to send on
- struct msghdr *msg, // IN: message to send
+ struct user_msghdr *msg, // IN: message to send
size_t len) // IN: length of message
{
struct sock *sk;
@@ -4694,7 +4694,7 @@
static int
VSockVmciDgramRecvmsg(struct kiocb *kiocb, // UNUSED
struct socket *sock, // IN: socket to receive from
- struct msghdr *msg, // IN/OUT: message to receive into
+ struct user_msghdr *msg, // IN/OUT: message to receive into
size_t len, // IN: length of receive buffer
int flags) // IN: receive flags
{
@@ -4704,6 +4704,7 @@
VMCIDatagram *dg;
size_t payloadLen;
struct sk_buff *skb;
+ struct iov_iter to;
sk = sock->sk;
noblock = flags & MSG_DONTWAIT;
@@ -4742,7 +4743,8 @@
}
/* Place the datagram payload in the user's iovec. */
- err = skb_copy_datagram_iovec(skb, sizeof *dg, msg->msg_iov, payloadLen);
+ iov_iter_init(&to, READ, msg->msg_iov, 1, payloadLen);
+ err = skb_copy_datagram_iter(skb, sizeof *dg, &to, payloadLen);
if (err) {
goto out;
}
@@ -4785,7 +4787,7 @@
static int
VSockVmciStreamRecvmsg(struct kiocb *kiocb, // UNUSED
struct socket *sock, // IN: socket to receive from
- struct msghdr *msg, // IN/OUT: message to receive into
+ struct user_msghdr *msg, // IN/OUT: message to receive into
size_t len, // IN: length of receive buffer
int flags) // IN: receive flags
{

View File

@@ -11,19 +11,6 @@ index ab7a727..e3ec9d2 100644
EXTRA_CFLAGS += $(call vm_check_build, $(AUTOCONF_DIR)/cachecreate.c, -DVMW_KMEMCR_HAS_DTOR, )
EXTRA_CFLAGS += $(call vm_check_build, $(AUTOCONF_DIR)/cachector.c, -DVMW_KMEMCR_CTOR_HAS_3_ARGS, )
diff --git a/vmci-only/Makefile.kernel b/vmci-only/Makefile.kernel
index ba343ee..861ea83 100644
--- a/vmci-only/Makefile.kernel
+++ b/vmci-only/Makefile.kernel
@@ -21,7 +21,7 @@ CC_OPTS += -DVMCI
INCLUDE += -I$(SRCROOT)/shared -I$(SRCROOT)/common -I$(SRCROOT)/linux
-EXTRA_CFLAGS := $(CC_OPTS) $(INCLUDE)
+EXTRA_CFLAGS := $(CC_OPTS) $(INCLUDE) $(LINUXINCLUDE)
obj-m += $(DRIVER).o
diff --git a/vmmon-only/Makefile.kernel b/vmmon-only/Makefile.kernel
index 8770d1d..c4746c3 100644
--- a/vmmon-only/Makefile.kernel
@@ -50,16 +37,4 @@ index d1e3133..665d428 100644
EXTRA_CFLAGS += $(call vm_check_build, $(SRCROOT)/netdev_has_net.c,-DVMW_NETDEV_HAS_NET, )
EXTRA_CFLAGS += $(call vm_check_build, $(SRCROOT)/netdev_has_dev_net.c,-DVMW_NETDEV_HAS_DEV_NET, )
EXTRA_CFLAGS += $(call vm_check_build, $(SRCROOT)/nfhook_uses_skb.c,-DVMW_NFHOOK_USES_SKB, )
diff --git a/vsock-only/Makefile.kernel b/vsock-only/Makefile.kernel
index b4629ee..264b8cb 100644
--- a/vsock-only/Makefile.kernel
+++ b/vsock-only/Makefile.kernel
@@ -25,7 +25,7 @@ INCLUDE += -I$(SRCROOT)/include
INCLUDE += -I$(SRCROOT)/linux
INCLUDE += -I$(SRCROOT)/common
-EXTRA_CFLAGS := $(CC_OPTS) $(INCLUDE)
+EXTRA_CFLAGS := $(CC_OPTS) $(INCLUDE) $(LINUXINCLUDE)
EXTRA_CFLAGS += $(call vm_check_build, $(AUTOCONF_DIR)/netcreate_num_params.c, -DVMW_NETCREATE_KERNARG, )

View File

@@ -15,23 +15,6 @@ index 2b81323..746c8b8 100644
DRIVER := vmblock
PRODUCT := ws
diff --git a/vmci-only/Makefile b/vmci-only/Makefile
index 8e9c5be..6ec828b 100644
--- a/vmci-only/Makefile
+++ b/vmci-only/Makefile
@@ -49,10 +49,10 @@ VM_UNAME = $(shell uname -r)
ifdef LINUXINCLUDE
HEADER_DIR = $(LINUXINCLUDE)
else
-HEADER_DIR = /lib/modules/$(VM_UNAME)/build/include
+HEADER_DIR = $(KERNEL_DIR)
endif
-BUILD_DIR = $(HEADER_DIR)/..
+BUILD_DIR = $(KBUILD_OUTPUT)
DRIVER := vmci
PRODUCT := ws
diff --git a/vmmon-only/Makefile b/vmmon-only/Makefile
index 5bd867b..91a83d4 100644
--- a/vmmon-only/Makefile
@@ -66,20 +49,3 @@ index d4eb73c..c7c6d38 100644
DRIVER := vmnet
PRODUCT := @@PRODUCT@@
diff --git a/vsock-only/Makefile b/vsock-only/Makefile
index 93dd61d..9765696 100644
--- a/vsock-only/Makefile
+++ b/vsock-only/Makefile
@@ -49,10 +49,10 @@ VM_UNAME = $(shell uname -r)
ifdef LINUXINCLUDE
HEADER_DIR = $(LINUXINCLUDE)
else
-HEADER_DIR = /lib/modules/$(VM_UNAME)/build/include
+HEADER_DIR = $(KERNEL_DIR)
endif
-BUILD_DIR = $(HEADER_DIR)/..
+BUILD_DIR = $(KBUILD_OUTPUT)
DRIVER := vsock
PRODUCT := ws

View File

@@ -1,11 +1,6 @@
starting with kernel 3.6, d_revalidate takes an unsigned int "flags"
as the second argument, not a nameidata pointer! see fs/namei.c
for implementation. Also changing vfs_follow_link to nd_set_link.
See: https://lkml.org/lkml/2013/9/9/236
diff -Naur vmblock-only/linux/inode.c vmblock-only/linux/inode.c
--- vmblock-only/linux/inode.c 2013-11-05 23:33:26.000000000 -0500
+++ vmblock-only/linux/inode.c 2014-04-26 10:58:03.063635343 -0400
diff -Naur a/linux/inode.c b/linux/inode.c
--- a/vmblock-only/linux/inode.c 2013-10-03 04:29:47.471339204 -0400
+++ b/vmblock-only/linux/inode.c 2013-10-03 04:31:56.607334636 -0400
@@ -36,7 +36,7 @@
/* Inode operations */
@@ -20,17 +15,16 @@ diff -Naur vmblock-only/linux/inode.c vmblock-only/linux/inode.c
InodeOpLookup(struct inode *dir, // IN: parent directory's inode
struct dentry *dentry, // IN: dentry to lookup
- struct nameidata *nd) // IN: lookup intent and information
+ unsigned int flags) // IN: lookup intent and information
+ unsigned int flags) // IN: lookup intent and information
{
char *filename;
struct inode *inode;
@@ -221,7 +221,8 @@
@@ -221,7 +221,7 @@
goto out;
}
- ret = vfs_follow_link(nd, iinfo->name);
+ nd_set_link(nd, iinfo->name);
+ ret = 0;
out:
#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 13)

View File

@@ -1,8 +1,3 @@
uses __getname/__putname instead of getname. getname was deprecated
the new code calls __getname (which really is a specific type of
memory allocator, then copies the string safely from user space
into the allocated buffer
--- vmblock-only/linux/control.c 2014-03-15 15:28:40.871076076 +0100
+++ vmblock-only/linux/control.c.new 2014-03-15 15:29:15.079074439 +0100
@@ -279,11 +279,17 @@
@@ -22,3 +17,5 @@ into the allocated buffer
+ }
+
for (i = strlen(name) - 1; i >= 0 && name[i] == '/'; i--) {
name[i] = '\0';
}

View File

@@ -21,3 +21,16 @@ diff -ruN work.orig/vmblock-only/linux/control.c work/vmblock-only/linux/control
return 0;
}
--- a/vmblock-only/linux/inode.c 2014-04-15 00:41:40.000000000 +0300
+++ b/vmblock-only/linux/inode.c 2014-04-23 12:44:50.005954179 +0300
@@ -135,7 +135,8 @@ InodeOpLookup(struct inode *dir, //
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);

View File

@@ -1,3 +1,60 @@
diff --git a/vmci-only/linux/driver.c b/vmci-only/linux/driver.c
index 921f25c..41a39e3 100644
--- a/vmci-only/linux/driver.c
+++ b/vmci-only/linux/driver.c
@@ -241,7 +241,24 @@ static unsigned int LinuxDriverPoll(struct file *file, poll_table *wait);
#define LinuxDriverUnlockIoctlPerFD(mutex) do {} while (0)
#endif
-static struct file_operations vmuser_fops;
+/*
+ * Moved file operations initialize here because of incompatibilites
+ * with Gentoo hardened profile/hardend Linux 3.
+ */
+static struct file_operations vmuser_fops = {
+ .owner = THIS_MODULE,
+ .poll = LinuxDriverPoll,
+#ifdef HAVE_UNLOCKED_IOCTL
+ .unlocked_ioctl = LinuxDriver_UnlockedIoctl,
+#else
+ .ioctl = LinuxDriver_Ioctl,
+#endif
+#ifdef HAVE_COMPAT_IOCTL
+ .compat_ioctl = LinuxDriver_UnlockedIoctl,
+#endif
+ .open = LinuxDriver_Open,
+ .release = LinuxDriver_Close
+};
/*
@@ -378,26 +395,6 @@ vmci_host_init(void)
return -ENOMEM;
}
- /*
- * Initialize the file_operations structure. Because this code is always
- * compiled as a module, this is fine to do it here and not in a static
- * initializer.
- */
-
- memset(&vmuser_fops, 0, sizeof vmuser_fops);
- vmuser_fops.owner = THIS_MODULE;
- vmuser_fops.poll = LinuxDriverPoll;
-#ifdef HAVE_UNLOCKED_IOCTL
- vmuser_fops.unlocked_ioctl = LinuxDriver_UnlockedIoctl;
-#else
- vmuser_fops.ioctl = LinuxDriver_Ioctl;
-#endif
-#ifdef HAVE_COMPAT_IOCTL
- vmuser_fops.compat_ioctl = LinuxDriver_UnlockedIoctl;
-#endif
- vmuser_fops.open = LinuxDriver_Open;
- vmuser_fops.release = LinuxDriver_Close;
-
sprintf(linuxState.deviceName, "vmci");
linuxState.major = 10;
linuxState.misc.minor = MISC_DYNAMIC_MINOR;
diff --git a/vmmon-only/linux/driver.c b/vmmon-only/linux/driver.c
index b21dd44..960c2aa 100644
--- a/vmmon-only/linux/driver.c