Update vmware-modules-279.3 from vmware overlay,
remove old vmware-modules-279.2 modified: app-emulation/vmware-modules/Manifest renamed: app-emulation/vmware-modules/files/279-userns.patch -> app-emulation/vmware-modules/files/279-3.10-00-userns.patch new file: app-emulation/vmware-modules/files/279-3.10-01-getname.patch new file: app-emulation/vmware-modules/files/279-3.10-03-deprecated.patch new file: app-emulation/vmware-modules/files/279-3.10-04-dentry.patch renamed: app-emulation/vmware-modules/files/279-vfsfollowlink.patch -> app-emulation/vmware-modules/files/279-3.10-05-inode.patch new file: app-emulation/vmware-modules/files/279-3.15-00-readlink.patch new file: app-emulation/vmware-modules/files/279-3.15-01-vsock.patch new file: app-emulation/vmware-modules/files/279-3.17-00-netdev.patch deleted: app-emulation/vmware-modules/files/279-vmblock-3.11.patch deleted: app-emulation/vmware-modules/files/279-vmblock-3.12.patch deleted: app-emulation/vmware-modules/files/hardened.patch deleted: app-emulation/vmware-modules/vmware-modules-279.2.ebuild modified: app-emulation/vmware-modules/vmware-modules-279.3.ebuild
This commit is contained in:
@@ -1,3 +1,7 @@
|
||||
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 @@
|
||||
24
app-emulation/vmware-modules/files/279-3.10-01-getname.patch
Normal file
24
app-emulation/vmware-modules/files/279-3.10-01-getname.patch
Normal file
@@ -0,0 +1,24 @@
|
||||
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 @@
|
||||
int i;
|
||||
int retval;
|
||||
|
||||
- name = getname(buf);
|
||||
+ name = __getname();
|
||||
if (IS_ERR(name)) {
|
||||
return PTR_ERR(name);
|
||||
}
|
||||
|
||||
+ i = strncpy_from_user(name, buf, PATH_MAX);
|
||||
+ if (i < 0 || i == PATH_MAX) {
|
||||
+ __putname(name);
|
||||
+ return -EINVAL;
|
||||
+ }
|
||||
+
|
||||
for (i = strlen(name) - 1; i >= 0 && name[i] == '/'; i--) {
|
||||
@@ -0,0 +1,89 @@
|
||||
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
|
||||
|
||||
34
app-emulation/vmware-modules/files/279-3.10-04-dentry.patch
Normal file
34
app-emulation/vmware-modules/files/279-3.10-04-dentry.patch
Normal file
@@ -0,0 +1,34 @@
|
||||
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)) {
|
||||
@@ -1,6 +1,11 @@
|
||||
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
|
||||
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
|
||||
@@ -36,7 +36,7 @@
|
||||
|
||||
/* Inode operations */
|
||||
@@ -15,16 +20,17 @@ diff -Naur a/linux/inode.c b/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,7 @@
|
||||
@@ -221,7 +221,8 @@
|
||||
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)
|
||||
@@ -0,0 +1,15 @@
|
||||
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);
|
||||
}
|
||||
|
||||
|
||||
46
app-emulation/vmware-modules/files/279-3.15-01-vsock.patch
Normal file
46
app-emulation/vmware-modules/files/279-3.15-01-vsock.patch
Normal file
@@ -0,0 +1,46 @@
|
||||
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;
|
||||
16
app-emulation/vmware-modules/files/279-3.17-00-netdev.patch
Normal file
16
app-emulation/vmware-modules/files/279-3.17-00-netdev.patch
Normal file
@@ -0,0 +1,16 @@
|
||||
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;
|
||||
@@ -1,89 +0,0 @@
|
||||
--- a/vmblock-only/linux/file.c
|
||||
+++ b/vmblock-only/linux/file.c
|
||||
@@ -38,46 +38,6 @@ typedef u64 inode_num_t;
|
||||
typedef ino_t inode_num_t;
|
||||
#endif
|
||||
|
||||
-/* Specifically for our filldir_t callback */
|
||||
-typedef struct FilldirInfo {
|
||||
- filldir_t filldir;
|
||||
- void *dirent;
|
||||
-} FilldirInfo;
|
||||
-
|
||||
-
|
||||
-/*
|
||||
- *----------------------------------------------------------------------------
|
||||
- *
|
||||
- * Filldir --
|
||||
- *
|
||||
- * Callback function for readdir that we use in place of the one provided.
|
||||
- * This allows us to specify that each dentry is a symlink, but pass through
|
||||
- * everything else to the original filldir function.
|
||||
- *
|
||||
- * Results:
|
||||
- * Original filldir's return value.
|
||||
- *
|
||||
- * Side effects:
|
||||
- * Directory information gets copied to user's buffer.
|
||||
- *
|
||||
- *----------------------------------------------------------------------------
|
||||
- */
|
||||
-
|
||||
-static int
|
||||
-Filldir(void *buf, // IN: Dirent buffer passed from FileOpReaddir
|
||||
- const char *name, // IN: Dirent name
|
||||
- int namelen, // IN: len of dirent's name
|
||||
- loff_t offset, // IN: Offset
|
||||
- inode_num_t ino, // IN: Inode number of dirent
|
||||
- unsigned int d_type) // IN: Type of file
|
||||
-{
|
||||
- FilldirInfo *info = buf;
|
||||
-
|
||||
- /* Specify DT_LNK regardless */
|
||||
- return info->filldir(info->dirent, name, namelen, offset, ino, DT_LNK);
|
||||
-}
|
||||
-
|
||||
-
|
||||
/* File operations */
|
||||
|
||||
/*
|
||||
@@ -166,11 +126,10 @@ FileOpOpen(struct inode *inode, // IN
|
||||
|
||||
static int
|
||||
FileOpReaddir(struct file *file, // IN
|
||||
- void *dirent, // IN
|
||||
- filldir_t filldir) // IN
|
||||
+ struct dir_context *ctx) // IN
|
||||
{
|
||||
int ret;
|
||||
- FilldirInfo info;
|
||||
+
|
||||
struct file *actualFile;
|
||||
|
||||
if (!file) {
|
||||
@@ -184,12 +143,10 @@ FileOpReaddir(struct file *file, // IN
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
- info.filldir = filldir;
|
||||
- info.dirent = dirent;
|
||||
-
|
||||
- actualFile->f_pos = file->f_pos;
|
||||
- ret = vfs_readdir(actualFile, Filldir, &info);
|
||||
- file->f_pos = actualFile->f_pos;
|
||||
+ /* Ricky Wong Yung Fei:
|
||||
+ * Manipulation of pos is now handled internally by iterate_dir().
|
||||
+ */
|
||||
+ ret = iterate_dir(actualFile, ctx);
|
||||
|
||||
return ret;
|
||||
}
|
||||
@@ -237,7 +194,7 @@ FileOpRelease(struct inode *inode, // IN
|
||||
|
||||
|
||||
struct file_operations RootFileOps = {
|
||||
- .readdir = FileOpReaddir,
|
||||
+ .iterate = FileOpReaddir,
|
||||
.open = FileOpOpen,
|
||||
.release = FileOpRelease,
|
||||
};
|
||||
@@ -1,79 +0,0 @@
|
||||
--- a/vmblock-only/linux/control.c 2013-10-03 04:29:47.471339204 -0400
|
||||
+++ b/vmblock-only/linux/control.c 2013-10-03 04:31:56.607334636 -0400
|
||||
@@ -283,7 +283,7 @@
|
||||
int i;
|
||||
int retval;
|
||||
|
||||
- name = getname(buf);
|
||||
+ name = __getname();
|
||||
if (IS_ERR(name)) {
|
||||
return PTR_ERR(name);
|
||||
}
|
||||
|
||||
+ i = strncpy_from_user(name, buf, PATH_MAX);
|
||||
+ if (i < 0 || i == PATH_MAX) {
|
||||
+ __putname(name);
|
||||
+ return -EINVAL;
|
||||
+ }
|
||||
+
|
||||
for (i = strlen(name) - 1; i >= 0 && name[i] == '/'; i--) {
|
||||
name[i] = '\0';
|
||||
}
|
||||
--- a/vmblock-only/linux/dentry.c 2013-10-03 04:29:47.471339204 -0400
|
||||
+++ b/vmblock-only/linux/dentry.c 2013-10-03 04:31:56.607334636 -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)) {
|
||||
--- 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 */
|
||||
static struct dentry *InodeOpLookup(struct inode *dir,
|
||||
- struct dentry *dentry, struct nameidata *nd);
|
||||
+ struct dentry *dentry, unsigned int flags);
|
||||
static int InodeOpReadlink(struct dentry *dentry, char __user *buffer, int buflen);
|
||||
#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 13)
|
||||
static void *InodeOpFollowlink(struct dentry *dentry, struct nameidata *nd);
|
||||
@@ -75,7 +75,7 @@
|
||||
static struct dentry *
|
||||
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
|
||||
{
|
||||
char *filename;
|
||||
struct inode *inode;
|
||||
@@ -221,7 +221,7 @@
|
||||
goto out;
|
||||
}
|
||||
|
||||
- ret = vfs_follow_link(nd, iinfo->name);
|
||||
+ nd_set_link(nd, iinfo->name);
|
||||
|
||||
out:
|
||||
#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 13)
|
||||
@@ -1,170 +0,0 @@
|
||||
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
|
||||
+++ b/vmmon-only/linux/driver.c
|
||||
@@ -178,7 +178,22 @@ static struct vm_operations_struct vmuser_mops = {
|
||||
#endif
|
||||
};
|
||||
|
||||
-static struct file_operations vmuser_fops;
|
||||
+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,
|
||||
+ .mmap = LinuxDriverMmap
|
||||
+};
|
||||
+
|
||||
static struct timer_list tscTimer;
|
||||
|
||||
/*
|
||||
@@ -357,27 +372,6 @@ init_module(void)
|
||||
spin_lock_init(&linuxState.pollListLock);
|
||||
#endif
|
||||
|
||||
- /*
|
||||
- * 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;
|
||||
- vmuser_fops.mmap = LinuxDriverMmap;
|
||||
-
|
||||
#ifdef VMX86_DEVEL
|
||||
devel_init_module();
|
||||
linuxState.minor = 0;
|
||||
diff --git a/vmnet-only/driver.c b/vmnet-only/driver.c
|
||||
index b12b982..40bd4cf 100644
|
||||
--- a/vmnet-only/driver.c
|
||||
+++ b/vmnet-only/driver.c
|
||||
@@ -165,7 +165,22 @@ static long VNetFileOpUnlockedIoctl(struct file * filp,
|
||||
unsigned int iocmd, unsigned long ioarg);
|
||||
#endif
|
||||
|
||||
-static struct file_operations vnetFileOps;
|
||||
+static struct file_operations vnetFileOps = {
|
||||
+ .owner = THIS_MODULE,
|
||||
+ .read = VNetFileOpRead,
|
||||
+ .write = VNetFileOpWrite,
|
||||
+ .poll = VNetFileOpPoll,
|
||||
+#ifdef HAVE_UNLOCKED_IOCTL
|
||||
+ .unlocked_ioctl = VNetFileOpUnlockedIoctl,
|
||||
+#else
|
||||
+ .ioctl = VNetFileOpIoctl,
|
||||
+#endif
|
||||
+#ifdef HAVE_COMPAT_IOCTL
|
||||
+ .compat_ioctl = VNetFileOpUnlockedIoctl,
|
||||
+#endif
|
||||
+ .open = VNetFileOpOpen,
|
||||
+ .release = VNetFileOpClose
|
||||
+};
|
||||
|
||||
/*
|
||||
* Utility functions
|
||||
@@ -476,28 +491,6 @@ init_module(void)
|
||||
goto err_proto;
|
||||
}
|
||||
|
||||
- /*
|
||||
- * 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(&vnetFileOps, 0, sizeof vnetFileOps);
|
||||
- vnetFileOps.owner = THIS_MODULE;
|
||||
- vnetFileOps.read = VNetFileOpRead;
|
||||
- vnetFileOps.write = VNetFileOpWrite;
|
||||
- vnetFileOps.poll = VNetFileOpPoll;
|
||||
-#ifdef HAVE_UNLOCKED_IOCTL
|
||||
- vnetFileOps.unlocked_ioctl = VNetFileOpUnlockedIoctl;
|
||||
-#else
|
||||
- vnetFileOps.ioctl = VNetFileOpIoctl;
|
||||
-#endif
|
||||
-#ifdef HAVE_COMPAT_IOCTL
|
||||
- vnetFileOps.compat_ioctl = VNetFileOpUnlockedIoctl;
|
||||
-#endif
|
||||
- vnetFileOps.open = VNetFileOpOpen;
|
||||
- vnetFileOps.release = VNetFileOpClose;
|
||||
-
|
||||
retval = register_chrdev(VNET_MAJOR_NUMBER, "vmnet", &vnetFileOps);
|
||||
if (retval) {
|
||||
LOG(0, (KERN_NOTICE "/dev/vmnet: could not register major device %d\n",
|
||||
Reference in New Issue
Block a user