diff --git a/app-emulation/vmware-modules/files/271-3.10-00-userns.patch b/app-emulation/vmware-modules/files/271-3.10-00-userns.patch new file mode 100644 index 0000000000000..b1b78b76300e8 --- /dev/null +++ b/app-emulation/vmware-modules/files/271-3.10-00-userns.patch @@ -0,0 +1,41 @@ +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; + diff --git a/app-emulation/vmware-modules/files/271-3.10-01-create_proc_entry.patch b/app-emulation/vmware-modules/files/271-3.10-01-create_proc_entry.patch new file mode 100644 index 0000000000000..889ae71be47b4 --- /dev/null +++ b/app-emulation/vmware-modules/files/271-3.10-01-create_proc_entry.patch @@ -0,0 +1,28 @@ +uses the new proc_create function to create /proc entries +instead of create_proc_entry which was deprecated: +https://lkml.org/lkml/2013/4/11/215 + +--- a/vmblock-only/linux/control.c 2013-05-21 19:21:19.165750556 +0200 ++++ b/vmblock-only/linux/control.c 2013-05-21 19:22:18.363747723 +0200 +@@ -208,9 +208,10 @@ + VMBlockSetProcEntryOwner(controlProcMountpoint); + + /* Create /proc/fs/vmblock/dev */ +- controlProcEntry = create_proc_entry(VMBLOCK_CONTROL_DEVNAME, +- VMBLOCK_CONTROL_MODE, +- controlProcDirEntry); ++ controlProcEntry = proc_create(VMBLOCK_CONTROL_DEVNAME, ++ VMBLOCK_CONTROL_MODE, ++ controlProcDirEntry, ++ &ControlFileOps); + if (!controlProcEntry) { + Warning("SetupProcDevice: could not create " VMBLOCK_DEVICE "\n"); + remove_proc_entry(VMBLOCK_CONTROL_MOUNTPOINT, controlProcDirEntry); +@@ -218,7 +219,6 @@ + return -EINVAL; + } + +- controlProcEntry->proc_fops = &ControlFileOps; + return 0; + } + diff --git a/app-emulation/vmware-modules/files/271-3.10-02-getname.patch b/app-emulation/vmware-modules/files/271-3.10-02-getname.patch new file mode 100644 index 0000000000000..05ed8dbcc374d --- /dev/null +++ b/app-emulation/vmware-modules/files/271-3.10-02-getname.patch @@ -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--) { diff --git a/app-emulation/vmware-modules/files/271-3.10-03-deprecated.patch b/app-emulation/vmware-modules/files/271-3.10-03-deprecated.patch new file mode 100644 index 0000000000000..981aabdd12606 --- /dev/null +++ b/app-emulation/vmware-modules/files/271-3.10-03-deprecated.patch @@ -0,0 +1,89 @@ +undefines DEPRECATED which is unfortunately also defined (as a string) +in . 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-10-09 21:50:54.221159088 -0400 ++++ vmblock-only.new/shared/vm_assert.h 2014-10-09 21:53:04.612166156 -0400 +@@ -237,11 +237,13 @@ EXTERN void WarningThrottled(uint32 *cou + #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-10-09 21:50:54.222159088 -0400 ++++ vmci-only.new/shared/vm_assert.h 2014-10-09 21:52:52.348165492 -0400 +@@ -237,11 +237,13 @@ EXTERN void WarningThrottled(uint32 *cou + #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-10-09 21:50:54.222159088 -0400 ++++ vmmon-only.new/include/vm_assert.h 2014-10-09 21:52:36.877164653 -0400 +@@ -237,11 +237,13 @@ EXTERN void WarningThrottled(uint32 *cou + #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-10-09 21:50:54.222159088 -0400 ++++ vmnet-only.new/vm_assert.h 2014-10-09 21:52:57.736165784 -0400 +@@ -237,11 +237,13 @@ EXTERN void WarningThrottled(uint32 *cou + #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-10-09 21:50:54.222159088 -0400 ++++ vsock-only.new/shared/vm_assert.h 2014-10-09 21:52:45.352165112 -0400 +@@ -237,11 +237,13 @@ EXTERN void WarningThrottled(uint32 *cou + #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 --git a/app-emulation/vmware-modules/files/271-3.10-04-unused-typedef.patch b/app-emulation/vmware-modules/files/271-3.10-04-unused-typedef.patch new file mode 100644 index 0000000000000..d5129ec689a41 --- /dev/null +++ b/app-emulation/vmware-modules/files/271-3.10-04-unused-typedef.patch @@ -0,0 +1,115 @@ +hushes warnings about unused typedefs which are part of the "static assert" +technique that the code uses. We simply add an "__attribute__((unused)) to each of them + +--- vmblock-only/shared/vm_assert.h 2014-10-07 22:43:39.519402467 -0400 ++++ vmblock-only/shared/vm_assert.h 2014-10-07 22:48:01.346409957 -0400 +@@ -317,7 +317,7 @@ EXTERN void WarningThrottled(uint32 *cou + #define ASSERT_ON_COMPILE(e) \ + do { \ + enum { AssertOnCompileMisused = ((e) ? 1 : -1) }; \ +- typedef char AssertOnCompileFailed[AssertOnCompileMisused]; \ ++ __attribute__((unused)) typedef char AssertOnCompileFailed[AssertOnCompileMisused]; \ + } while (0) + + +--- vmci-only/shared/vm_assert.h 2014-10-07 22:43:39.519402467 -0400 ++++ vmci-only/shared/vm_assert.h 2014-10-07 22:47:51.829409685 -0400 +@@ -317,7 +317,7 @@ EXTERN void WarningThrottled(uint32 *cou + #define ASSERT_ON_COMPILE(e) \ + do { \ + enum { AssertOnCompileMisused = ((e) ? 1 : -1) }; \ +- typedef char AssertOnCompileFailed[AssertOnCompileMisused]; \ ++ __attribute__((unused)) typedef char AssertOnCompileFailed[AssertOnCompileMisused]; \ + } while (0) + + +--- vmmon-only/include/vm_assert.h 2014-10-07 22:43:39.520402467 -0400 ++++ vmmon-only/include/vm_assert.h 2014-10-07 22:47:39.246409325 -0400 +@@ -317,7 +317,7 @@ EXTERN void WarningThrottled(uint32 *cou + #define ASSERT_ON_COMPILE(e) \ + do { \ + enum { AssertOnCompileMisused = ((e) ? 1 : -1) }; \ +- typedef char AssertOnCompileFailed[AssertOnCompileMisused]; \ ++ __attribute__((unused)) typedef char AssertOnCompileFailed[AssertOnCompileMisused]; \ + } while (0) + + +--- vmnet-only/vm_assert.h 2014-10-07 22:43:39.520402467 -0400 ++++ vmnet-only/vm_assert.h 2014-10-07 22:47:55.804409799 -0400 +@@ -317,7 +317,7 @@ EXTERN void WarningThrottled(uint32 *cou + #define ASSERT_ON_COMPILE(e) \ + do { \ + enum { AssertOnCompileMisused = ((e) ? 1 : -1) }; \ +- typedef char AssertOnCompileFailed[AssertOnCompileMisused]; \ ++ __attribute__((unused)) typedef char AssertOnCompileFailed[AssertOnCompileMisused]; \ + } while (0) + + +--- vsock-only/shared/vm_assert.h 2014-10-07 22:47:11.595408534 -0400 ++++ vsock-only/shared/vm_assert.h 2014-10-07 22:45:55.715406363 -0400 +@@ -317,7 +317,7 @@ EXTERN void WarningThrottled(uint32 *cou + #define ASSERT_ON_COMPILE(e) \ + do { \ + enum { AssertOnCompileMisused = ((e) ? 1 : -1) }; \ +- typedef char AssertOnCompileFailed[AssertOnCompileMisused]; \ ++ __attribute__((unused)) typedef char AssertOnCompileFailed[AssertOnCompileMisused]; \ + } while (0) + + +--- vsock-only/shared/vm_atomic.h 2013-11-05 23:33:27.000000000 -0500 ++++ vsock-only/shared/vm_atomic.h 2014-10-07 22:53:06.024418673 -0400 +@@ -2394,7 +2394,7 @@ Atomic_TestBit64(Atomic_uint64 *var, // + && 8 * sizeof (out) == size \ + && 8 * sizeof (cast) == size \ + ? 1 : -1 }; \ +- typedef char AssertOnCompileFailed[AssertOnCompileMisused]; \ ++ __attribute__((unused)) typedef char AssertOnCompileFailed[AssertOnCompileMisused]; \ + } \ + \ + \ +--- vmci-only/shared/vm_atomic.h 2013-11-05 23:33:27.000000000 -0500 ++++ vmci-only/shared/vm_atomic.h 2014-10-07 22:53:24.873419213 -0400 +@@ -2394,7 +2394,7 @@ Atomic_TestBit64(Atomic_uint64 *var, // + && 8 * sizeof (out) == size \ + && 8 * sizeof (cast) == size \ + ? 1 : -1 }; \ +- typedef char AssertOnCompileFailed[AssertOnCompileMisused]; \ ++ __attribute__((unused)) typedef char AssertOnCompileFailed[AssertOnCompileMisused]; \ + } \ + \ + \ + +--- vmblock-only/shared/vm_atomic.h 2013-11-05 23:33:27.000000000 -0500 ++++ vmblock-only/shared/vm_atomic.h 2014-10-07 22:53:31.073419390 -0400 +@@ -2394,7 +2394,7 @@ Atomic_TestBit64(Atomic_uint64 *var, // + && 8 * sizeof (out) == size \ + && 8 * sizeof (cast) == size \ + ? 1 : -1 }; \ +- typedef char AssertOnCompileFailed[AssertOnCompileMisused]; \ ++ __attribute__((unused)) typedef char AssertOnCompileFailed[AssertOnCompileMisused]; \ + } \ + \ + +--- vmnet-only/vm_atomic.h 2013-11-06 00:40:52.000000000 -0500 ++++ vmnet-only/vm_atomic.h 2014-10-07 23:04:50.637438831 -0400 +@@ -2394,7 +2394,7 @@ Atomic_TestBit64(Atomic_uint64 *var, // + && 8 * sizeof (out) == size \ + && 8 * sizeof (cast) == size \ + ? 1 : -1 }; \ +- typedef char AssertOnCompileFailed[AssertOnCompileMisused]; \ ++ __attribute__((unused)) typedef char AssertOnCompileFailed[AssertOnCompileMisused]; \ + } \ + \ + \ + +--- vmmon-only/include/vm_atomic.h 2013-11-06 00:40:52.000000000 -0500 ++++ vmmon-only/include/vm_atomic.h 2014-10-07 23:04:50.637438831 -0400 +@@ -2394,7 +2394,7 @@ Atomic_TestBit64(Atomic_uint64 *var, // + && 8 * sizeof (out) == size \ + && 8 * sizeof (cast) == size \ + ? 1 : -1 }; \ +- typedef char AssertOnCompileFailed[AssertOnCompileMisused]; \ ++ __attribute__((unused)) typedef char AssertOnCompileFailed[AssertOnCompileMisused]; \ + } \ + \ + \ diff --git a/app-emulation/vmware-modules/files/271-3.10-05-dentry.patch b/app-emulation/vmware-modules/files/271-3.10-05-dentry.patch new file mode 100644 index 0000000000000..f4f59d977408b --- /dev/null +++ b/app-emulation/vmware-modules/files/271-3.10-05-dentry.patch @@ -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)) { diff --git a/app-emulation/vmware-modules/files/271-3.10-06-inode.patch b/app-emulation/vmware-modules/files/271-3.10-06-inode.patch new file mode 100644 index 0000000000000..01c88930899cd --- /dev/null +++ b/app-emulation/vmware-modules/files/271-3.10-06-inode.patch @@ -0,0 +1,36 @@ +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 */ + 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,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) diff --git a/app-emulation/vmware-modules/files/271-3.10-07-hub.patch b/app-emulation/vmware-modules/files/271-3.10-07-hub.patch new file mode 100644 index 0000000000000..eebe4a23b304f --- /dev/null +++ b/app-emulation/vmware-modules/files/271-3.10-07-hub.patch @@ -0,0 +1,26 @@ +fixes a bug where sizeof was being used on a pointer when they clearly +meant to use the size of the array referred to. Fortunately, the amount is +always smaller than the actual size of the buffer, so likely not a security issue +(and was fixed in vmware-workstaiton 10 + +diff -rupN vmnet-only/hub.c vmnet-only.new/hub.c +--- vmnet-only/hub.c 2013-11-06 00:40:52.000000000 -0500 ++++ vmnet-only.new/hub.c 2014-10-07 18:45:34.403918680 -0400 +@@ -129,7 +129,7 @@ VNetHubFindHubByID(uint8 idNum[VNET_PVN_ + { + VNetHub *currHub = vnetHub; + while (currHub && (currHub->hubType != HUB_TYPE_PVN || +- memcmp(idNum, currHub->id.pvnID, sizeof idNum))) { ++ memcmp(idNum, currHub->id.pvnID, VNET_PVN_ID_LEN))) { + currHub = currHub->next; + } + return currHub; +@@ -312,7 +312,7 @@ VNetHubAlloc(Bool allocPvn, // IN: TRUE + + if (allocPvn) { + hub->hubType = HUB_TYPE_PVN; +- memcpy(hub->id.pvnID, id, sizeof id); ++ memcpy(hub->id.pvnID, id, VNET_PVN_ID_LEN); + ++pvnInstance; + } else { + hub->hubType = HUB_TYPE_VNET; diff --git a/app-emulation/vmware-modules/files/271-3.11-00-readdir.patch b/app-emulation/vmware-modules/files/271-3.11-00-readdir.patch new file mode 100644 index 0000000000000..b2f76d3e2b302 --- /dev/null +++ b/app-emulation/vmware-modules/files/271-3.11-00-readdir.patch @@ -0,0 +1,41 @@ +replaces usage of vfs_readdir with iterate_dir. origionally found here: +https://bugs.gentoo.org/show_bug.cgi?id=508204 + +diff -Naur vmblock-only/linux/file.c vmblock-only/linux/file.c +--- vmblock-only/linux/file.c 2013-11-05 23:33:26.000000000 -0500 ++++ vmblock-only/linux/file.c 2014-04-26 10:58:03.062635343 -0400 +@@ -166,11 +166,9 @@ + + static int + FileOpReaddir(struct file *file, // IN +- void *dirent, // IN +- filldir_t filldir) // IN ++ struct dir_context *ctx) + { + int ret; +- FilldirInfo info; + struct file *actualFile; + + if (!file) { +@@ -184,11 +182,8 @@ + return -EINVAL; + } + +- info.filldir = filldir; +- info.dirent = dirent; +- + actualFile->f_pos = file->f_pos; +- ret = vfs_readdir(actualFile, Filldir, &info); ++ ret = iterate_dir(actualFile, ctx); + file->f_pos = actualFile->f_pos; + + return ret; +@@ -237,7 +232,7 @@ + + + struct file_operations RootFileOps = { +- .readdir = FileOpReaddir, ++ .iterate = FileOpReaddir, + .open = FileOpOpen, + .release = FileOpRelease, + }; diff --git a/app-emulation/vmware-modules/files/271-3.11-01-filldir.patch b/app-emulation/vmware-modules/files/271-3.11-01-filldir.patch new file mode 100644 index 0000000000000..2eec99b7c1f82 --- /dev/null +++ b/app-emulation/vmware-modules/files/271-3.11-01-filldir.patch @@ -0,0 +1,53 @@ +simply remove the code for Filldir since it is no longer used with the new +iterate_dir API + +diff -rupN vmblock-only/linux/file.c vmblock-only.new/linux/file.c +--- vmblock-only/linux/file.c 2014-10-07 23:22:46.832469618 -0400 ++++ vmblock-only.new/linux/file.c 2014-10-07 23:24:35.276472720 -0400 +@@ -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 */ + + /* diff --git a/app-emulation/vmware-modules/files/271-3.13-00-vmnet.patch b/app-emulation/vmware-modules/files/271-3.13-00-vmnet.patch new file mode 100644 index 0000000000000..1bf22077b727e --- /dev/null +++ b/app-emulation/vmware-modules/files/271-3.13-00-vmnet.patch @@ -0,0 +1,39 @@ +the new API to get the hooknum +origionally from http://forums.gentoo.org/viewtopic-t-979802-start-25.html + +--- work/vmnet-only/filter.c 2013-08-27 20:29:04.000000000 +0100 ++++ patched/vmnet-only/filter.c 2014-01-26 01:09:05.184893854 +0000 +@@ -27,6 +27,7 @@ + #include "compat_module.h" + #include + #include ++#include + #if COMPAT_LINUX_VERSION_CHECK_LT(3, 2, 0) + # include + #else +@@ -203,7 +204,11 @@ + #endif + + static unsigned int ++#if LINUX_VERSION_CODE < KERNEL_VERSION(3, 13, 0) + VNetFilterHookFn(unsigned int hooknum, // IN: ++#else ++VNetFilterHookFn(const struct nf_hook_ops *ops, // IN: ++#endif + #ifdef VMW_NFHOOK_USES_SKB + struct sk_buff *skb, // IN: + #else +@@ -252,7 +257,12 @@ + + /* When the host transmits, hooknum is VMW_NF_INET_POST_ROUTING. */ + /* When the host receives, hooknum is VMW_NF_INET_LOCAL_IN. */ +- transmit = (hooknum == VMW_NF_INET_POST_ROUTING); ++ ++ #if LINUX_VERSION_CODE < KERNEL_VERSION(3, 13, 0) ++ transmit = (hooknum == VMW_NF_INET_POST_ROUTING); ++ #else ++ transmit = (ops->hooknum == VMW_NF_INET_POST_ROUTING); ++ #endif + + packetHeader = compat_skb_network_header(skb); + ip = (struct iphdr*)packetHeader; diff --git a/app-emulation/vmware-modules/files/271-3.15-00-readlink.patch b/app-emulation/vmware-modules/files/271-3.15-00-readlink.patch new file mode 100644 index 0000000000000..b8ee078220218 --- /dev/null +++ b/app-emulation/vmware-modules/files/271-3.15-00-readlink.patch @@ -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); + } + + diff --git a/app-emulation/vmware-modules/files/271-3.15-01-vsock.patch b/app-emulation/vmware-modules/files/271-3.15-01-vsock.patch new file mode 100644 index 0000000000000..9e8d9d1a32f77 --- /dev/null +++ b/app-emulation/vmware-modules/files/271-3.15-01-vsock.patch @@ -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; diff --git a/app-emulation/vmware-modules/files/271-3.17-00-netdev.patch b/app-emulation/vmware-modules/files/271-3.17-00-netdev.patch new file mode 100644 index 0000000000000..e3ee3aa099395 --- /dev/null +++ b/app-emulation/vmware-modules/files/271-3.17-00-netdev.patch @@ -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; diff --git a/app-emulation/vmware-modules/files/271-3.19-00-vmnet-warning.patch b/app-emulation/vmware-modules/files/271-3.19-00-vmnet-warning.patch new file mode 100644 index 0000000000000..b4d30c97a59c6 --- /dev/null +++ b/app-emulation/vmware-modules/files/271-3.19-00-vmnet-warning.patch @@ -0,0 +1,13 @@ +diff -rupN vmnet-only/vm_device_version.h vmnet-only.new/vm_device_version.h +--- vmnet-only/vm_device_version.h 2013-11-06 00:40:52.000000000 -0500 ++++ vmnet-only.new/vm_device_version.h 2015-05-05 12:03:06.879202223 -0400 +@@ -53,7 +53,9 @@ + * VMware HD Audio codec + * VMware HD Audio controller + */ ++#if LINUX_VERSION_CODE < KERNEL_VERSION(3, 19, 0) + #define PCI_VENDOR_ID_VMWARE 0x15AD ++#endif + #define PCI_DEVICE_ID_VMWARE_SVGA2 0x0405 + #define PCI_DEVICE_ID_VMWARE_SVGA 0x0710 + #define PCI_DEVICE_ID_VMWARE_NET 0x0720 diff --git a/app-emulation/vmware-modules/files/271-3.19-01-vmblock-path.patch b/app-emulation/vmware-modules/files/271-3.19-01-vmblock-path.patch new file mode 100644 index 0000000000000..178d1478ae595 --- /dev/null +++ b/app-emulation/vmware-modules/files/271-3.19-01-vmblock-path.patch @@ -0,0 +1,67 @@ +Sources: +https://531682.bugs.gentoo.org/attachment.cgi?id=396484 +https://531682.bugs.gentoo.org/attachment.cgi?id=396482 +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 -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 --git a/app-emulation/vmware-modules/files/271-3.19-02-vmci.patch b/app-emulation/vmware-modules/files/271-3.19-02-vmci.patch new file mode 100644 index 0000000000000..a8ec2b11daf92 --- /dev/null +++ b/app-emulation/vmware-modules/files/271-3.19-02-vmci.patch @@ -0,0 +1,29 @@ +diff -rupN vmci-only/linux/vmciKernelIf.c vmci-only.new/linux/vmciKernelIf.c +--- vmci-only/linux/vmciKernelIf.c 2015-05-05 11:22:55.276071501 -0400 ++++ vmci-only.new/linux/vmciKernelIf.c 2015-05-05 11:23:58.912074950 -0400 +@@ -40,6 +40,7 @@ + #include /* For memcpy_{to,from}iovec(). */ + #include + #include ++#include + + #include "compat_highmem.h" + #include "compat_interrupt.h" +diff -rupN vmci-only/linux/vmciKernelIf.c vmci-only.new/linux/vmciKernelIf.c +--- vmci-only/linux/vmciKernelIf.c 2013-11-05 23:33:26.000000000 -0500 ++++ vmci-only.new/linux/vmciKernelIf.c 2015-05-05 11:21:59.929068500 -0400 +@@ -1246,11 +1246,11 @@ __VMCIMemcpyFromQueue(void *dest, + } + + if (isIovec) { +- struct iovec *iov = (struct iovec *)dest; ++ struct msghdr *msg = dest; + int err; + + /* The iovec will track bytesCopied internally. */ +- err = memcpy_toiovec(iov, (uint8 *)va + pageOffset, toCopy); ++ err = memcpy_to_msg(msg, (uint8 *)va + pageOffset, toCopy); + if (err != 0) { + kunmap(kernelIf->page[pageIndex]); + return VMCI_ERROR_INVALID_ARGS; + diff --git a/app-emulation/vmware-modules/files/271-3.19-03-vmnet.patch b/app-emulation/vmware-modules/files/271-3.19-03-vmnet.patch new file mode 100644 index 0000000000000..041bfb6a6210c --- /dev/null +++ b/app-emulation/vmware-modules/files/271-3.19-03-vmnet.patch @@ -0,0 +1,29 @@ +diff -ur vmnet-only.orig/driver.c vmnet-only/driver.c +--- vmnet-only.orig/driver.c 2014-06-13 02:38:25.000000000 +0200 ++++ vmnet-only/driver.c 2015-02-21 17:31:22.630656305 +0100 +@@ -1236,8 +1236,8 @@ + struct inode *inode = NULL; + long err; + +- if (filp && filp->f_dentry) { +- inode = filp->f_dentry->d_inode; ++ if (filp && filp->f_path.dentry) { ++ inode = filp->f_path.dentry->d_inode; + } + err = VNetFileOpIoctl(inode, filp, iocmd, ioarg); + return err; +diff -ur vmnet-only.orig/userif.c vmnet-only/userif.c +--- vmnet-only.orig/userif.c 2014-06-13 02:38:25.000000000 +0200 ++++ vmnet-only/userif.c 2015-02-21 17:37:46.154589854 +0100 +@@ -523,7 +523,10 @@ + .iov_base = buf, + .iov_len = len, + }; +- return skb_copy_datagram_iovec(skb, 0, &iov, len); ++ struct iov_iter to; ++ ++ iov_iter_init(&to, READ, &iov, 1, len); ++ return skb_copy_datagram_iter(skb, 0, &to, len); + } + + diff --git a/app-emulation/vmware-modules/files/271-3.19-04-vsock.patch b/app-emulation/vmware-modules/files/271-3.19-04-vsock.patch new file mode 100644 index 0000000000000..8c9d3cb6dfe3f --- /dev/null +++ b/app-emulation/vmware-modules/files/271-3.19-04-vsock.patch @@ -0,0 +1,12 @@ +diff -rupN vsock-only/linux/af_vsock.c vsock-only.new/linux/af_vsock.c +--- vsock-only/linux/af_vsock.c 2015-05-05 11:26:05.145081792 -0400 ++++ vsock-only.new/linux/af_vsock.c 2015-05-05 11:30:54.304097466 -0400 +@@ -4266,7 +4266,7 @@ VSockVmciDgramSendmsg(struct kiocb *kioc + goto out; + } + +- memcpy_fromiovec(VMCI_DG_PAYLOAD(dg), msg->msg_iov, len); ++ memcpy_from_msg(VMCI_DG_PAYLOAD(dg), msg, len); + + dg->dst = VMCI_MAKE_HANDLE(remoteAddr->svm_cid, remoteAddr->svm_port); + dg->src = VMCI_MAKE_HANDLE(vsk->localAddr.svm_cid, vsk->localAddr.svm_port); diff --git a/app-emulation/vmware-modules/files/271-3.19-05-vsock.patch b/app-emulation/vmware-modules/files/271-3.19-05-vsock.patch new file mode 100644 index 0000000000000..2e412301d096b --- /dev/null +++ b/app-emulation/vmware-modules/files/271-3.19-05-vsock.patch @@ -0,0 +1,15 @@ +diff -rupN vsock-only/linux/af_vsock.c vsock-only.new/linux/af_vsock.c +--- vsock-only/linux/af_vsock.c 2015-05-05 11:31:35.710099711 -0400 ++++ vsock-only.new/linux/af_vsock.c 2015-05-05 11:36:33.260115840 -0400 +@@ -4727,7 +4727,11 @@ VSockVmciDgramRecvmsg(struct kiocb *kioc + } + + /* Place the datagram payload in the user's iovec. */ ++#if LINUX_VERSION_CODE < KERNEL_VERSION(3, 19, 0) + err = skb_copy_datagram_iovec(skb, sizeof *dg, msg->msg_iov, payloadLen); ++#else ++ err = skb_copy_datagram_iter(skb, sizeof *dg, &msg->msg_iter, payloadLen); ++#endif + if (err) { + goto out; + } diff --git a/app-emulation/vmware-modules/files/271-3.19-06-vmci_qpair.patch b/app-emulation/vmware-modules/files/271-3.19-06-vmci_qpair.patch new file mode 100644 index 0000000000000..1849a378456ed --- /dev/null +++ b/app-emulation/vmware-modules/files/271-3.19-06-vmci_qpair.patch @@ -0,0 +1,24 @@ +diff -rupN vsock-only.old/linux/af_vsock.c vsock-only/linux/af_vsock.c +--- vsock-only.old/linux/af_vsock.c 2015-05-06 20:41:47.684046762 -0400 ++++ vsock-only/linux/af_vsock.c 2015-05-06 20:52:15.245080779 -0400 +@@ -4629,7 +4629,7 @@ VSockVmciStreamSendmsg(struct kiocb *kio + * able to send. + */ + +- written = vmci_qpair_enquev(vsk->qpair, msg->msg_iov, ++ written = vmci_qpair_enquev(vsk->qpair, &msg->msg_iter.iov, + len - totalWritten, 0); + if (written < 0) { + err = -ENOMEM; +@@ -4874,9 +4874,9 @@ VSockVmciStreamRecvmsg(struct kiocb *kio + } + + if (flags & MSG_PEEK) { +- read = vmci_qpair_peekv(vsk->qpair, msg->msg_iov, len - copied, 0); ++ read = vmci_qpair_peekv(vsk->qpair, &msg->msg_iter.iov, len - copied, 0); + } else { +- read = vmci_qpair_dequev(vsk->qpair, msg->msg_iov, len - copied, 0); ++ read = vmci_qpair_dequev(vsk->qpair, &msg->msg_iter.iov, len - copied, 0); + } + + if (read < 0) { diff --git a/app-emulation/vmware-modules/files/271-hardened.patch b/app-emulation/vmware-modules/files/271-hardened.patch new file mode 100644 index 0000000000000..ea1b0f3007518 --- /dev/null +++ b/app-emulation/vmware-modules/files/271-hardened.patch @@ -0,0 +1,170 @@ +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", diff --git a/app-emulation/vmware-modules/files/279-3.10-00-userns.patch b/app-emulation/vmware-modules/files/279-3.10-00-userns.patch new file mode 100644 index 0000000000000..b1b78b76300e8 --- /dev/null +++ b/app-emulation/vmware-modules/files/279-3.10-00-userns.patch @@ -0,0 +1,41 @@ +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; + diff --git a/app-emulation/vmware-modules/files/279-3.10-01-getname.patch b/app-emulation/vmware-modules/files/279-3.10-01-getname.patch new file mode 100644 index 0000000000000..05ed8dbcc374d --- /dev/null +++ b/app-emulation/vmware-modules/files/279-3.10-01-getname.patch @@ -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--) { diff --git a/app-emulation/vmware-modules/files/279-3.10-03-deprecated.patch b/app-emulation/vmware-modules/files/279-3.10-03-deprecated.patch new file mode 100644 index 0000000000000..98b28aabcdeb9 --- /dev/null +++ b/app-emulation/vmware-modules/files/279-3.10-03-deprecated.patch @@ -0,0 +1,89 @@ +undefines DEPRECATED which is unfortunately also defined (as a string) +in . 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 + diff --git a/app-emulation/vmware-modules/files/279-3.10-04-dentry.patch b/app-emulation/vmware-modules/files/279-3.10-04-dentry.patch new file mode 100644 index 0000000000000..f4f59d977408b --- /dev/null +++ b/app-emulation/vmware-modules/files/279-3.10-04-dentry.patch @@ -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)) { diff --git a/app-emulation/vmware-modules/files/279-3.10-05-inode.patch b/app-emulation/vmware-modules/files/279-3.10-05-inode.patch new file mode 100644 index 0000000000000..01c88930899cd --- /dev/null +++ b/app-emulation/vmware-modules/files/279-3.10-05-inode.patch @@ -0,0 +1,36 @@ +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 */ + 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,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) diff --git a/app-emulation/vmware-modules/files/279-3.15-00-readlink.patch b/app-emulation/vmware-modules/files/279-3.15-00-readlink.patch new file mode 100644 index 0000000000000..b8ee078220218 --- /dev/null +++ b/app-emulation/vmware-modules/files/279-3.15-00-readlink.patch @@ -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); + } + + diff --git a/app-emulation/vmware-modules/files/279-3.15-01-vsock.patch b/app-emulation/vmware-modules/files/279-3.15-01-vsock.patch new file mode 100644 index 0000000000000..9e8d9d1a32f77 --- /dev/null +++ b/app-emulation/vmware-modules/files/279-3.15-01-vsock.patch @@ -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; diff --git a/app-emulation/vmware-modules/files/279-3.17-00-netdev.patch b/app-emulation/vmware-modules/files/279-3.17-00-netdev.patch new file mode 100644 index 0000000000000..e3ee3aa099395 --- /dev/null +++ b/app-emulation/vmware-modules/files/279-3.17-00-netdev.patch @@ -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; diff --git a/app-emulation/vmware-modules/files/279-3.18-00-version-redefined.patch b/app-emulation/vmware-modules/files/279-3.18-00-version-redefined.patch new file mode 100644 index 0000000000000..2d38824305800 --- /dev/null +++ b/app-emulation/vmware-modules/files/279-3.18-00-version-redefined.patch @@ -0,0 +1,24 @@ +--- a/vmci-only/shared/vm_device_version.h 2015-02-07 03:11:55.000000000 +0300 ++++ c/vmci-only/shared/vm_device_version.h 2015-02-24 03:58:06.041605450 +0300 +@@ -53,7 +53,9 @@ + * VMware HD Audio codec + * VMware HD Audio controller + */ ++#ifndef PCI_VENDOR_ID_VMWARE + #define PCI_VENDOR_ID_VMWARE 0x15AD ++#endif + #define PCI_DEVICE_ID_VMWARE_SVGA2 0x0405 + #define PCI_DEVICE_ID_VMWARE_SVGA 0x0710 + #define PCI_DEVICE_ID_VMWARE_VGA 0x0711 +--- a/vmnet-only/vm_device_version.h 2015-02-07 03:54:16.000000000 +0300 ++++ c/vmnet-only/vm_device_version.h 2015-02-24 03:58:06.044604981 +0300 +@@ -53,7 +53,9 @@ + * VMware HD Audio codec + * VMware HD Audio controller + */ ++#ifndef PCI_VENDOR_ID_VMWARE + #define PCI_VENDOR_ID_VMWARE 0x15AD ++#endif + #define PCI_DEVICE_ID_VMWARE_SVGA2 0x0405 + #define PCI_DEVICE_ID_VMWARE_SVGA 0x0710 + #define PCI_DEVICE_ID_VMWARE_VGA 0x0711 diff --git a/app-emulation/vmware-modules/files/279-3.19-00-compat-namei.patch b/app-emulation/vmware-modules/files/279-3.19-00-compat-namei.patch new file mode 100644 index 0000000000000..ec73500e979c6 --- /dev/null +++ b/app-emulation/vmware-modules/files/279-3.19-00-compat-namei.patch @@ -0,0 +1,23 @@ +--- a/vmblock-only/shared/compat_namei.h 2015-02-07 03:11:55.000000000 +0300 ++++ c/vmblock-only/shared/compat_namei.h 2015-02-24 03:51:25.235286047 +0300 +@@ -21,6 +21,20 @@ + + #include + ++/* Copy-n-paste from kernel's source/fs/namei.c */ ++struct nameidata { ++ struct path path; ++ struct qstr last; ++ struct path root; ++ struct inode *inode; /* path.dentry.d_inode */ ++ unsigned int flags; ++ unsigned seq, m_seq; ++ int last_type; ++ unsigned depth; ++ struct file *base; ++ char *saved_names[MAX_NESTED_LINKS + 1]; ++}; ++ + /* + * In 2.6.25-rc2, dentry and mount objects were removed from the nameidata + * struct. They were both replaced with a struct path. diff --git a/app-emulation/vmware-modules/files/279-3.19-01-dentry.patch b/app-emulation/vmware-modules/files/279-3.19-01-dentry.patch new file mode 100644 index 0000000000000..6f11a520a4470 --- /dev/null +++ b/app-emulation/vmware-modules/files/279-3.19-01-dentry.patch @@ -0,0 +1,13 @@ +--- a/vmnet-only/driver.c 2015-02-07 03:54:17.000000000 +0300 ++++ c/vmnet-only/driver.c 2015-02-24 03:58:06.043605137 +0300 +@@ -1191,8 +1191,8 @@ + struct inode *inode = NULL; + long err; + +- if (filp && filp->f_dentry) { +- inode = filp->f_dentry->d_inode; ++ if (filp && filp->f_path.dentry) { ++ inode = filp->f_path.dentry->d_inode; + } + err = VNetFileOpIoctl(inode, filp, iocmd, ioarg); + return err; diff --git a/app-emulation/vmware-modules/files/279-3.19-02-vmblock-path.patch b/app-emulation/vmware-modules/files/279-3.19-02-vmblock-path.patch new file mode 100644 index 0000000000000..178d1478ae595 --- /dev/null +++ b/app-emulation/vmware-modules/files/279-3.19-02-vmblock-path.patch @@ -0,0 +1,67 @@ +Sources: +https://531682.bugs.gentoo.org/attachment.cgi?id=396484 +https://531682.bugs.gentoo.org/attachment.cgi?id=396482 +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 -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 --git a/app-emulation/vmware-modules/files/279-3.19-03-iovec.patch b/app-emulation/vmware-modules/files/279-3.19-03-iovec.patch new file mode 100644 index 0000000000000..b016fec1e652d --- /dev/null +++ b/app-emulation/vmware-modules/files/279-3.19-03-iovec.patch @@ -0,0 +1,19 @@ +--- a/vmnet-only/userif.c 2015-02-07 03:54:17.000000000 +0300 ++++ c/vmnet-only/userif.c 2015-02-24 03:58:06.043605137 +0300 +@@ -523,7 +523,15 @@ + .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 --git a/app-emulation/vmware-modules/files/279-3.19-04-iovec.patch b/app-emulation/vmware-modules/files/279-3.19-04-iovec.patch new file mode 100644 index 0000000000000..9103c555663d5 --- /dev/null +++ b/app-emulation/vmware-modules/files/279-3.19-04-iovec.patch @@ -0,0 +1,39 @@ +diff -rupN vmci-only.old/linux/vmciKernelIf.c vmci-only/linux/vmciKernelIf.c +--- vmci-only.old/linux/vmciKernelIf.c 2015-04-28 18:05:56.000000000 +0000 ++++ vmci-only/linux/vmciKernelIf.c 2015-07-06 08:02:08.314262258 +0000 +@@ -40,6 +40,7 @@ + #include /* For memcpy_{to,from}iovec(). */ + #include + #include ++#include + + #include "compat_highmem.h" + #include "compat_interrupt.h" +@@ -1227,11 +1228,11 @@ __VMCIMemcpyToQueue(VMCIQueue *queue, + } + + if (isIovec) { +- struct iovec *iov = (struct iovec *)src; ++ struct msghdr *msg = (struct msghdr *)src; + int err; + + /* The iovec will track bytesCopied internally. */ +- err = memcpy_fromiovec((uint8 *)va + pageOffset, iov, toCopy); ++ err = memcpy_from_msg((u8 *)va + pageOffset, msg, toCopy); + if (err != 0) { + if (!kernelIf->isDataMapped) { + kunmap(kernelIf->page[pageIndex]); +@@ -1302,11 +1303,11 @@ __VMCIMemcpyFromQueue(void *dest, + } + + if (isIovec) { +- struct iovec *iov = (struct iovec *)dest; ++ struct msghdr *msg = (struct msghdr *)dest; + int err; + + /* The iovec will track bytesCopied internally. */ +- err = memcpy_toiovec(iov, (uint8 *)va + pageOffset, toCopy); ++ err = memcpy_to_msg(msg, (uint8 *)va + pageOffset, toCopy); + if (err != 0) { + if (!kernelIf->isDataMapped) { + kunmap(kernelIf->page[pageIndex]); diff --git a/app-emulation/vmware-modules/files/279-3.19-05-vmci_qpair.patch b/app-emulation/vmware-modules/files/279-3.19-05-vmci_qpair.patch new file mode 100644 index 0000000000000..1849a378456ed --- /dev/null +++ b/app-emulation/vmware-modules/files/279-3.19-05-vmci_qpair.patch @@ -0,0 +1,24 @@ +diff -rupN vsock-only.old/linux/af_vsock.c vsock-only/linux/af_vsock.c +--- vsock-only.old/linux/af_vsock.c 2015-05-06 20:41:47.684046762 -0400 ++++ vsock-only/linux/af_vsock.c 2015-05-06 20:52:15.245080779 -0400 +@@ -4629,7 +4629,7 @@ VSockVmciStreamSendmsg(struct kiocb *kio + * able to send. + */ + +- written = vmci_qpair_enquev(vsk->qpair, msg->msg_iov, ++ written = vmci_qpair_enquev(vsk->qpair, &msg->msg_iter.iov, + len - totalWritten, 0); + if (written < 0) { + err = -ENOMEM; +@@ -4874,9 +4874,9 @@ VSockVmciStreamRecvmsg(struct kiocb *kio + } + + if (flags & MSG_PEEK) { +- read = vmci_qpair_peekv(vsk->qpair, msg->msg_iov, len - copied, 0); ++ read = vmci_qpair_peekv(vsk->qpair, &msg->msg_iter.iov, len - copied, 0); + } else { +- read = vmci_qpair_dequev(vsk->qpair, msg->msg_iov, len - copied, 0); ++ read = vmci_qpair_dequev(vsk->qpair, &msg->msg_iter.iov, len - copied, 0); + } + + if (read < 0) { diff --git a/app-emulation/vmware-modules/files/279-3.19-06-vsock.patch b/app-emulation/vmware-modules/files/279-3.19-06-vsock.patch new file mode 100644 index 0000000000000..2e412301d096b --- /dev/null +++ b/app-emulation/vmware-modules/files/279-3.19-06-vsock.patch @@ -0,0 +1,15 @@ +diff -rupN vsock-only/linux/af_vsock.c vsock-only.new/linux/af_vsock.c +--- vsock-only/linux/af_vsock.c 2015-05-05 11:31:35.710099711 -0400 ++++ vsock-only.new/linux/af_vsock.c 2015-05-05 11:36:33.260115840 -0400 +@@ -4727,7 +4727,11 @@ VSockVmciDgramRecvmsg(struct kiocb *kioc + } + + /* Place the datagram payload in the user's iovec. */ ++#if LINUX_VERSION_CODE < KERNEL_VERSION(3, 19, 0) + err = skb_copy_datagram_iovec(skb, sizeof *dg, msg->msg_iov, payloadLen); ++#else ++ err = skb_copy_datagram_iter(skb, sizeof *dg, &msg->msg_iter, payloadLen); ++#endif + if (err) { + goto out; + } diff --git a/app-emulation/vmware-modules/files/279-3.19-07-vsock.patch b/app-emulation/vmware-modules/files/279-3.19-07-vsock.patch new file mode 100644 index 0000000000000..8c9d3cb6dfe3f --- /dev/null +++ b/app-emulation/vmware-modules/files/279-3.19-07-vsock.patch @@ -0,0 +1,12 @@ +diff -rupN vsock-only/linux/af_vsock.c vsock-only.new/linux/af_vsock.c +--- vsock-only/linux/af_vsock.c 2015-05-05 11:26:05.145081792 -0400 ++++ vsock-only.new/linux/af_vsock.c 2015-05-05 11:30:54.304097466 -0400 +@@ -4266,7 +4266,7 @@ VSockVmciDgramSendmsg(struct kiocb *kioc + goto out; + } + +- memcpy_fromiovec(VMCI_DG_PAYLOAD(dg), msg->msg_iov, len); ++ memcpy_from_msg(VMCI_DG_PAYLOAD(dg), msg, len); + + dg->dst = VMCI_MAKE_HANDLE(remoteAddr->svm_cid, remoteAddr->svm_port); + dg->src = VMCI_MAKE_HANDLE(vsk->localAddr.svm_cid, vsk->localAddr.svm_port); diff --git a/app-emulation/vmware-modules/files/279-5.10-00-userns.patch b/app-emulation/vmware-modules/files/279-5.10-00-userns.patch new file mode 100644 index 0000000000000..7a1bb987fecd4 --- /dev/null +++ b/app-emulation/vmware-modules/files/279-5.10-00-userns.patch @@ -0,0 +1,16 @@ +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); diff --git a/app-emulation/vmware-modules/files/304-3.10-00-dentry.patch b/app-emulation/vmware-modules/files/304-3.10-00-dentry.patch new file mode 100644 index 0000000000000..5cc445fcadf9a --- /dev/null +++ b/app-emulation/vmware-modules/files/304-3.10-00-dentry.patch @@ -0,0 +1,43 @@ +Minor change the API, now it just gets passed flags instead of a pointer to the nameidata +--- a/vmblock-only/linux/dentry.c 2015-02-07 03:11:55.000000000 +0300 ++++ c/vmblock-only/linux/dentry.c 2015-02-24 03:58:06.038605919 +0300 +@@ -32,7 +32,11 @@ + #include "block.h" + + ++#if LINUX_VERSION_CODE < KERNEL_VERSION(3, 10, 0) + static int DentryOpRevalidate(struct dentry *dentry, struct nameidata *nd); ++#else ++static int DentryOpRevalidate(struct dentry *dentry, unsigned int); ++#endif + + struct dentry_operations LinkDentryOps = { + .d_revalidate = DentryOpRevalidate, +@@ -58,9 +62,12 @@ + *---------------------------------------------------------------------------- + */ + +-static int +-DentryOpRevalidate(struct dentry *dentry, // IN: dentry revalidating +- struct nameidata *nd) // IN: lookup flags & intent ++#if LINUX_VERSION_CODE < KERNEL_VERSION(3, 10, 0) ++static int DentryOpRevalidate(struct dentry *dentry, struct nameidata *nd) ++#else ++static int DentryOpRevalidate(struct dentry *dentry, unsigned int flags) ++#endif ++ + { + VMBlockInodeInfo *iinfo; + struct nameidata actualNd; +@@ -101,7 +108,11 @@ + if (actualDentry && + actualDentry->d_op && + actualDentry->d_op->d_revalidate) { ++#if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 10, 0) ++ return actualDentry->d_op->d_revalidate(actualDentry, flags); ++#else + return actualDentry->d_op->d_revalidate(actualDentry, nd); ++#endif + } + + if (compat_path_lookup(iinfo->name, 0, &actualNd)) { diff --git a/app-emulation/vmware-modules/files/304-3.10-01-inode.patch b/app-emulation/vmware-modules/files/304-3.10-01-inode.patch new file mode 100644 index 0000000000000..e12d84d10e7b0 --- /dev/null +++ b/app-emulation/vmware-modules/files/304-3.10-01-inode.patch @@ -0,0 +1,94 @@ +Minor change the API, now it just gets passed flags instead of a pointer to the nameidata +Properly initializes UID/GID with repsect to namespaces +Some changes the readlink/setlink APIs +--- a/vmblock-only/linux/inode.c 2015-02-07 03:11:55.000000000 +0300 ++++ c/vmblock-only/linux/inode.c 2015-02-24 03:58:06.039605762 +0300 +@@ -35,9 +35,15 @@ + + + /* Inode operations */ +-static struct dentry *InodeOpLookup(struct inode *dir, +- struct dentry *dentry, struct nameidata *nd); ++ ++#if LINUX_VERSION_CODE < KERNEL_VERSION(3, 10, 0) ++static struct dentry *InodeOpLookup(struct inode *dir, struct dentry *dentry, struct nameidata *nd); + static int InodeOpReadlink(struct dentry *dentry, char __user *buffer, int buflen); ++#else ++static struct dentry *InodeOpLookup(struct inode *, struct dentry *, unsigned int); ++static int InodeOpReadlink(struct dentry *, char __user *, int); ++#endif ++ + #if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 13) + static void *InodeOpFollowlink(struct dentry *dentry, struct nameidata *nd); + #else +@@ -49,12 +55,15 @@ + .lookup = InodeOpLookup, + }; + ++#if LINUX_VERSION_CODE < KERNEL_VERSION(3, 13, 0) + static struct inode_operations LinkInodeOps = { ++#else ++struct inode_operations LinkInodeOps = { ++#endif + .readlink = InodeOpReadlink, + .follow_link = InodeOpFollowlink, + }; + +- + /* + *---------------------------------------------------------------------------- + * +@@ -75,7 +84,11 @@ + 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 ++#if LINUX_VERSION_CODE < KERNEL_VERSION(3, 10, 0) ++ struct nameidata *nd) // IN: lookup intent and information ++#else ++ unsigned int flags) ++#endif + { + char *filename; + struct inode *inode; +@@ -135,7 +148,12 @@ + inode->i_size = INODE_TO_IINFO(inode)->nameLen; + inode->i_version = 1; + inode->i_atime = inode->i_mtime = inode->i_ctime = CURRENT_TIME; ++#if LINUX_VERSION_CODE < KERNEL_VERSION(3, 10, 0) + inode->i_uid = inode->i_gid = 0; ++#else ++ inode->i_gid = make_kgid(current_user_ns(), 0); ++ inode->i_uid = make_kuid(current_user_ns(), 0); ++#endif + inode->i_op = &LinkInodeOps; + + d_add(dentry, inode); +@@ -177,7 +195,12 @@ + return -EINVAL; + } + +- return vfs_readlink(dentry, buffer, buflen, iinfo->name); ++#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 ++ + } + + +@@ -221,7 +244,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) +@@ -230,3 +253,4 @@ + return ret; + #endif + } ++ diff --git a/app-emulation/vmware-modules/files/304-3.10-02-control.patch b/app-emulation/vmware-modules/files/304-3.10-02-control.patch new file mode 100644 index 0000000000000..928835337511b --- /dev/null +++ b/app-emulation/vmware-modules/files/304-3.10-02-control.patch @@ -0,0 +1,57 @@ +The API to create proc entries now takes the file ops structure directly, instead of being set after the fact +Using new __getname/__putname API +--- a/vmblock-only/linux/control.c 2015-02-07 03:11:55.000000000 +0300 ++++ c/vmblock-only/linux/control.c 2015-02-24 03:58:06.038605919 +0300 +@@ -208,9 +208,11 @@ + VMBlockSetProcEntryOwner(controlProcMountpoint); + + /* Create /proc/fs/vmblock/dev */ +- controlProcEntry = create_proc_entry(VMBLOCK_CONTROL_DEVNAME, +- VMBLOCK_CONTROL_MODE, +- controlProcDirEntry); ++ controlProcEntry = proc_create(VMBLOCK_CONTROL_DEVNAME, ++ VMBLOCK_CONTROL_MODE, ++ controlProcDirEntry, ++ &ControlFileOps); ++ + if (!controlProcEntry) { + Warning("SetupProcDevice: could not create " VMBLOCK_DEVICE "\n"); + remove_proc_entry(VMBLOCK_CONTROL_MOUNTPOINT, controlProcDirEntry); +@@ -218,7 +220,10 @@ + return -EINVAL; + } + ++#if LINUX_VERSION_CODE < KERNEL_VERSION(3, 10, 0) + controlProcEntry->proc_fops = &ControlFileOps; ++#endif ++ + return 0; + } + +@@ -287,18 +287,24 @@ ExecuteBlockOp(const char __user *buf, + 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'; + } + + retval = i < 0 ? -EINVAL : blockOp(name, blocker); + +- putname(name); ++ __putname(name); + + return retval; + } diff --git a/app-emulation/vmware-modules/files/304-3.10-03-inline.patch b/app-emulation/vmware-modules/files/304-3.10-03-inline.patch new file mode 100644 index 0000000000000..fa8f36a35c295 --- /dev/null +++ b/app-emulation/vmware-modules/files/304-3.10-03-inline.patch @@ -0,0 +1,14 @@ +Hushes a warning +--- a/vmmon-only/linux/driver.c 2015-02-07 03:54:16.000000000 +0300 ++++ c/vmmon-only/linux/driver.c 2015-02-24 03:58:06.042605293 +0300 +@@ -1328,7 +1328,9 @@ + *----------------------------------------------------------------------------- + */ + +-__attribute__((always_inline)) static Bool ++#include ++ ++__always_inline static Bool + LinuxDriverSyncReadTSCs(uint64 *delta) // OUT: TSC max - TSC min + { + TSCDelta tscDelta; diff --git a/app-emulation/vmware-modules/files/304-3.11-00-readdir.patch b/app-emulation/vmware-modules/files/304-3.11-00-readdir.patch new file mode 100644 index 0000000000000..b2f76d3e2b302 --- /dev/null +++ b/app-emulation/vmware-modules/files/304-3.11-00-readdir.patch @@ -0,0 +1,41 @@ +replaces usage of vfs_readdir with iterate_dir. origionally found here: +https://bugs.gentoo.org/show_bug.cgi?id=508204 + +diff -Naur vmblock-only/linux/file.c vmblock-only/linux/file.c +--- vmblock-only/linux/file.c 2013-11-05 23:33:26.000000000 -0500 ++++ vmblock-only/linux/file.c 2014-04-26 10:58:03.062635343 -0400 +@@ -166,11 +166,9 @@ + + static int + FileOpReaddir(struct file *file, // IN +- void *dirent, // IN +- filldir_t filldir) // IN ++ struct dir_context *ctx) + { + int ret; +- FilldirInfo info; + struct file *actualFile; + + if (!file) { +@@ -184,11 +182,8 @@ + return -EINVAL; + } + +- info.filldir = filldir; +- info.dirent = dirent; +- + actualFile->f_pos = file->f_pos; +- ret = vfs_readdir(actualFile, Filldir, &info); ++ ret = iterate_dir(actualFile, ctx); + file->f_pos = actualFile->f_pos; + + return ret; +@@ -237,7 +232,7 @@ + + + struct file_operations RootFileOps = { +- .readdir = FileOpReaddir, ++ .iterate = FileOpReaddir, + .open = FileOpOpen, + .release = FileOpRelease, + }; diff --git a/app-emulation/vmware-modules/files/304-3.11-01-filldir.patch b/app-emulation/vmware-modules/files/304-3.11-01-filldir.patch new file mode 100644 index 0000000000000..2eec99b7c1f82 --- /dev/null +++ b/app-emulation/vmware-modules/files/304-3.11-01-filldir.patch @@ -0,0 +1,53 @@ +simply remove the code for Filldir since it is no longer used with the new +iterate_dir API + +diff -rupN vmblock-only/linux/file.c vmblock-only.new/linux/file.c +--- vmblock-only/linux/file.c 2014-10-07 23:22:46.832469618 -0400 ++++ vmblock-only.new/linux/file.c 2014-10-07 23:24:35.276472720 -0400 +@@ -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 */ + + /* diff --git a/app-emulation/vmware-modules/files/304-3.15-00-vsock.patch b/app-emulation/vmware-modules/files/304-3.15-00-vsock.patch new file mode 100644 index 0000000000000..9e8d9d1a32f77 --- /dev/null +++ b/app-emulation/vmware-modules/files/304-3.15-00-vsock.patch @@ -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; diff --git a/app-emulation/vmware-modules/files/304-3.18-00-version-redefined.patch b/app-emulation/vmware-modules/files/304-3.18-00-version-redefined.patch new file mode 100644 index 0000000000000..22d6325c9a90e --- /dev/null +++ b/app-emulation/vmware-modules/files/304-3.18-00-version-redefined.patch @@ -0,0 +1,25 @@ +Hushes some (but not all warnings) relating to redefinitions of this define +--- a/vmci-only/shared/vm_device_version.h 2015-02-07 03:11:55.000000000 +0300 ++++ c/vmci-only/shared/vm_device_version.h 2015-02-24 03:58:06.041605450 +0300 +@@ -53,7 +53,9 @@ + * VMware HD Audio codec + * VMware HD Audio controller + */ ++#ifndef PCI_VENDOR_ID_VMWARE + #define PCI_VENDOR_ID_VMWARE 0x15AD ++#endif + #define PCI_DEVICE_ID_VMWARE_SVGA2 0x0405 + #define PCI_DEVICE_ID_VMWARE_SVGA 0x0710 + #define PCI_DEVICE_ID_VMWARE_VGA 0x0711 +--- a/vmnet-only/vm_device_version.h 2015-02-07 03:54:16.000000000 +0300 ++++ c/vmnet-only/vm_device_version.h 2015-02-24 03:58:06.044604981 +0300 +@@ -53,7 +53,9 @@ + * VMware HD Audio codec + * VMware HD Audio controller + */ ++#ifndef PCI_VENDOR_ID_VMWARE + #define PCI_VENDOR_ID_VMWARE 0x15AD ++#endif + #define PCI_DEVICE_ID_VMWARE_SVGA2 0x0405 + #define PCI_DEVICE_ID_VMWARE_SVGA 0x0710 + #define PCI_DEVICE_ID_VMWARE_VGA 0x0711 diff --git a/app-emulation/vmware-modules/files/304-3.19-00-compat-namei.patch b/app-emulation/vmware-modules/files/304-3.19-00-compat-namei.patch new file mode 100644 index 0000000000000..0182077254a1e --- /dev/null +++ b/app-emulation/vmware-modules/files/304-3.19-00-compat-namei.patch @@ -0,0 +1,24 @@ +A copy of this since it is no longer exported by the kernel headers +--- a/vmblock-only/shared/compat_namei.h 2015-02-07 03:11:55.000000000 +0300 ++++ c/vmblock-only/shared/compat_namei.h 2015-02-24 03:51:25.235286047 +0300 +@@ -21,6 +21,20 @@ + + #include + ++/* Copy-n-paste from kernel's source/fs/namei.c */ ++struct nameidata { ++ struct path path; ++ struct qstr last; ++ struct path root; ++ struct inode *inode; /* path.dentry.d_inode */ ++ unsigned int flags; ++ unsigned seq, m_seq; ++ int last_type; ++ unsigned depth; ++ struct file *base; ++ char *saved_names[MAX_NESTED_LINKS + 1]; ++}; ++ + /* + * In 2.6.25-rc2, dentry and mount objects were removed from the nameidata + * struct. They were both replaced with a struct path. diff --git a/app-emulation/vmware-modules/files/304-3.19-01-dentry.patch b/app-emulation/vmware-modules/files/304-3.19-01-dentry.patch new file mode 100644 index 0000000000000..3e3be6542dda1 --- /dev/null +++ b/app-emulation/vmware-modules/files/304-3.19-01-dentry.patch @@ -0,0 +1,14 @@ +There is an level of abstrxtion in the newre API as of 3.19 here +--- a/vmnet-only/driver.c 2015-02-07 03:54:17.000000000 +0300 ++++ c/vmnet-only/driver.c 2015-02-24 03:58:06.043605137 +0300 +@@ -1191,8 +1191,8 @@ + struct inode *inode = NULL; + long err; + +- if (filp && filp->f_dentry) { +- inode = filp->f_dentry->d_inode; ++ if (filp && filp->f_path.dentry) { ++ inode = filp->f_path.dentry->d_inode; + } + err = VNetFileOpIoctl(inode, filp, iocmd, ioarg); + return err; diff --git a/app-emulation/vmware-modules/files/304-3.19-02-vmblock-path.patch b/app-emulation/vmware-modules/files/304-3.19-02-vmblock-path.patch new file mode 100644 index 0000000000000..178d1478ae595 --- /dev/null +++ b/app-emulation/vmware-modules/files/304-3.19-02-vmblock-path.patch @@ -0,0 +1,67 @@ +Sources: +https://531682.bugs.gentoo.org/attachment.cgi?id=396484 +https://531682.bugs.gentoo.org/attachment.cgi?id=396482 +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 -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 --git a/app-emulation/vmware-modules/files/304-3.19-03-iovec.patch b/app-emulation/vmware-modules/files/304-3.19-03-iovec.patch new file mode 100644 index 0000000000000..726d1173b3b39 --- /dev/null +++ b/app-emulation/vmware-modules/files/304-3.19-03-iovec.patch @@ -0,0 +1,20 @@ +using new iterator based API, this matches exactly the changes made upstream as of vmware-modules-304.2 +--- a/vmnet-only/userif.c 2015-02-07 03:54:17.000000000 +0300 ++++ c/vmnet-only/userif.c 2015-02-24 03:58:06.043605137 +0300 +@@ -523,7 +523,15 @@ + .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 --git a/app-emulation/vmware-modules/files/304-3.19-04-iovec.patch b/app-emulation/vmware-modules/files/304-3.19-04-iovec.patch new file mode 100644 index 0000000000000..83f0cc8fcbbfc --- /dev/null +++ b/app-emulation/vmware-modules/files/304-3.19-04-iovec.patch @@ -0,0 +1,59 @@ +Some parts of the iovec API were replaced by the similar message API. Refactoring the code to use that. +--- a/vmci-only/linux/vmciKernelIf.c 2015-02-07 03:11:55.000000000 +0300 ++++ c/vmci-only/linux/vmciKernelIf.c 2015-02-24 03:58:06.041605450 +0300 +@@ -40,6 +40,7 @@ + #include /* For memcpy_{to,from}iovec(). */ + #include + #include ++#include + + #include "compat_highmem.h" + #include "compat_interrupt.h" +@@ -1196,21 +1197,21 @@ + } else { + toCopy = size - bytesCopied; + } +- ++ /* Code cloned from kernels drivers/misc/vmw_vmci/vmci_queue_pair.c */ + if (isIovec) { +- struct iovec *iov = (struct iovec *)src; +- int err; ++ struct msghdr *msg = (struct msghdr *)src; ++ int err; + +- /* The iovec will track bytesCopied internally. */ +- err = memcpy_fromiovec((uint8 *)va + pageOffset, iov, toCopy); +- if (err != 0) { +- if (kernelIf->host) { +- kunmap(kernelIf->u.h.page[pageIndex]); ++ /* The iovec will track bytes_copied internally. */ ++ err = memcpy_from_msg((u8 *)va + pageOffset, msg, toCopy); ++ if (err != 0) { ++ if (kernelIf->host) ++ kunmap(kernelIf->u.h.page[pageIndex]); ++ return VMCI_ERROR_INVALID_ARGS; + } +- return VMCI_ERROR_INVALID_ARGS; +- } +- } else { +- memcpy((uint8 *)va + pageOffset, (uint8 *)src + bytesCopied, toCopy); ++ } else { ++ memcpy((u8 *)va + pageOffset, ++ (u8 *)src + bytesCopied, toCopy); + } + + bytesCopied += toCopy; +@@ -1273,11 +1274,11 @@ + } + + if (isIovec) { +- struct iovec *iov = (struct iovec *)dest; ++ struct msghdr *msg = (struct msghdr *)dest; + int err; + + /* The iovec will track bytesCopied internally. */ +- err = memcpy_toiovec(iov, (uint8 *)va + pageOffset, toCopy); ++ err = memcpy_to_msg(msg, (uint8 *)va + pageOffset, toCopy); + if (err != 0) { + if (kernelIf->host) { + kunmap(kernelIf->u.h.page[pageIndex]); diff --git a/app-emulation/vmware-modules/files/304-3.19-05-vmci_qpair.patch b/app-emulation/vmware-modules/files/304-3.19-05-vmci_qpair.patch new file mode 100644 index 0000000000000..4dec3c468206e --- /dev/null +++ b/app-emulation/vmware-modules/files/304-3.19-05-vmci_qpair.patch @@ -0,0 +1,25 @@ +Some parts of the iovec API were replaced by the similar message API. Refactoring the code to use that. +diff -rupN vsock-only.old/linux/af_vsock.c vsock-only/linux/af_vsock.c +--- vsock-only.old/linux/af_vsock.c 2015-05-06 20:41:47.684046762 -0400 ++++ vsock-only/linux/af_vsock.c 2015-05-06 20:52:15.245080779 -0400 +@@ -4629,7 +4629,7 @@ VSockVmciStreamSendmsg(struct kiocb *kio + * able to send. + */ + +- written = vmci_qpair_enquev(vsk->qpair, msg->msg_iov, ++ written = vmci_qpair_enquev(vsk->qpair, &msg->msg_iter.iov, + len - totalWritten, 0); + if (written < 0) { + err = -ENOMEM; +@@ -4874,9 +4874,9 @@ VSockVmciStreamRecvmsg(struct kiocb *kio + } + + if (flags & MSG_PEEK) { +- read = vmci_qpair_peekv(vsk->qpair, msg->msg_iov, len - copied, 0); ++ read = vmci_qpair_peekv(vsk->qpair, &msg->msg_iter.iov, len - copied, 0); + } else { +- read = vmci_qpair_dequev(vsk->qpair, msg->msg_iov, len - copied, 0); ++ read = vmci_qpair_dequev(vsk->qpair, &msg->msg_iter.iov, len - copied, 0); + } + + if (read < 0) { diff --git a/app-emulation/vmware-modules/files/304-3.19-06-vsock.patch b/app-emulation/vmware-modules/files/304-3.19-06-vsock.patch new file mode 100644 index 0000000000000..9a2096e679a4e --- /dev/null +++ b/app-emulation/vmware-modules/files/304-3.19-06-vsock.patch @@ -0,0 +1,16 @@ +Some parts of the iovec API were replaced by the similar message API. Refactoring the code to use that. +diff -rupN vsock-only/linux/af_vsock.c vsock-only.new/linux/af_vsock.c +--- vsock-only/linux/af_vsock.c 2015-05-05 11:31:35.710099711 -0400 ++++ vsock-only.new/linux/af_vsock.c 2015-05-05 11:36:33.260115840 -0400 +@@ -4727,7 +4727,11 @@ VSockVmciDgramRecvmsg(struct kiocb *kioc + } + + /* Place the datagram payload in the user's iovec. */ ++#if LINUX_VERSION_CODE < KERNEL_VERSION(3, 19, 0) + err = skb_copy_datagram_iovec(skb, sizeof *dg, msg->msg_iov, payloadLen); ++#else ++ err = skb_copy_datagram_iter(skb, sizeof *dg, &msg->msg_iter, payloadLen); ++#endif + if (err) { + goto out; + } diff --git a/app-emulation/vmware-modules/files/304-3.19-07-vsock.patch b/app-emulation/vmware-modules/files/304-3.19-07-vsock.patch new file mode 100644 index 0000000000000..6aec2cd3d7b56 --- /dev/null +++ b/app-emulation/vmware-modules/files/304-3.19-07-vsock.patch @@ -0,0 +1,13 @@ +Some parts of the iovec API were replaced by the similar message API. Refactoring the code to use that. +diff -rupN vsock-only/linux/af_vsock.c vsock-only.new/linux/af_vsock.c +--- vsock-only/linux/af_vsock.c 2015-05-05 11:26:05.145081792 -0400 ++++ vsock-only.new/linux/af_vsock.c 2015-05-05 11:30:54.304097466 -0400 +@@ -4266,7 +4266,7 @@ VSockVmciDgramSendmsg(struct kiocb *kioc + goto out; + } + +- memcpy_fromiovec(VMCI_DG_PAYLOAD(dg), msg->msg_iov, len); ++ memcpy_from_msg(VMCI_DG_PAYLOAD(dg), msg, len); + + dg->dst = VMCI_MAKE_HANDLE(remoteAddr->svm_cid, remoteAddr->svm_port); + dg->src = VMCI_MAKE_HANDLE(vsk->localAddr.svm_cid, vsk->localAddr.svm_port); diff --git a/app-emulation/vmware-modules/files/304-apic.patch b/app-emulation/vmware-modules/files/304-apic.patch new file mode 100644 index 0000000000000..66cd459332467 --- /dev/null +++ b/app-emulation/vmware-modules/files/304-apic.patch @@ -0,0 +1,12 @@ +diff --git a/vmmon-only/linux/hostif.c b/vmmon-only/linux/hostif.c +index f1f4b10..c43242f 100644 +--- a/vmmon-only/linux/hostif.c ++++ b/vmmon-only/linux/hostif.c +@@ -55,6 +55,7 @@ + #include + #include + ++#include + + #include "vmware.h" + #include "x86apic.h" diff --git a/app-emulation/vmware-modules/files/304-hardened.patch b/app-emulation/vmware-modules/files/304-hardened.patch new file mode 100644 index 0000000000000..cc3e04152877d --- /dev/null +++ b/app-emulation/vmware-modules/files/304-hardened.patch @@ -0,0 +1,113 @@ +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", diff --git a/app-emulation/vmware-modules/files/304-makefile-include.patch b/app-emulation/vmware-modules/files/304-makefile-include.patch new file mode 100644 index 0000000000000..39c3000308052 --- /dev/null +++ b/app-emulation/vmware-modules/files/304-makefile-include.patch @@ -0,0 +1,65 @@ +diff --git a/vmblock-only/Makefile.kernel b/vmblock-only/Makefile.kernel +index ab7a727..e3ec9d2 100644 +--- a/vmblock-only/Makefile.kernel ++++ b/vmblock-only/Makefile.kernel +@@ -19,7 +19,7 @@ + + INCLUDE += -I$(SRCROOT)/include + +-EXTRA_CFLAGS := $(CC_OPTS) $(INCLUDE) ++EXTRA_CFLAGS := $(CC_OPTS) $(INCLUDE) $(LINUXINCLUDE) + + 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 ++++ b/vmmon-only/Makefile.kernel +@@ -22,7 +22,7 @@ CC_OPTS += -DVMMON -DVMCORE + INCLUDE := -I$(SRCROOT)/include -I$(SRCROOT)/common -I$(SRCROOT)/linux \ + -I$(SRCROOT)/vmcore + +-EXTRA_CFLAGS := $(CC_OPTS) $(INCLUDE) ++EXTRA_CFLAGS := $(CC_OPTS) $(INCLUDE) $(LINUXINCLUDE) + + EXTRA_CFLAGS += $(call vm_check_build, $(SRCROOT)/autoconf/smpcall.c, -DVMW_HAVE_SMP_CALL_3ARG, ) + +diff --git a/vmnet-only/Makefile.kernel b/vmnet-only/Makefile.kernel +index d1e3133..665d428 100644 +--- a/vmnet-only/Makefile.kernel ++++ b/vmnet-only/Makefile.kernel +@@ -19,7 +19,7 @@ + + INCLUDE := -I$(SRCROOT) + +-EXTRA_CFLAGS := $(CC_OPTS) $(INCLUDE) ++EXTRA_CFLAGS := $(CC_OPTS) $(INCLUDE) $(LINUXINCLUDE) + 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, ) + + diff --git a/app-emulation/vmware-modules/files/304-makefile-kernel-dir.patch b/app-emulation/vmware-modules/files/304-makefile-kernel-dir.patch new file mode 100644 index 0000000000000..1a647a3302d80 --- /dev/null +++ b/app-emulation/vmware-modules/files/304-makefile-kernel-dir.patch @@ -0,0 +1,85 @@ +diff --git a/vmblock-only/Makefile b/vmblock-only/Makefile +index 2b81323..746c8b8 100644 +--- a/vmblock-only/Makefile ++++ b/vmblock-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 := 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 ++++ b/vmmon-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 := vmmon + PRODUCT := @@PRODUCT@@ +diff --git a/vmnet-only/Makefile b/vmnet-only/Makefile +index d4eb73c..c7c6d38 100644 +--- a/vmnet-only/Makefile ++++ b/vmnet-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 := 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 diff --git a/app-emulation/vmware-modules/files/304-netdevice.patch b/app-emulation/vmware-modules/files/304-netdevice.patch new file mode 100644 index 0000000000000..35231a3205e3b --- /dev/null +++ b/app-emulation/vmware-modules/files/304-netdevice.patch @@ -0,0 +1,24 @@ +diff --git a/vmnet-only/compat_netdevice.h b/vmnet-only/compat_netdevice.h +index 7a56304..9ff4548 100644 +--- a/vmnet-only/compat_netdevice.h ++++ b/vmnet-only/compat_netdevice.h +@@ -47,6 +47,19 @@ + # define net_device device + #endif + ++/* it looks like these have been removed from the kernel 3.1 ++ * probably because the "transition" is considered complete. ++ * so to keep this source compatible we just redefine them like they were ++ * previously ++ */ ++#if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 1, 0) ++#define HAVE_ALLOC_NETDEV /* feature macro: alloc_xxxdev ++ functions are available. */ ++#define HAVE_FREE_NETDEV /* free_netdev() */ ++#define HAVE_NETDEV_PRIV /* netdev_priv() */ ++#define HAVE_NETIF_QUEUE ++#define HAVE_NET_DEVICE_OPS ++#endif + + /* + * SET_MODULE_OWNER appeared sometime during 2.3.x. It was setting diff --git a/app-emulation/vmware-modules/metadata.xml b/app-emulation/vmware-modules/metadata.xml index e5af2b1722dd5..313c1627f0974 100644 --- a/app-emulation/vmware-modules/metadata.xml +++ b/app-emulation/vmware-modules/metadata.xml @@ -2,6 +2,9 @@ vmware + + VMware kernel modules. + Apply patch needed for pax enabled kernels Build the Virtual Machine Communication Interface module; disable this if you want to use the module from the mainline kernel diff --git a/app-emulation/vmware-modules/vmware-modules-271.3-r1.ebuild b/app-emulation/vmware-modules/vmware-modules-271.3-r1.ebuild new file mode 100644 index 0000000000000..1d24b19d4dba3 --- /dev/null +++ b/app-emulation/vmware-modules/vmware-modules-271.3-r1.ebuild @@ -0,0 +1,108 @@ +# Copyright 1999-2015 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Id$ + +EAPI="4" + +inherit eutils flag-o-matic linux-info linux-mod user versionator udev + +PV_MAJOR=$(get_major_version) +PV_MINOR=$(get_version_component_range 2) + +DESCRIPTION="VMware kernel modules" +HOMEPAGE="http://www.vmware.com/" + +SRC_URI="" + +LICENSE="GPL-2" +SLOT="0" +KEYWORDS="~amd64 ~x86" +IUSE="pax_kernel" + +RDEPEND="" +DEPEND="${RDEPEND} + || ( =app-emulation/vmware-player-5.0.${PV_MINOR}* + =app-emulation/vmware-workstation-9.0.${PV_MINOR}* )" + +S=${WORKDIR} + +pkg_setup() { + CONFIG_CHECK="~HIGH_RES_TIMERS" + if kernel_is ge 2 6 37 && kernel_is lt 2 6 39; then + CONFIG_CHECK="${CONFIG_CHECK} BKL" + fi + + linux-info_pkg_setup + + linux-mod_pkg_setup + + VMWARE_GROUP=${VMWARE_GROUP:-vmware} + + VMWARE_MODULE_LIST="vmblock vmci vmmon vmnet vsock" + VMWARE_MOD_DIR="${PN}-${PVR}" + + BUILD_TARGETS="auto-build KERNEL_DIR=${KERNEL_DIR} KBUILD_OUTPUT=${KV_OUT_DIR}" + + enewgroup "${VMWARE_GROUP}" + filter-flags -mfpmath=sse + + for mod in ${VMWARE_MODULE_LIST}; do + MODULE_NAMES="${MODULE_NAMES} ${mod}(misc:${S}/${mod}-only)" + done +} + +src_unpack() { + cd "${S}" + for mod in ${VMWARE_MODULE_LIST}; do + tar -xf /opt/vmware/lib/vmware/modules/source/${mod}.tar + done +} + +src_prepare() { + epatch "${FILESDIR}/${PV_MAJOR}-makefile-kernel-dir.patch" + epatch "${FILESDIR}/${PV_MAJOR}-makefile-include.patch" + epatch "${FILESDIR}/${PV_MAJOR}-netdevice.patch" + use pax_kernel && epatch "${FILESDIR}/${PV_MAJOR}-hardened.patch" + epatch "${FILESDIR}/${PV_MAJOR}-apic.patch" + kernel_is ge 3 7 0 && epatch "${FILESDIR}/${PV_MAJOR}-putname.patch" + + kernel_is ge 3 10 0 && epatch "${FILESDIR}/${PV_MAJOR}-3.10-00-userns.patch" + kernel_is ge 3 10 0 && epatch "${FILESDIR}/${PV_MAJOR}-3.10-01-create_proc_entry.patch" + kernel_is ge 3 10 0 && epatch "${FILESDIR}/${PV_MAJOR}-3.10-02-getname.patch" + kernel_is ge 3 10 0 && epatch "${FILESDIR}/${PV_MAJOR}-3.10-03-deprecated.patch" + kernel_is ge 3 10 0 && epatch "${FILESDIR}/${PV_MAJOR}-3.10-04-unused-typedef.patch" + kernel_is ge 3 10 0 && epatch "${FILESDIR}/${PV_MAJOR}-3.10-05-dentry.patch" + kernel_is ge 3 10 0 && epatch "${FILESDIR}/${PV_MAJOR}-3.10-06-inode.patch" + + # fixes a memcpy/memcmp bug in the hub code + kernel_is ge 3 10 0 && epatch "${FILESDIR}/${PV_MAJOR}-3.10-07-hub.patch" + + kernel_is ge 3 11 0 && epatch "${FILESDIR}/${PV_MAJOR}-3.11-00-readdir.patch" + kernel_is ge 3 11 0 && epatch "${FILESDIR}/${PV_MAJOR}-3.11-01-filldir.patch" + kernel_is ge 3 13 0 && epatch "${FILESDIR}/${PV_MAJOR}-3.13-00-vmnet.patch" + kernel_is ge 3 15 0 && epatch "${FILESDIR}/${PV_MAJOR}-3.15-00-readlink.patch" + kernel_is ge 3 15 0 && epatch "${FILESDIR}/${PV_MAJOR}-3.15-01-vsock.patch" + kernel_is ge 3 17 0 && epatch "${FILESDIR}/${PV_MAJOR}-3.17-00-netdev.patch" + + kernel_is ge 3 19 0 && epatch "${FILESDIR}/${PV_MAJOR}-3.19-00-vmnet-warning.patch" + kernel_is ge 3 19 0 && epatch "${FILESDIR}/${PV_MAJOR}-3.19-01-vmblock-path.patch" + kernel_is ge 3 19 0 && epatch "${FILESDIR}/${PV_MAJOR}-3.19-02-vmci.patch" + kernel_is ge 3 19 0 && epatch "${FILESDIR}/${PV_MAJOR}-3.19-03-vmnet.patch" + kernel_is ge 3 19 0 && epatch "${FILESDIR}/${PV_MAJOR}-3.19-04-vsock.patch" + kernel_is ge 3 19 0 && epatch "${FILESDIR}/${PV_MAJOR}-3.19-05-vsock.patch" + kernel_is ge 3 19 0 && epatch "${FILESDIR}/${PV_MAJOR}-3.19-06-vmci_qpair.patch" + + # Allow user patches so they can support RC kernels and whatever else + epatch_user +} + +src_install() { + linux-mod_src_install + local udevrules="${T}/60-vmware.rules" + cat > "${udevrules}" <<-EOF + KERNEL=="vmci", GROUP="vmware", MODE="660" + KERNEL=="vmmon", GROUP="vmware", MODE="660" + KERNEL=="vsock", GROUP="vmware", MODE="660" + EOF + udev_dorules "${udevrules}" +} diff --git a/app-emulation/vmware-modules/vmware-modules-279.6.ebuild b/app-emulation/vmware-modules/vmware-modules-279.6.ebuild new file mode 100644 index 0000000000000..356ead7dc064a --- /dev/null +++ b/app-emulation/vmware-modules/vmware-modules-279.6.ebuild @@ -0,0 +1,116 @@ +# Copyright 1999-2015 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Id$ + +EAPI=5 + +inherit eutils flag-o-matic linux-info linux-mod user versionator udev + +PV_MAJOR=$(get_major_version) +PV_MINOR=$(get_version_component_range 2) + +DESCRIPTION="VMware kernel modules" +HOMEPAGE="http://www.vmware.com/" + +SRC_URI="" + +LICENSE="GPL-2" +SLOT="0" +KEYWORDS="~amd64 ~x86" +IUSE="pax_kernel +vmci +vsock" + +RDEPEND="" +DEPEND="${RDEPEND} + || ( =app-emulation/vmware-player-6.0.${PV_MINOR}* + =app-emulation/vmware-workstation-10.0.${PV_MINOR}* )" + +S=${WORKDIR} + +pkg_setup() { + CONFIG_CHECK="~HIGH_RES_TIMERS" + if kernel_is ge 2 6 37 && kernel_is lt 2 6 39; then + CONFIG_CHECK="${CONFIG_CHECK} BKL" + fi + if use vmci ; then + CONFIG_CHECK="${CONFIG_CHECK} !VMWARE_VMCI" + else + CONFIG_CHECK="${CONFIG_CHECK} VMWARE_VMCI" + fi + if use vsock ; then + CONFIG_CHECK="${CONFIG_CHECK} !VMWARE_VMCI_VSOCKETS" + else + CONFIG_CHECK="${CONFIG_CHECK} VMWARE_VMCI_VSOCKETS" + fi + + linux-info_pkg_setup + + linux-mod_pkg_setup + + VMWARE_GROUP=${VMWARE_GROUP:-vmware} + + VMWARE_MODULE_LIST_ALL="vmblock vmmon vmnet vmci vsock" + VMWARE_MODULE_LIST="vmblock vmmon vmnet" + use vmci && VMWARE_MODULE_LIST="${VMWARE_MODULE_LIST} vmci" + use vsock && VMWARE_MODULE_LIST="${VMWARE_MODULE_LIST} vsock" + + VMWARE_MOD_DIR="${PN}-${PVR}" + + BUILD_TARGETS="auto-build KERNEL_DIR=${KERNEL_DIR} KBUILD_OUTPUT=${KV_OUT_DIR}" + + enewgroup "${VMWARE_GROUP}" + filter-flags -mfpmath=sse + + for mod in ${VMWARE_MODULE_LIST}; do + MODULE_NAMES="${MODULE_NAMES} ${mod}(misc:${S}/${mod}-only)" + done +} + +src_unpack() { + cd "${S}" + for mod in ${VMWARE_MODULE_LIST_ALL}; do + tar -xf /opt/vmware/lib/vmware/modules/source/${mod}.tar + done +} + +src_prepare() { + epatch "${FILESDIR}/${PV_MAJOR}-makefile-kernel-dir.patch" + epatch "${FILESDIR}/${PV_MAJOR}-makefile-include.patch" + epatch "${FILESDIR}/${PV_MAJOR}-netdevice.patch" + use pax_kernel && epatch "${FILESDIR}/279-hardened.patch" + epatch "${FILESDIR}/${PV_MAJOR}-apic.patch" + kernel_is ge 3 7 0 && epatch "${FILESDIR}/${PV_MAJOR}-putname.patch" + kernel_is ge 3 10 0 && epatch "${FILESDIR}/${PV_MAJOR}-vmblock.patch" + kernel_is ge 3 10 0 && epatch "${FILESDIR}/${PV_MAJOR}-5.10-00-userns.patch" + kernel_is ge 3 10 0 && epatch "${FILESDIR}/${PV_MAJOR}-3.10-01-getname.patch" + #kernel_is ge 3 10 0 && epatch "${FILESDIR}/${PV_MAJOR}-3.10-03-deprecated.patch" + kernel_is ge 3 10 0 && epatch "${FILESDIR}/${PV_MAJOR}-3.10-04-dentry.patch" + kernel_is ge 3 10 0 && epatch "${FILESDIR}/${PV_MAJOR}-3.10-05-inode.patch" + kernel_is ge 3 11 0 && epatch "${FILESDIR}/${PV_MAJOR}-filldir.patch" + kernel_is ge 3 15 0 && epatch "${FILESDIR}/${PV_MAJOR}-3.15-00-readlink.patch" + kernel_is ge 3 15 0 && epatch "${FILESDIR}/${PV_MAJOR}-3.15-01-vsock.patch" + kernel_is ge 3 17 0 && epatch "${FILESDIR}/${PV_MAJOR}-3.17-00-netdev.patch" + kernel_is ge 3 18 0 && epatch "${FILESDIR}/${PV_MAJOR}-3.18-00-version-redefined.patch" + kernel_is ge 3 19 0 && epatch "${FILESDIR}/${PV_MAJOR}-3.19-00-compat-namei.patch" + kernel_is ge 3 19 0 && epatch "${FILESDIR}/${PV_MAJOR}-3.19-01-dentry.patch" + kernel_is ge 3 19 0 && epatch "${FILESDIR}/${PV_MAJOR}-3.19-02-vmblock-path.patch" + kernel_is ge 3 19 0 && epatch "${FILESDIR}/${PV_MAJOR}-3.19-03-iovec.patch" + kernel_is ge 3 19 0 && epatch "${FILESDIR}/${PV_MAJOR}-3.19-04-iovec.patch" + kernel_is ge 3 19 0 && epatch "${FILESDIR}/${PV_MAJOR}-3.19-05-vmci_qpair.patch" + kernel_is ge 3 19 0 && epatch "${FILESDIR}/${PV_MAJOR}-3.19-06-vsock.patch" + kernel_is ge 3 19 0 && epatch "${FILESDIR}/${PV_MAJOR}-3.19-07-vsock.patch" + + # Allow user patches so they can support RC kernels and whatever else + epatch_user +} + +src_install() { + linux-mod_src_install + local udevrules="${T}/60-vmware.rules" + cat > "${udevrules}" <<-EOF + KERNEL=="vmci", GROUP="vmware", MODE="660" + KERNEL=="vmw_vmci", GROUP="vmware", MODE="660" + KERNEL=="vmmon", GROUP="vmware", MODE="660" + KERNEL=="vsock", GROUP="vmware", MODE="660" + EOF + udev_dorules "${udevrules}" +} diff --git a/app-emulation/vmware-modules/vmware-modules-304.0.ebuild b/app-emulation/vmware-modules/vmware-modules-304.0.ebuild new file mode 100644 index 0000000000000..21095ff6fee72 --- /dev/null +++ b/app-emulation/vmware-modules/vmware-modules-304.0.ebuild @@ -0,0 +1,113 @@ +# Copyright 1999-2015 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Id$ + +EAPI=5 + +inherit eutils flag-o-matic linux-info linux-mod user versionator udev + +PV_MAJOR=$(get_major_version) +PV_MINOR=$(get_version_component_range 2) + +DESCRIPTION="VMware kernel modules" +HOMEPAGE="http://www.vmware.com/" + +SRC_URI="" + +LICENSE="GPL-2" +SLOT="0" +KEYWORDS="~amd64" +IUSE="pax_kernel +vmci +vsock" + +RDEPEND="" +DEPEND="${RDEPEND} + || ( =app-emulation/vmware-player-7.1.${PV_MINOR}* + =app-emulation/vmware-workstation-11.1.${PV_MINOR}* )" + +S=${WORKDIR} + +pkg_setup() { + CONFIG_CHECK="~HIGH_RES_TIMERS" + if kernel_is ge 2 6 37 && kernel_is lt 2 6 39; then + CONFIG_CHECK="${CONFIG_CHECK} BKL" + fi + if use vmci ; then + CONFIG_CHECK="${CONFIG_CHECK} !VMWARE_VMCI" + else + CONFIG_CHECK="${CONFIG_CHECK} VMWARE_VMCI" + fi + if use vsock ; then + CONFIG_CHECK="${CONFIG_CHECK} !VMWARE_VMCI_VSOCKETS" + else + CONFIG_CHECK="${CONFIG_CHECK} VMWARE_VMCI_VSOCKETS" + fi + + linux-info_pkg_setup + + linux-mod_pkg_setup + + VMWARE_GROUP=${VMWARE_GROUP:-vmware} + + VMWARE_MODULE_LIST_ALL="vmblock vmmon vmnet vmci vsock" + VMWARE_MODULE_LIST="vmblock vmmon vmnet" + use vmci && VMWARE_MODULE_LIST="${VMWARE_MODULE_LIST} vmci" + use vsock && VMWARE_MODULE_LIST="${VMWARE_MODULE_LIST} vsock" + + VMWARE_MOD_DIR="${PN}-${PVR}" + + BUILD_TARGETS="auto-build KERNEL_DIR=${KERNEL_DIR} KBUILD_OUTPUT=${KV_OUT_DIR}" + + enewgroup "${VMWARE_GROUP}" + filter-flags -mfpmath=sse + + for mod in ${VMWARE_MODULE_LIST}; do + MODULE_NAMES="${MODULE_NAMES} ${mod}(misc:${S}/${mod}-only)" + done +} + +src_unpack() { + cd "${S}" + for mod in ${VMWARE_MODULE_LIST_ALL}; do + tar -xf /opt/vmware/lib/vmware/modules/source/${mod}.tar + done +} + +src_prepare() { + epatch "${FILESDIR}/${PV_MAJOR}-makefile-kernel-dir.patch" + epatch "${FILESDIR}/${PV_MAJOR}-makefile-include.patch" + epatch "${FILESDIR}/${PV_MAJOR}-netdevice.patch" + use pax_kernel && epatch "${FILESDIR}/${PV_MAJOR}-hardened.patch" + epatch "${FILESDIR}/${PV_MAJOR}-apic.patch" + + kernel_is ge 3 10 0 && epatch "${FILESDIR}/${PV_MAJOR}-3.10-00-dentry.patch" + kernel_is ge 3 10 0 && epatch "${FILESDIR}/${PV_MAJOR}-3.10-01-inode.patch" + kernel_is ge 3 10 0 && epatch "${FILESDIR}/${PV_MAJOR}-3.10-02-control.patch" + kernel_is ge 3 11 0 && epatch "${FILESDIR}/${PV_MAJOR}-3.10-03-inline.patch" + kernel_is ge 3 11 0 && epatch "${FILESDIR}/${PV_MAJOR}-3.11-00-readdir.patch" + kernel_is ge 3 11 0 && epatch "${FILESDIR}/${PV_MAJOR}-3.11-01-filldir.patch" + kernel_is ge 3 15 0 && epatch "${FILESDIR}/${PV_MAJOR}-3.15-00-vsock.patch" + kernel_is ge 3 18 0 && epatch "${FILESDIR}/${PV_MAJOR}-3.18-00-version-redefined.patch" + kernel_is ge 3 19 0 && epatch "${FILESDIR}/${PV_MAJOR}-3.19-00-compat-namei.patch" + kernel_is ge 3 19 0 && epatch "${FILESDIR}/${PV_MAJOR}-3.19-01-dentry.patch" + kernel_is ge 3 19 0 && epatch "${FILESDIR}/${PV_MAJOR}-3.19-02-vmblock-path.patch" + kernel_is ge 3 19 0 && epatch "${FILESDIR}/${PV_MAJOR}-3.19-03-iovec.patch" + kernel_is ge 3 19 0 && epatch "${FILESDIR}/${PV_MAJOR}-3.19-04-iovec.patch" + kernel_is ge 3 19 0 && epatch "${FILESDIR}/${PV_MAJOR}-3.19-05-vmci_qpair.patch" + kernel_is ge 3 19 0 && epatch "${FILESDIR}/${PV_MAJOR}-3.19-06-vsock.patch" + kernel_is ge 3 19 0 && epatch "${FILESDIR}/${PV_MAJOR}-3.19-07-vsock.patch" + + # Allow user patches so they can support RC kernels and whatever else + epatch_user +} + +src_install() { + linux-mod_src_install + local udevrules="${T}/60-vmware.rules" + cat > "${udevrules}" <<-EOF + KERNEL=="vmci", GROUP="vmware", MODE="660" + KERNEL=="vmw_vmci", GROUP="vmware", MODE="660" + KERNEL=="vmmon", GROUP="vmware", MODE="660" + KERNEL=="vsock", GROUP="vmware", MODE="660" + EOF + udev_dorules "${udevrules}" +} diff --git a/app-emulation/vmware-modules/vmware-modules-304.2.ebuild b/app-emulation/vmware-modules/vmware-modules-304.2.ebuild new file mode 100644 index 0000000000000..5406bf872176f --- /dev/null +++ b/app-emulation/vmware-modules/vmware-modules-304.2.ebuild @@ -0,0 +1,113 @@ +# Copyright 1999-2015 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Id$ + +EAPI=5 + +inherit eutils flag-o-matic linux-info linux-mod user versionator udev + +PV_MAJOR=$(get_major_version) +PV_MINOR=$(get_version_component_range 2) + +DESCRIPTION="VMware kernel modules" +HOMEPAGE="http://www.vmware.com/" + +SRC_URI="" + +LICENSE="GPL-2" +SLOT="0" +KEYWORDS="~amd64" +IUSE="pax_kernel +vmci +vsock" + +RDEPEND="" +DEPEND="${RDEPEND} + || ( =app-emulation/vmware-player-7.1.${PV_MINOR}* + =app-emulation/vmware-workstation-11.1.${PV_MINOR}* )" + +S=${WORKDIR} + +pkg_setup() { + CONFIG_CHECK="~HIGH_RES_TIMERS" + if kernel_is ge 2 6 37 && kernel_is lt 2 6 39; then + CONFIG_CHECK="${CONFIG_CHECK} BKL" + fi + if use vmci ; then + CONFIG_CHECK="${CONFIG_CHECK} !VMWARE_VMCI" + else + CONFIG_CHECK="${CONFIG_CHECK} VMWARE_VMCI" + fi + if use vsock ; then + CONFIG_CHECK="${CONFIG_CHECK} !VMWARE_VMCI_VSOCKETS" + else + CONFIG_CHECK="${CONFIG_CHECK} VMWARE_VMCI_VSOCKETS" + fi + + linux-info_pkg_setup + + linux-mod_pkg_setup + + VMWARE_GROUP=${VMWARE_GROUP:-vmware} + + VMWARE_MODULE_LIST_ALL="vmblock vmmon vmnet vmci vsock" + VMWARE_MODULE_LIST="vmblock vmmon vmnet" + use vmci && VMWARE_MODULE_LIST="${VMWARE_MODULE_LIST} vmci" + use vsock && VMWARE_MODULE_LIST="${VMWARE_MODULE_LIST} vsock" + + VMWARE_MOD_DIR="${PN}-${PVR}" + + BUILD_TARGETS="auto-build KERNEL_DIR=${KERNEL_DIR} KBUILD_OUTPUT=${KV_OUT_DIR}" + + enewgroup "${VMWARE_GROUP}" + filter-flags -mfpmath=sse + + for mod in ${VMWARE_MODULE_LIST}; do + MODULE_NAMES="${MODULE_NAMES} ${mod}(misc:${S}/${mod}-only)" + done +} + +src_unpack() { + cd "${S}" + for mod in ${VMWARE_MODULE_LIST_ALL}; do + tar -xf /opt/vmware/lib/vmware/modules/source/${mod}.tar + done +} + +src_prepare() { + epatch "${FILESDIR}/${PV_MAJOR}-makefile-kernel-dir.patch" + epatch "${FILESDIR}/${PV_MAJOR}-makefile-include.patch" + epatch "${FILESDIR}/${PV_MAJOR}-netdevice.patch" + use pax_kernel && epatch "${FILESDIR}/${PV_MAJOR}-hardened.patch" + epatch "${FILESDIR}/${PV_MAJOR}-apic.patch" + + kernel_is ge 3 10 0 && epatch "${FILESDIR}/${PV_MAJOR}-3.10-00-dentry.patch" + kernel_is ge 3 10 0 && epatch "${FILESDIR}/${PV_MAJOR}-3.10-01-inode.patch" + kernel_is ge 3 10 0 && epatch "${FILESDIR}/${PV_MAJOR}-3.10-02-control.patch" + kernel_is ge 3 11 0 && epatch "${FILESDIR}/${PV_MAJOR}-3.10-03-inline.patch" + kernel_is ge 3 11 0 && epatch "${FILESDIR}/${PV_MAJOR}-3.11-00-readdir.patch" + kernel_is ge 3 11 0 && epatch "${FILESDIR}/${PV_MAJOR}-3.11-01-filldir.patch" + kernel_is ge 3 15 0 && epatch "${FILESDIR}/${PV_MAJOR}-3.15-00-vsock.patch" + kernel_is ge 3 18 0 && epatch "${FILESDIR}/${PV_MAJOR}-3.18-00-version-redefined.patch" + kernel_is ge 3 19 0 && epatch "${FILESDIR}/${PV_MAJOR}-3.19-00-compat-namei.patch" + #kernel_is ge 3 19 0 && epatch "${FILESDIR}/${PV_MAJOR}-3.19-01-dentry.patch" + kernel_is ge 3 19 0 && epatch "${FILESDIR}/${PV_MAJOR}-3.19-02-vmblock-path.patch" + #kernel_is ge 3 19 0 && epatch "${FILESDIR}/${PV_MAJOR}-3.19-03-iovec.patch" + kernel_is ge 3 19 0 && epatch "${FILESDIR}/${PV_MAJOR}-3.19-04-iovec.patch" + kernel_is ge 3 19 0 && epatch "${FILESDIR}/${PV_MAJOR}-3.19-05-vmci_qpair.patch" + kernel_is ge 3 19 0 && epatch "${FILESDIR}/${PV_MAJOR}-3.19-06-vsock.patch" + kernel_is ge 3 19 0 && epatch "${FILESDIR}/${PV_MAJOR}-3.19-07-vsock.patch" + + # Allow user patches so they can support RC kernels and whatever else + epatch_user +} + +src_install() { + linux-mod_src_install + local udevrules="${T}/60-vmware.rules" + cat > "${udevrules}" <<-EOF + KERNEL=="vmci", GROUP="vmware", MODE="660" + KERNEL=="vmw_vmci", GROUP="vmware", MODE="660" + KERNEL=="vmmon", GROUP="vmware", MODE="660" + KERNEL=="vsock", GROUP="vmware", MODE="660" + EOF + udev_dorules "${udevrules}" +} diff --git a/dev-ruby/arel-helpers/Manifest b/dev-ruby/arel-helpers/Manifest new file mode 100644 index 0000000000000..fc265309fad68 --- /dev/null +++ b/dev-ruby/arel-helpers/Manifest @@ -0,0 +1 @@ +DIST arel-helpers-2.0.1.gem 9728 SHA256 de627d6d78af542d99bdfd178e7decd8f351e4de66758ac220f92418291b8b82 SHA512 241af61b00822ac091a04673ae0f6421c88ce8b96141cc9f468c62465b2720ca38d1a041faa720db40dd3a4cee407c1126152ac6125b3ed9a759daedd06b6955 WHIRLPOOL 3024a34b8a9720acbfb66e811b97ff1954c3cda83a97bc2544b5dbab0d94f5eb09eec8891c88bd0582dfdffdfe5abbf1e3be47cc9b61b888e52cb8a85121ab3c diff --git a/dev-ruby/arel-helpers/arel-helpers-2.0.1.ebuild b/dev-ruby/arel-helpers/arel-helpers-2.0.1.ebuild new file mode 100644 index 0000000000000..3ff6ea432e818 --- /dev/null +++ b/dev-ruby/arel-helpers/arel-helpers-2.0.1.ebuild @@ -0,0 +1,22 @@ +# Copyright 1999-2015 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Header: /var/cvsroot/gentoo-x86/dev-ruby/metasploit_data_models/metasploit_data_models-0.17.0.ebuild,v 1.3 2014/07/09 21:13:54 zerochaos Exp $ + +EAPI=5 +USE_RUBY="ruby19 ruby20 ruby21" + +inherit ruby-fakegem + +DESCRIPTION="Tools to help construct database queries" +HOMEPAGE="https://github.com/camertron/arel-helpers" +SRC_URI="mirror://rubygems/${P}.gem" + +LICENSE="BSD" +SLOT="0" +KEYWORDS="~amd64 ~x86" +IUSE="" + +ruby_add_rdepend "|| ( dev-ruby/activerecord:3.2 + dev-ruby/activerecord:4.0 + dev-ruby/activerecord:4.1 + dev-ruby/activerecord:4.2 )" diff --git a/dev-ruby/arel-helpers/metadata.xml b/dev-ruby/arel-helpers/metadata.xml new file mode 100644 index 0000000000000..0754654cf4e52 --- /dev/null +++ b/dev-ruby/arel-helpers/metadata.xml @@ -0,0 +1,13 @@ + + + + + zerochaos@gentoo.org + Rick Farina + + + + + camertron/arel-helpers + + diff --git a/dev-ruby/jsobfu/jsobfu-0.2.1.ebuild b/dev-ruby/jsobfu/jsobfu-0.2.1.ebuild index e073df168e13f..b20332bf59796 100644 --- a/dev-ruby/jsobfu/jsobfu-0.2.1.ebuild +++ b/dev-ruby/jsobfu/jsobfu-0.2.1.ebuild @@ -16,7 +16,7 @@ HOMEPAGE="https://github.com/rapid7/jsobfu" LICENSE="BSD" SLOT="0" -KEYWORDS="~amd64 ~x86" +KEYWORDS="~amd64 ~arm ~x86" IUSE="" ruby_add_rdepend ">=dev-ruby/rkelly-remix-0.0.6:0" diff --git a/dev-ruby/jsobfu/jsobfu-0.3.0.ebuild b/dev-ruby/jsobfu/jsobfu-0.3.0.ebuild index 4f1b408d6a0c5..daffd6f79b73c 100644 --- a/dev-ruby/jsobfu/jsobfu-0.3.0.ebuild +++ b/dev-ruby/jsobfu/jsobfu-0.3.0.ebuild @@ -16,7 +16,7 @@ HOMEPAGE="https://github.com/rapid7/jsobfu" LICENSE="BSD" SLOT="0" -KEYWORDS="~amd64 ~x86" +KEYWORDS="~amd64 ~arm ~x86" IUSE="" ruby_add_rdepend ">=dev-ruby/rkelly-remix-0.0.6:0" diff --git a/dev-ruby/metasploit-concern/Manifest b/dev-ruby/metasploit-concern/Manifest new file mode 100644 index 0000000000000..5108dd2dc4767 --- /dev/null +++ b/dev-ruby/metasploit-concern/Manifest @@ -0,0 +1 @@ +DIST metasploit-concern-1.0.0.gem 13312 SHA256 0479a6766d4754720d8eb6ac6b9c108c68095b7e3068d4cca62dd5838173ecfe SHA512 2fc2e511503b4efcc10fec9e0027936333a16de14acd53155942bde1d77e5e208510ec2b563e9ffb81d49d320b6f62bf0fd04f40bc2d2703778943d4730d5bc9 WHIRLPOOL 748be7d2f09af22d9767a0b41321182637058ceefbff8dd1a41ba336a5c31c9c59589b80a012402e7fd33e6892f6ca233d7b0d3cc4d863a955a3fc617f3eaeb2 diff --git a/dev-ruby/metasploit-concern/metadata.xml b/dev-ruby/metasploit-concern/metadata.xml new file mode 100644 index 0000000000000..49861c0ca246c --- /dev/null +++ b/dev-ruby/metasploit-concern/metadata.xml @@ -0,0 +1,13 @@ + + + + + zerochaos@gentoo.org + Rick Farina + + + + + rapid7/metasploit-concern + + diff --git a/dev-ruby/metasploit-concern/metasploit-concern-1.0.0.ebuild b/dev-ruby/metasploit-concern/metasploit-concern-1.0.0.ebuild new file mode 100644 index 0000000000000..fdb8a6bae9b37 --- /dev/null +++ b/dev-ruby/metasploit-concern/metasploit-concern-1.0.0.ebuild @@ -0,0 +1,26 @@ +# Copyright 1999-2015 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Header: /var/cvsroot/gentoo-x86/dev-ruby/metasploit_data_models/metasploit_data_models-0.17.0.ebuild,v 1.3 2014/07/09 21:13:54 zerochaos Exp $ + +EAPI=5 +USE_RUBY="ruby19 ruby20 ruby21" + +RUBY_FAKEGEM_EXTRAINSTALL="app spec" + +inherit ruby-fakegem versionator + +DESCRIPTION="Metasploit concern allows you to define concerns in app/concerns. " +HOMEPAGE="https://github.com/rapid7/metasploit-concern" +SRC_URI="mirror://rubygems/${P}.gem" + +LICENSE="BSD" +SLOT="$(get_version_component_range 1-2)" +KEYWORDS="~amd64 ~x86" +#IUSE="development test" +RESTRICT=test +IUSE="" + +RDEPEND="${RDEPEND} !dev-ruby/metasploit-concern:0" + +ruby_add_rdepend ">=dev-ruby/railties-4.0.9:4.0 + >=dev-ruby/activesupport-4.0.9:4.0" diff --git a/dev-ruby/metasploit-credential/Manifest b/dev-ruby/metasploit-credential/Manifest new file mode 100644 index 0000000000000..948e652c654dc --- /dev/null +++ b/dev-ruby/metasploit-credential/Manifest @@ -0,0 +1 @@ +DIST metasploit-credential-1.0.0.gem 101888 SHA256 086cb65295f1294c213138bd2a9f2f727d945b90837a7e877b22bc6a47fe33f6 SHA512 4af09458a83d9425c5bfd744bc3f366c08d9175b4c303fa9ff53dd3f2163ba654748ea883d22f069e3b3be1218b57afe909f7ba31feb54c0b7ff781af8d5e631 WHIRLPOOL 506c707f3e1be0e90fad02397a34c70e44d1f423b5909d9f61152e2a4e929eadccf0736ec607c569fe75fff24c6003243d0a9a288979450b8c52d5f1feba1f6d diff --git a/dev-ruby/metasploit-credential/metadata.xml b/dev-ruby/metasploit-credential/metadata.xml new file mode 100644 index 0000000000000..7b6d0792a58d8 --- /dev/null +++ b/dev-ruby/metasploit-credential/metadata.xml @@ -0,0 +1,13 @@ + + + + + zerochaos@gentoo.org + Rick Farina + + + + + rapid7/metasploit-credential + + diff --git a/dev-ruby/metasploit-credential/metasploit-credential-1.0.0.ebuild b/dev-ruby/metasploit-credential/metasploit-credential-1.0.0.ebuild new file mode 100644 index 0000000000000..7836550e5b210 --- /dev/null +++ b/dev-ruby/metasploit-credential/metasploit-credential-1.0.0.ebuild @@ -0,0 +1,28 @@ +# Copyright 1999-2015 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Header: Exp $ + +EAPI=5 +USE_RUBY="ruby19 ruby20 ruby21" + +inherit ruby-fakegem versionator + +RUBY_FAKEGEM_EXTRAINSTALL="app config db spec" + +DESCRIPTION="Code for modeling and managing credentials in Metasploit" +HOMEPAGE="https://github.com/rapid7/metasploit-credential" +SRC_URI="mirror://rubygems/${P}.gem" + +LICENSE="BSD" +SLOT="$(get_version_component_range 1-2)" +KEYWORDS="~amd64 ~x86" +IUSE="" + +ruby_add_rdepend ">=dev-ruby/metasploit-concern-1.0.0:1.0 + >=dev-ruby/metasploit_data_models-1.2.0 + >=dev-ruby/metasploit-model-1.0.0 + dev-ruby/rubyzip:1 + dev-ruby/rubyntlm + >=dev-ruby/railties-4.0.9:4.0 + dev-ruby/net-ssh + dev-ruby/pg" diff --git a/dev-ruby/metasploit-model/Manifest b/dev-ruby/metasploit-model/Manifest new file mode 100644 index 0000000000000..9c02535ff5079 --- /dev/null +++ b/dev-ruby/metasploit-model/Manifest @@ -0,0 +1 @@ +DIST metasploit-model-1.0.0.gem 77312 SHA256 72e523dd4c13c6146a885599eae150b6addcc1b5e19165fd3382c5a783551cfe SHA512 1020b395787c6ad0f5b409c997f672e35e442e2499081dfab812a87c2aa8ff60d2b59ec1420e88b552e28c9ec12b420806475168da757e41e265d0b8df62dc39 WHIRLPOOL 5f211e16e3c383be0db5a66e97c95d7ff67831e1cfe980b325ff01d353094c69c47f245437ad354e4bd2b6293de288e751d39ead8e37f32242dde71a7b2c487e diff --git a/dev-ruby/metasploit-model/metadata.xml b/dev-ruby/metasploit-model/metadata.xml new file mode 100644 index 0000000000000..a7eb21203cebf --- /dev/null +++ b/dev-ruby/metasploit-model/metadata.xml @@ -0,0 +1,14 @@ + + + + + zerochaos@gentoo.org + Rick Farina + + +Common code, such as validators and mixins, that are shared between ActiveModels in metasploit-framework and ActiveRecords in metasploit_data_models + + + rapid7/metasploit-model + + diff --git a/dev-ruby/metasploit-model/metasploit-model-1.0.0.ebuild b/dev-ruby/metasploit-model/metasploit-model-1.0.0.ebuild new file mode 100644 index 0000000000000..ef23f49ed1a12 --- /dev/null +++ b/dev-ruby/metasploit-model/metasploit-model-1.0.0.ebuild @@ -0,0 +1,73 @@ +# Copyright 1999-2015 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Header: /var/cvsroot/gentoo-x86/dev-ruby/metasploit_data_models/metasploit_data_models-0.17.0.ebuild,v 1.3 2014/07/09 21:13:54 zerochaos Exp $ + +EAPI=5 +USE_RUBY="ruby19 ruby20 ruby21" + +inherit ruby-fakegem + +RUBY_FAKEGEM_EXTRAINSTALL="app config script spec" + +DESCRIPTION="Common code, such as validators and mixins" +HOMEPAGE="https://github.com/rapid7/metasploit-model" +SRC_URI="mirror://rubygems/${P}.gem" + +LICENSE="BSD" +SLOT="$(get_version_component_range 1-2)" +KEYWORDS="~amd64 ~x86" +#IUSE="development test" +RESTRICT=test +IUSE="" + +RDEPEND="${RDEPEND} !dev-ruby/metasploit-model:0" + +ruby_add_rdepend ">=dev-ruby/railties-4.0.9:4.0 + >=dev-ruby/activesupport-4.0.9:4.0 + >=dev-ruby/activemodel-4.0.9:4.0" +# development? ( dev-ruby/bundler +# dev-ruby/rake +# dev-ruby/i18n +# dev-ruby/multi_json +# dev-ruby/builder +# dev-ruby/erubis +# dev-ruby/journey +# dev-ruby/rack +# dev-ruby/rack-cache +# dev-ruby/rack-test +# dev-ruby/hike +# dev-ruby/tilt +# dev-ruby/sprockets:* +# dev-ruby/actionpack:4.0 +# dev-ruby/json +# dev-ruby/rack-ssl:* +# dev-ruby/rdoc +# dev-ruby/thor +# dev-ruby/redcarpet +# + + + + zerochaos@gentoo.org + Rick Farina + + + + + rapid7/metasploit-payloads + + diff --git a/dev-ruby/metasploit-payloads/metasploit-payloads-1.0.9.ebuild b/dev-ruby/metasploit-payloads/metasploit-payloads-1.0.9.ebuild new file mode 100644 index 0000000000000..5780ee6249f95 --- /dev/null +++ b/dev-ruby/metasploit-payloads/metasploit-payloads-1.0.9.ebuild @@ -0,0 +1,45 @@ +# Copyright 1999-2015 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Header: /var/cvsroot/gentoo-x86/dev-ruby/meterpreter_bins/meterpreter_bins-0.0.10.ebuild,v 1.1 2014/10/19 23:24:24 zerochaos Exp $ + +EAPI=5 + +USE_RUBY="ruby19 ruby20 ruby21" + +RUBY_FAKEGEM_TASK_DOC="" + +RUBY_FAKEGEM_EXTRAINSTALL="data" + +inherit ruby-fakegem + +DESCRIPTION="Compiled binaries for Metasploit's Meterpreter" +HOMEPAGE="https://rubygems.org/gems/metasploit-payloads" + +LICENSE="BSD" + +SLOT="${PV}" +KEYWORDS="~amd64 ~arm ~x86" +IUSE="" + +#no tests +RESTRICT=test + +QA_PREBUILT=" + usr/$(get_libdir)/ruby/gems/*/gems/${PN}-${SLOT}/data/meterpreter/msflinker_linux_x86.bin + usr/$(get_libdir)/ruby/gems/*/gems/${PN}-${SLOT}/data/meterpreter/ext_server_sniffer.lso + usr/$(get_libdir)/ruby/gems/*/gems/${PN}-${SLOT}/data/meterpreter/ext_server_networkpug.lso + usr/$(get_libdir)/ruby/gems/*/gems/${PN}-${SLOT}/data/meterpreter/ext_server_stdapi.lso + usr/$(get_libdir)/ruby/gems/*/gems/${PN}-${SLOT}/data/android/libs/armeabi/libndkstager.so + usr/$(get_libdir)/ruby/gems/*/gems/${PN}-${SLOT}/data/android/libs/mips/libndkstager.so + usr/$(get_libdir)/ruby/gems/*/gems/${PN}-${SLOT}/data/android/libs/x86/libndkstager.so + " + +src_install() { + ruby-ng_src_install + #tell revdep-rebuild to ignore binaries meant for the target + dodir /etc/revdep-rebuild + cat <<-EOF > "${ED}"/etc/revdep-rebuild/99-${PN}-${SLOT} + #These dirs contain prebuilt binaries for running on the TARGET not the HOST + SEARCH_DIRS_MASK="/usr/lib*/ruby/gems/*/gems/${PN}-${SLOT}/data/android/libs" + EOF +} diff --git a/dev-ruby/metasploit_data_models/Manifest b/dev-ruby/metasploit_data_models/Manifest index b6c9b2d9c7705..fbf69cf4699f4 100644 --- a/dev-ruby/metasploit_data_models/Manifest +++ b/dev-ruby/metasploit_data_models/Manifest @@ -1 +1 @@ -DIST metasploit_data_models-0.17.0.tar.gz 93759 SHA256 ce24d5ac6ff4e60dd04ed82c9e7821617c1234d32c7e6708573fc5a36942532f SHA512 0ca1556d6c8b8a83abd4bad2641d795979e5c7df8bd226ea9be6024df7bb71cec0e5434126a33e09842618a6df1e6dbec0d9049bd4997f3042b063c413e50c69 WHIRLPOOL 224e873f2457cbbd6a142fc28b0076cb325382055a3fcbd20107fc3d439e3ce2cf28e3007517fec7b6537a58194322497bc98342b6d11d4b3a051355a10b6965 +DIST metasploit_data_models-1.2.5.gem 170496 SHA256 7aa426e8f0d69c7a2c00f916dfbbbd19817ec0fe5e55e2d1260fb37ff8b32e29 SHA512 b7bb1f12da67b0a052cba68e5f870bc7512baba884573a79095abd4d55539c18956615bd7097f1c1260507222f80644a2d0a65bb9f3ca7cc4c45e275ee5c9500 WHIRLPOOL d6702bdeb59e8dcac3516f2ba8be3a319348e6a08803bcc93a8beba6a76a6e3ca5ce8e46263f9e30c37f01c745ab4badd3665a3984f7ea6ae015bb4b8c3330ec diff --git a/dev-ruby/metasploit_data_models/metasploit_data_models-0.17.0.ebuild b/dev-ruby/metasploit_data_models/metasploit_data_models-0.17.0.ebuild deleted file mode 100644 index 69ac28f2ac76e..0000000000000 --- a/dev-ruby/metasploit_data_models/metasploit_data_models-0.17.0.ebuild +++ /dev/null @@ -1,29 +0,0 @@ -# Copyright 1999-2015 Gentoo Foundation -# Distributed under the terms of the GNU General Public License v2 -# $Id$ - -EAPI=5 - -USE_RUBY="ruby19 ruby20 ruby21" - -RUBY_FAKEGEM_TASK_DOC="" - -# Tests depend on unpackaged factory_girl_rails -RUBY_FAKEGEM_RECIPE_TEST="" - -RUBY_FAKEGEM_EXTRAINSTALL="app db script spec" - -inherit ruby-fakegem - -DESCRIPTION="The database layer for Metasploit" -HOMEPAGE="https://github.com/rapid7/metasploit_data_models" -SRC_URI="https://github.com/rapid7/${PN}/archive/v${PV}.tar.gz -> ${P}.tar.gz" - -LICENSE="BSD" -SLOT="0" -KEYWORDS="~amd64 ~arm ~x86" -IUSE="" - -ruby_add_rdepend " - >=dev-ruby/activerecord-3.2.10[postgres] - dev-ruby/activesupport" diff --git a/dev-ruby/metasploit_data_models/metasploit_data_models-1.2.5.ebuild b/dev-ruby/metasploit_data_models/metasploit_data_models-1.2.5.ebuild new file mode 100644 index 0000000000000..3fff46ca762b1 --- /dev/null +++ b/dev-ruby/metasploit_data_models/metasploit_data_models-1.2.5.ebuild @@ -0,0 +1,63 @@ +# Copyright 1999-2015 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Header: /var/cvsroot/gentoo-x86/dev-ruby/metasploit_data_models/metasploit_data_models-0.17.0.ebuild,v 1.3 2014/07/09 21:13:54 zerochaos Exp $ + +EAPI=5 +USE_RUBY="ruby19 ruby20 ruby21" + +inherit ruby-fakegem versionator + +RUBY_FAKEGEM_EXTRAINSTALL="app config db script spec" + +DESCRIPTION="The database layer for Metasploit" +HOMEPAGE="https://github.com/rapid7/metasploit_data_models" +SRC_URI="mirror://rubygems/${P}.gem" + +LICENSE="BSD" +SLOT="$(get_version_component_range 1-2)" +KEYWORDS="~amd64 ~x86" +RESTRICT=test +#IUSE="development test" +IUSE="" + +RDEPEND="${RDEPEND} !dev-ruby/metasploit_data_models:0" + +ruby_add_rdepend " + >=dev-ruby/activerecord-4.0.9:4.0[postgres] + >=dev-ruby/activesupport-4.0.9:4.0 + dev-ruby/pg + dev-ruby/postgres_ext + >=dev-ruby/railties-4.0.9:4.0 + dev-ruby/recog + dev-ruby/arel-helpers + >=dev-ruby/metasploit-concern-1.0.0:1.0 + >=dev-ruby/metasploit-model-1.0.0:1.0 + + + + + zerochaos@gentoo.org + Rick Farina + + + + + dockyard/pg_array_parser + + diff --git a/dev-ruby/pg_array_parser/pg_array_parser-0.0.9.ebuild b/dev-ruby/pg_array_parser/pg_array_parser-0.0.9.ebuild new file mode 100644 index 0000000000000..723e34ec052e7 --- /dev/null +++ b/dev-ruby/pg_array_parser/pg_array_parser-0.0.9.ebuild @@ -0,0 +1,42 @@ +# Copyright 1999-2015 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Header: Exp $ + +EAPI=5 +USE_RUBY="ruby19 ruby20 ruby21" + +inherit ruby-fakegem versionator + +DESCRIPTION="Simple library to parse PostgreSQL arrays into a array of strings" +HOMEPAGE="https://github.com/dockyard/pg_array_parser" +SRC_URI="mirror://rubygems/${P}.gem" + +LICENSE="BSD" +SLOT="$(get_version_component_range 1-3)" +KEYWORDS="~amd64 ~x86" +IUSE="" +RESTRICT=test + +ruby_add_bdepend "dev-ruby/bundler" + +all_ruby_prepare() { + [ -f Gemfile.lock ] && rm Gemfile.lock + #if ! use development; then + sed -i -e "/^group :development do/,/^end$/d" Gemfile || die + sed -i -e "/s.add_development_dependency/d" "${PN}".gemspec || die + sed -i -e "/gem.add_development_dependency/d" "${PN}".gemspec || die + #fi + #if ! use test; then + sed -i -e "/^group :test do/,/^end$/d" Gemfile || die + #fi + #if ! use test && ! use development; then + sed -i -e "/^group :development, :test do/,/^end$/d" Gemfile || die + #fi +} + +each_ruby_prepare() { + if [ -f Gemfile ]; then + BUNDLE_GEMFILE=Gemfile ${RUBY} -S bundle install --local || die + BUNDLE_GEMFILE=Gemfile ${RUBY} -S bundle check || die + fi +} diff --git a/dev-ruby/postgres_ext/Manifest b/dev-ruby/postgres_ext/Manifest new file mode 100644 index 0000000000000..a0525a902f8e8 --- /dev/null +++ b/dev-ruby/postgres_ext/Manifest @@ -0,0 +1 @@ +DIST postgres_ext-2.4.1.gem 20992 SHA256 41d5bd383537e90833005f87fe502843ee7097c5a981e81f7ed8464635d89df3 SHA512 e8a0b2990e2939f600c92bfae70ebfb142875ca3b86d6d6ad95bc8bbaf350df8c2fde5173f51ff71616e5b68d7d852d1f4b201573c05afa39aa4134c9cb4ef75 WHIRLPOOL 8d2126b0717c7f4311bd171542dd76db8d56c6b07cdd05400af7130a9e8f06df324faf4ca5aacbddfb31fdfeedf2e40bb9f960f1cbd515f3687dbe5a31c1a622 diff --git a/dev-ruby/postgres_ext/metadata.xml b/dev-ruby/postgres_ext/metadata.xml new file mode 100644 index 0000000000000..5ff2ea70d7e13 --- /dev/null +++ b/dev-ruby/postgres_ext/metadata.xml @@ -0,0 +1,13 @@ + + + + + zerochaos@gentoo.org + Rick Farina + + + + + dockyard/postgres_ext + + diff --git a/dev-ruby/postgres_ext/postgres_ext-2.4.1.ebuild b/dev-ruby/postgres_ext/postgres_ext-2.4.1.ebuild new file mode 100644 index 0000000000000..7a87fd7658fd4 --- /dev/null +++ b/dev-ruby/postgres_ext/postgres_ext-2.4.1.ebuild @@ -0,0 +1,52 @@ +# Copyright 1999-2015 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Header: Exp $ + +EAPI=5 +USE_RUBY="ruby19 ruby20 ruby21" + +inherit ruby-fakegem versionator + +DESCRIPTION="Adds native PostgreSQL data types to ActiveRecord and querying extensions for ActiveRecord and Arel" +HOMEPAGE="https://github.com/dockyard/postgres_ext" +SRC_URI="mirror://rubygems/${P}.gem" + +LICENSE="BSD" +SLOT="$(get_version_component_range 1-2)" +KEYWORDS="~amd64 ~x86" +IUSE="" +RESTRICT=test + +ruby_add_rdepend "|| ( dev-ruby/activerecord:4.0 + dev-ruby/activerecord:4.1 + dev-ruby/activerecord:4.2 ) + >=dev-ruby/arel-4.0.1:* + dev-ruby/pg_array_parser:0.0.9" + +ruby_add_bdepend "dev-ruby/bundler" + +all_ruby_prepare() { + [ -f Gemfile.lock ] && rm Gemfile.lock + #if ! use development; then + sed -i -e "/^group :development do/,/^end$/d" Gemfile || die + sed -i -e "/s.add_development_dependency/d" "${PN}".gemspec || die + sed -i -e "/gem.add_development_dependency/d" "${PN}".gemspec || die + #fi + #if ! use test; then + sed -i -e "/^group :test do/,/^end$/d" Gemfile || die + #fi + #if ! use test && ! use development; then + sed -i -e "/^group :development, :test do/,/^end$/d" Gemfile || die + #fi + #https://github.com/dockyard/postgres_ext/issues/166 + #ugh, thanks + sed -i -e "/byebug/d" Gemfile || die + sed -i -e "/fivemat/d" Gemfile || die +} + +each_ruby_prepare() { + if [ -f Gemfile ]; then + BUNDLE_GEMFILE=Gemfile ${RUBY} -S bundle install --local || die + BUNDLE_GEMFILE=Gemfile ${RUBY} -S bundle check || die + fi +} diff --git a/dev-ruby/rb-readline-r7/Manifest b/dev-ruby/rb-readline-r7/Manifest new file mode 100644 index 0000000000000..10f0f52847504 --- /dev/null +++ b/dev-ruby/rb-readline-r7/Manifest @@ -0,0 +1 @@ +DIST rb-readline-r7-0.5.2.0.gem 96256 SHA256 ea2f63086533f370020087f6ca198b91699a254e79b2f69ba792a2829dffa339 SHA512 e94b60e368104f5e626a5c98dbe894cea52294b9c2061aa0cf32c34b7575a1ba9b0c514221ce266be89553d7936fc82696fc979710b9e8bb2503fc8b3cc0a938 WHIRLPOOL c9556322f6d3ca36674d46c1d9b49680cb76bf642ebf0369df1931503d83ac4b4a6f242d889d1f6f03a59aca6b8decd9598d25f2c1a97f45b8492b6c498fd17c diff --git a/dev-ruby/rb-readline-r7/metadata.xml b/dev-ruby/rb-readline-r7/metadata.xml new file mode 100644 index 0000000000000..92f9b7f675933 --- /dev/null +++ b/dev-ruby/rb-readline-r7/metadata.xml @@ -0,0 +1,13 @@ + + + + + zerochaos@gentoo.org + Rick Farina + + + + + rapid7/rb-readline + + diff --git a/dev-ruby/rb-readline-r7/rb-readline-r7-0.5.2.0.ebuild b/dev-ruby/rb-readline-r7/rb-readline-r7-0.5.2.0.ebuild new file mode 100644 index 0000000000000..4435817e5101e --- /dev/null +++ b/dev-ruby/rb-readline-r7/rb-readline-r7-0.5.2.0.ebuild @@ -0,0 +1,24 @@ +# Copyright 1999-2015 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Header: /var/cvsroot/gentoo-x86/dev-ruby/rb-readline/rb-readline-0.5.2.ebuild,v 1.1 2015/01/01 07:53:09 graaff Exp $ + +EAPI=5 +USE_RUBY="ruby19 ruby20 ruby21 ruby22" + +RUBY_FAKEGEM_RECIPE_DOC="rdoc" +inherit ruby-fakegem + +DESCRIPTION="Ruby implementation of the GNU readline C library forked by r7" +HOMEPAGE="http://rubygems.org/gems/rb-readline-r7" + +LICENSE="BSD" +SLOT="0" +KEYWORDS="~amd64 ~arm ~x86" +IUSE="" +DEPEND="test? ( dev-ruby/minitest + dev-ruby/rake )" + +all_ruby_prepare() { + # Skip a test that fails when run in the ebuild environment. + sed -i -e '/test_readline_with_default_parameters_does_not_error/,/end/ s:^:#:' test/test_readline.rb || die +} diff --git a/dev-ruby/recog/Manifest b/dev-ruby/recog/Manifest new file mode 100644 index 0000000000000..63227be8198c4 --- /dev/null +++ b/dev-ruby/recog/Manifest @@ -0,0 +1 @@ +DIST recog-2.0.6.gem 188928 SHA256 333d867db310b908342f857ee4f3f60b869386ff7b908e06f4dec8b9352ceb97 SHA512 408e83889632127d584ce8d09244c63246807aa5f89d88c082bbfd441a2e708cd67f23aebf23fa08c5db6bfd7ff771071daf64df9a66224aa5f04fcaba3d1387 WHIRLPOOL 2aaef470b15e3b8ac99d99bc3f8975447d5aa3d05220540d61f4972083f8cf6a0b04ba89e88aefc0dfd355f59f6f1bd5e9754bf00b6b5a5a953ef21f42fc3509 diff --git a/dev-ruby/recog/metadata.xml b/dev-ruby/recog/metadata.xml new file mode 100644 index 0000000000000..839af48d6ad55 --- /dev/null +++ b/dev-ruby/recog/metadata.xml @@ -0,0 +1,13 @@ + + + + + zerochaos@gentoo.org + Rick Farina + + + + + rapid7/recog + + diff --git a/dev-ruby/recog/recog-2.0.6.ebuild b/dev-ruby/recog/recog-2.0.6.ebuild new file mode 100644 index 0000000000000..d59a1567babd4 --- /dev/null +++ b/dev-ruby/recog/recog-2.0.6.ebuild @@ -0,0 +1,19 @@ +# Copyright 1999-2015 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Header: $ + +EAPI=5 +USE_RUBY="ruby19 ruby20 ruby21" + +inherit ruby-fakegem + +DESCRIPTION="Pattern recognition for hosts, services, and content" +HOMEPAGE="https://github.com/rapid7/${PN}" +SRC_URI="mirror://rubygems/${P}.gem" + +LICENSE="BSD" +SLOT="2" +KEYWORDS="~amd64 ~x86" +IUSE="" + +ruby_add_rdepend "dev-ruby/nokogiri !=dev-ruby/recog-2.0.0" diff --git a/dev-ruby/rubyntlm/Manifest b/dev-ruby/rubyntlm/Manifest new file mode 100644 index 0000000000000..2ebd2b1736dd1 --- /dev/null +++ b/dev-ruby/rubyntlm/Manifest @@ -0,0 +1 @@ +DIST rubyntlm-0.4.0.gem 21504 SHA256 bd10dcab5f1166e10049f0649a28f49bcc56c0592683d094a2852dd62b8ab50f SHA512 33a845b3b898d5e45ef51d4c3ab9a928789d2506c9854dedac2afb71b639abd91054c89357a0f33f975984172b8b7bf58c22a6ec50e4ab423d3269910284151e WHIRLPOOL a67927dde3fc3b539640d5d346e239c4fd0db4c0f3e7af1836c619ee942920a9f5f7c26e7035d0dfe9ef98de610fefb945ab6ed480403437e94af4ac6a64e59f diff --git a/dev-ruby/rubyntlm/metadata.xml b/dev-ruby/rubyntlm/metadata.xml new file mode 100644 index 0000000000000..3c8603ea0821a --- /dev/null +++ b/dev-ruby/rubyntlm/metadata.xml @@ -0,0 +1,13 @@ + + + + + zerochaos@gentoo.org + Rick Farina + + + + + winrb/rubyntlm + + diff --git a/dev-ruby/rubyntlm/rubyntlm-0.4.0.ebuild b/dev-ruby/rubyntlm/rubyntlm-0.4.0.ebuild new file mode 100644 index 0000000000000..1adcaf3a1746a --- /dev/null +++ b/dev-ruby/rubyntlm/rubyntlm-0.4.0.ebuild @@ -0,0 +1,17 @@ +# Copyright 1999-2015 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Header: /var/cvsroot/gentoo-x86/dev-ruby/metasploit_data_models/metasploit_data_models-0.17.0.ebuild,v 1.3 2014/07/09 21:13:54 zerochaos Exp $ + +EAPI=5 +USE_RUBY="ruby19 ruby20 ruby21" + +inherit ruby-fakegem + +DESCRIPTION="Ruby/NTLM provides message creator and parser for the NTLM authentication." +HOMEPAGE="http://rubygems.org/gems/rubyntlm" +SRC_URI="mirror://rubygems/${P}.gem" + +LICENSE="BSD" +SLOT="0" +KEYWORDS="~amd64 ~x86" +IUSE="" diff --git a/net-analyzer/metasploit/Manifest b/net-analyzer/metasploit/Manifest index 67678608b4170..7b154fdb3042e 100644 --- a/net-analyzer/metasploit/Manifest +++ b/net-analyzer/metasploit/Manifest @@ -1,2 +1,2 @@ DIST framework-2.7.tar.gz 5800216 SHA256 516952772aaa8982628460b927c9119850925f870903c5a131a9c9f0390cf77f SHA512 a65740c81e6c711e6661170ec0dd87919cad6c4aa3aaac08fdaa72b4825be4bea28ec09c78f818ddab7660f5b485b13f87e3175b43c625319ce89b044a40f2a0 WHIRLPOOL f309608e30488484b24555fec84e65ed0dcbeba62a69e6ec23c507dbc0fcf720551a795e2a0793886fcd38d3a9b160819c864720155f58f274577b0246f05946 -DIST framework-4.9.3.tar.bz2 36334540 SHA256 76aa4651b8235a018ccb46b31974fa8785e3d16bd753ac34d66fa60468d304b3 SHA512 a16608c718c57913fa5206032ca3707504f83fb25e1a9aec93dbec8d799c7d600f8f2eafb6882bddf64082a19bf9ad39b461c180946499f4e4821f249270ee6f WHIRLPOOL cd4fa596e810a63ee16147f7c4acd3af9b6389732159721c1ce560233ff0a2364964fa56393fbc2e5dc6d0ba161a484c5b7c02603cd23da081ea896c4fd7370e +DIST metasploit-4.11.4_p2015090201.tar.gz 35211994 SHA256 1254dbb3e8cf33c7a6c8c701a0be13f78bbd2234503e636f1afacf88676aeea2 SHA512 b96c9735ef579b5f98d1fd7176f91bb1710d263a19d3ff891877df8e341baa1749d5fdce9825a19d9ecbe162b72ebcd11336d4d7884e066f4e199baaff8b4085 WHIRLPOOL 875db5df25112736dd62ec1195080d2567a670cf3a770e787b70c364c6b30b43bf906f7ba35901ff367ce940b02af7b17ae135693a28ff5fca9fc05038132ae2 diff --git a/net-analyzer/metasploit/metadata.xml b/net-analyzer/metasploit/metadata.xml index 9ba0d4a92316a..c118704ddaef8 100644 --- a/net-analyzer/metasploit/metadata.xml +++ b/net-analyzer/metasploit/metadata.xml @@ -8,7 +8,6 @@ Install dependencies needed for metasploit and exploit development - Enable lorcon for raw packet injection Enable restricted oracle modules which have additional deps Enable libpcap for packet sniffing diff --git a/net-analyzer/metasploit/metasploit-9999.ebuild b/net-analyzer/metasploit/metasploit-4.11.4_p2015090201.ebuild similarity index 78% rename from net-analyzer/metasploit/metasploit-9999.ebuild rename to net-analyzer/metasploit/metasploit-4.11.4_p2015090201.ebuild index 38ea5e220bf67..5e6046d55a4ec 100644 --- a/net-analyzer/metasploit/metasploit-9999.ebuild +++ b/net-analyzer/metasploit/metasploit-4.11.4_p2015090201.ebuild @@ -1,63 +1,79 @@ # Copyright 1999-2015 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 -# $Id$ +# $Header: $ EAPI="5" +#never ever ever have more than one ruby in here +USE_RUBY="ruby21" +inherit eutils ruby-ng + if [[ ${PV} == "9999" ]] ; then EGIT_REPO_URI="https://github.com/rapid7/metasploit-framework.git" EGIT_CHECKOUT_DIR="${WORKDIR}"/all inherit git-r3 KEYWORDS="" + SLOT="9999" else - #https://github.com/rapid7/metasploit-framework/wiki/Downloads-by-Version - SRC_URI="http://downloads.metasploit.com/data/releases/archive/framework-${PV}.tar.bz2" - KEYWORDS="~amd64 ~arm ~x86" - S="${WORKDIR}"/msf3 + ##Tags https://github.com/rapid7/metasploit-framework/releases + ##Releases https://github.com/rapid7/metasploit-framework/wiki/Downloads-by-Version + #SRC_URI="https://github.com/rapid7/metasploit-framework/archive/${PV}.tar.gz -> ${P}.tar.gz" + ##Snapshots + MY_PV=${PV/_p/-} + SRC_URI="https://github.com/rapid7/metasploit-framework/archive/${MY_PV}.tar.gz -> ${P}.tar.gz" + KEYWORDS="~amd64 ~x86" + RUBY_S="${PN}-framework-${MY_PV}" + inherit versionator + SLOT="$(get_version_component_range 1).$(get_version_component_range 2)" fi -#ruby20 doesn't have wide enough support in gentoo yet (but is semi-supported upstream) -USE_RUBY="ruby19" -inherit eutils ruby-ng - DESCRIPTION="Advanced open-source framework for developing, testing, and using vulnerability exploit code" HOMEPAGE="http://www.metasploit.org/" -SLOT="9999" LICENSE="BSD" -IUSE="development +java lorcon oracle +pcap test" +IUSE="development +java oracle +pcap test" #multiple known bugs with tests reported upstream and ignored #http://dev.metasploit.com/redmine/issues/8418 - worked around (fix user creation when possible) RESTRICT="test" RUBY_COMMON_DEPEND="virtual/ruby-ssl - dev-ruby/activesupport:3.2 - dev-ruby/activerecord:3.2 + >=dev-ruby/activesupport-4.0.9:4.0 + >=dev-ruby/actionpack-4.0.9:4.0 + >=dev-ruby/activerecord-4.0.9:4.0 dev-ruby/bcrypt-ruby dev-ruby/builder:3 dev-ruby/bundler + =dev-ruby/jsobfu-0.2* dev-ruby/json dev-ruby/kissfft - =dev-ruby/metasploit_data_models-0.17.0 - =dev-ruby/meterpreter_bins-0.0.6 + =dev-ruby/metasploit_data_models-1.2.5 + dev-ruby/meterpreter_bins:0.0.22 + dev-ruby/metasploit-payloads:1.0.9 + >=dev-ruby/metasploit-credential-1.0.0:1.0 + >=dev-ruby/metasploit-concern-1.0.0:1.0 + >=dev-ruby/metasploit-model-1.0.0:1.0 dev-ruby/msgpack dev-ruby/nokogiri + =dev-ruby/recog-2.0.6:2 =dev-ruby/rkelly-remix-0.0.6 dev-ruby/sqlite3 >=dev-ruby/pg-0.11 =dev-ruby/packetfu-1.1.9 - dev-ruby/rb-readline + >=dev-ruby/rubyzip-1.1 + dev-ruby/rb-readline-r7 dev-ruby/robots java? ( dev-ruby/rjb ) - lorcon? ( net-wireless/lorcon[ruby] ) oracle? ( dev-ruby/ruby-oci8 ) pcap? ( dev-ruby/pcaprub dev-ruby/network_interface ) development? ( dev-ruby/fivemat + dev-ruby/pry dev-ruby/redcarpet dev-ruby/yard >=dev-ruby/rake-10.0.0 >=dev-ruby/factory_girl-4.1.0 )" + #lorcon doesn't support ruby21 + #lorcon? ( net-wireless/lorcon[ruby] ) ruby_add_bdepend "${RUBY_COMMON_DEPEND} test? ( >=dev-ruby/factory_girl-4.1.0 dev-ruby/fivemat @@ -71,9 +87,8 @@ ruby_add_rdepend "${RUBY_COMMON_DEPEND}" COMMON_DEPEND="dev-db/postgresql[server] >=app-crypt/johntheripper-1.7.9-r1[-minimal] net-analyzer/nmap" -DEPEND+=" ${COMMON_DEPEND}" RDEPEND+=" ${COMMON_DEPEND} - >=app-eselect/eselect-metasploit-0.13" + >=app-eselect/eselect-metasploit-0.16" RESTRICT="strip" @@ -82,7 +97,9 @@ QA_PREBUILT=" usr/$(get_libdir)/${PN}${SLOT}/data/templates/template_armle_linux.bin usr/$(get_libdir)/${PN}${SLOT}/data/templates/template_x86_solaris.bin usr/$(get_libdir)/${PN}${SLOT}/data/templates/template_x64_linux.bin + usr/$(get_libdir)/${PN}${SLOT}/data/templates/template_x64_linux_dll.bin usr/$(get_libdir)/${PN}${SLOT}/data/templates/template_x86_bsd.bin + usr/$(get_libdir)/${PN}${SLOT}/data/templates/template_x64_bsd.bin usr/$(get_libdir)/${PN}${SLOT}/data/templates/template_mipsbe_linux.bin usr/$(get_libdir)/${PN}${SLOT}/data/templates/template_mipsle_linux.bin usr/$(get_libdir)/${PN}${SLOT}/data/meterpreter/msflinker_linux_x86.bin @@ -90,6 +107,7 @@ QA_PREBUILT=" usr/$(get_libdir)/${PN}${SLOT}/data/meterpreter/ext_server_networkpug.lso usr/$(get_libdir)/${PN}${SLOT}/data/meterpreter/ext_server_stdapi.lso usr/$(get_libdir)/${PN}${SLOT}/data/exploits/CVE-2013-2171.bin + usr/$(get_libdir)/${PN}${SLOT}/data/exploits/CVE-2014-3153.elf usr/$(get_libdir)/${PN}${SLOT}/data/android/libs/x86/libndkstager.so usr/$(get_libdir)/${PN}${SLOT}/data/android/libs/mips/libndkstager.so usr/$(get_libdir)/${PN}${SLOT}/data/android/libs/armeabi/libndkstager.so @@ -113,8 +131,10 @@ all_ruby_unpack() { git-r3_src_unpack else default_src_unpack - mv "${WORKDIR}"/all/msf3/* "${WORKDIR}"/all - rm -r msf3 +# mv "${WORKDIR}"/all/msf3/* "${WORKDIR}"/all +# rm -r msf3 + #msf_version=$(grep --color=never "CURRENT_VERSION =" ${S}/spec/lib/msf/core/framework_spec.rb) + #msf_version=${msf_version#*=} fi } @@ -138,12 +158,14 @@ all_ruby_prepare() { rm Gemfile.lock #The Gemfile contains real known deps #add our dep on upstream rb-readline instead of bundled one - sed -i "/gem 'packetfu'/a #use upstream readline instead of bundled\ngem 'rb-readline'" Gemfile || die + #and then they broke it... + #sed -i "/gem 'packetfu'/a #use upstream readline instead of bundled\ngem 'rb-readline'" Gemfile || die sed -i "/gem 'fivemat'/s/, '1.2.1'//" Gemfile || die #remove the bundled readline #https://github.com/rapid7/metasploit-framework/pull/3105 #this PR was closed due to numerous changes to their local fork, almost entirely for non-linux - rm lib/rbreadline.rb + #but now we have to go back to bundled readline because otherwise it's broken + #rm lib/rbreadline.rb #now we edit the Gemfile based on use flags #even if we pass --without=blah bundler still calculates the deps and messes us up if ! use pcap; then @@ -158,11 +180,13 @@ all_ruby_prepare() { if ! use test && ! use development; then sed -i -e "/^group :development/,/^end$/d" Gemfile || die fi - if use test; then - #We don't need simplecov - sed -i -e "s#gem 'simplecov', '0.5.4', :require => false##" Gemfile || die - sed -i -e "s#require 'simplecov'##" spec/spec_helper.rb || die - fi + #We don't need simplecov + sed -i -e "/^group :coverage/,/^end$/d" Gemfile || die + sed -i -e "s#require 'simplecov'##" spec/spec_helper.rb || die + + #we need to edit the gemspec too, since it tries to call git instead of anything sane + #probably a better way to fix this... if I care at some point + sed -i -e "/^ spec.files/,/^ }/d" metasploit-framework.gemspec || die #let's bogart msfupdate rm msfupdate @@ -191,10 +215,10 @@ all_ruby_prepare() { } each_ruby_prepare() { - BUNDLE_GEMFILE=Gemfile ${RUBY} -S bundle install --local || die - BUNDLE_GEMFILE=Gemfile ${RUBY} -S bundle check || die + MSF_ROOT="." BUNDLE_GEMFILE=Gemfile ${RUBY} -S bundle install --local || die + MSF_ROOT="." BUNDLE_GEMFILE=Gemfile ${RUBY} -S bundle check || die - #force all metasploit executables to ruby19, ruby18 is not supported anymore and ruby20 is not supported yet + #force all metasploit executables to use desired ruby version #https://dev.metasploit.com/redmine/issues/8357 for file in $(ls -1 msf*) do @@ -248,7 +272,6 @@ all_ruby_install() { #These dirs contain prebuilt binaries for running on the TARGET not the HOST SEARCH_DIRS_MASK="/usr/lib*/${PN}${SLOT}/data/meterpreter" SEARCH_DIRS_MASK="/usr/lib*/${PN}${SLOT}/data/exploits" - SEARCH_DIRS_MASK="/usr/lib*/${PN}${SLOT}/data/android/libs" EOF } @@ -257,7 +280,7 @@ pkg_postinst() { elog "otherwise you may be missing important environmental variables." elog "You need to prepare the database by running:" - elog "emerge --config postgresql-server" + elog "emerge --config postgresql" elog "/etc/init.d/postgresql- start" elog "emerge --config =metasploit-${PV}" diff --git a/net-analyzer/metasploit/metasploit-4.9.3.ebuild b/net-analyzer/metasploit/metasploit-4.9.3.ebuild deleted file mode 100644 index 4450ae20cae92..0000000000000 --- a/net-analyzer/metasploit/metasploit-4.9.3.ebuild +++ /dev/null @@ -1,273 +0,0 @@ -# Copyright 1999-2015 Gentoo Foundation -# Distributed under the terms of the GNU General Public License v2 -# $Id$ - -EAPI="5" - -if [[ ${PV} == "9999" ]] ; then - EGIT_REPO_URI="https://github.com/rapid7/metasploit-framework.git" - EGIT_CHECKOUT_DIR="${WORKDIR}"/all - inherit git-r3 - KEYWORDS="" -else - #https://github.com/rapid7/metasploit-framework/wiki/Downloads-by-Version - SRC_URI="http://downloads.metasploit.com/data/releases/archive/framework-${PV}.tar.bz2" - KEYWORDS="~amd64 ~arm ~x86" - S="${WORKDIR}"/msf3 -fi - -#ruby20 doesn't have wide enough support in gentoo yet (but is semi-supported upstream) -USE_RUBY="ruby19" -inherit eutils ruby-ng - -DESCRIPTION="Advanced open-source framework for developing, testing, and using vulnerability exploit code" -HOMEPAGE="http://www.metasploit.org/" -SLOT="4.9" -LICENSE="BSD" -IUSE="development +java lorcon oracle +pcap test" - -#multiple known bugs with tests reported upstream and ignored -#http://dev.metasploit.com/redmine/issues/8418 - worked around (fix user creation when possible) -RESTRICT="test" - -RUBY_COMMON_DEPEND="virtual/ruby-ssl - =dev-ruby/rkelly-remix-0.0.6 - dev-ruby/bcrypt-ruby - dev-ruby/activesupport:3.2 - dev-ruby/activerecord:3.2 - dev-ruby/json - =dev-ruby/metasploit_data_models-0.17.0 - dev-ruby/msgpack - dev-ruby/nokogiri - dev-ruby/sqlite3 - dev-ruby/builder:3 - >=dev-ruby/pg-0.11 - =dev-ruby/packetfu-1.1.9 - dev-ruby/rb-readline - dev-ruby/robots - dev-ruby/kissfft - java? ( dev-ruby/rjb ) - lorcon? ( net-wireless/lorcon[ruby] ) - oracle? ( dev-ruby/ruby-oci8 ) - pcap? ( dev-ruby/pcaprub - dev-ruby/network_interface ) - dev-ruby/bundler - development? ( dev-ruby/fivemat - dev-ruby/redcarpet - dev-ruby/yard - >=dev-ruby/rake-10.0.0 - >=dev-ruby/factory_girl-4.1.0 )" -ruby_add_bdepend "${RUBY_COMMON_DEPEND} - test? ( >=dev-ruby/factory_girl-4.1.0 - dev-ruby/fivemat - dev-ruby/database_cleaner - >=dev-ruby/rspec-2.12 - dev-ruby/shoulda-matchers - dev-ruby/timecop - >=dev-ruby/rake-10.0.0 )" -ruby_add_rdepend "${RUBY_COMMON_DEPEND}" - -COMMON_DEPEND="dev-db/postgresql[server] - >=app-crypt/johntheripper-1.7.9-r1[-minimal] - net-analyzer/nmap" -DEPEND+=" ${COMMON_DEPEND}" -RDEPEND+=" ${COMMON_DEPEND} - >=app-eselect/eselect-metasploit-0.13" - -RESTRICT="strip" - -QA_PREBUILT=" - usr/$(get_libdir)/${PN}${SLOT}/data/templates/template_x86_linux.bin - usr/$(get_libdir)/${PN}${SLOT}/data/templates/template_armle_linux.bin - usr/$(get_libdir)/${PN}${SLOT}/data/templates/template_x86_solaris.bin - usr/$(get_libdir)/${PN}${SLOT}/data/templates/template_x64_linux.bin - usr/$(get_libdir)/${PN}${SLOT}/data/templates/template_x86_bsd.bin - usr/$(get_libdir)/${PN}${SLOT}/data/templates/template_mipsbe_linux.bin - usr/$(get_libdir)/${PN}${SLOT}/data/templates/template_mipsle_linux.bin - usr/$(get_libdir)/${PN}${SLOT}/data/meterpreter/msflinker_linux_x86.bin - usr/$(get_libdir)/${PN}${SLOT}/data/meterpreter/ext_server_sniffer.lso - usr/$(get_libdir)/${PN}${SLOT}/data/meterpreter/ext_server_networkpug.lso - usr/$(get_libdir)/${PN}${SLOT}/data/meterpreter/ext_server_stdapi.lso - usr/$(get_libdir)/${PN}${SLOT}/data/templates/template_x86_linux.bin - usr/$(get_libdir)/${PN}${SLOT}/data/templates/template_armle_linux.bin - usr/$(get_libdir)/${PN}${SLOT}/data/templates/template_x86_solaris.bin - usr/$(get_libdir)/${PN}${SLOT}/data/templates/template_x64_linux.bin - usr/$(get_libdir)/${PN}${SLOT}/data/templates/template_x86_bsd.bin - usr/$(get_libdir)/${PN}${SLOT}/data/meterpreter/msflinker_linux_x86.bin - usr/$(get_libdir)/${PN}${SLOT}/data/meterpreter/ext_server_sniffer.lso - usr/$(get_libdir)/${PN}${SLOT}/data/meterpreter/ext_server_networkpug.lso - usr/$(get_libdir)/${PN}${SLOT}/data/meterpreter/ext_server_stdapi.lso - usr/$(get_libdir)/${PN}${SLOT}/data/exploits/CVE-2013-2171.bin - " - -pkg_setup() { - if use test; then - su postgres -c "dropdb msf_test_database" #this is intentionally allowed to fail - su postgres -c "createuser msf_test_user -d -S -R" - if [ $? -ne 0 ]; then - su postgres -c "dropuser msf_test_user" || die - su postgres -c "createuser msf_test_user -d -S -R" || die - fi - su postgres -c "createdb --owner=msf_test_user msf_test_database" || die - fi - ruby-ng_pkg_setup -} - -all_ruby_unpack() { - if [[ ${PV} == "9999" ]] ; then - git-r3_src_unpack - else - default_src_unpack - mv "${WORKDIR}"/all/msf3/* "${WORKDIR}"/all - rm -r msf3 - fi -} - -all_ruby_prepare() { - # add psexec patch from pull request 2657 to allow custom exe templates from any files, bypassing most AVs - #epatch "${FILESDIR}/agix_psexec_pull-2657.patch" - epatch_user - - #unbundle johntheripper, at least it now defaults to running the system version - rm -r data/john/run.* - rm -r data/john/src.tar.bz2 - #remove random "cpuinfo" binaries which a only needed to detect which bundled john to run - rm -r data/cpuinfo - - #remove random oudated collected garbage - rm -r external - - #remove unneeded ruby bundler versioning files - #Gemfile.lock contains the versions tested by the msf team but not the hard requirements - #we regen this file in each_ruby_prepare - rm Gemfile.lock - #The Gemfile contains real known deps - #add our dep on upstream rb-readline instead of bundled one - sed -i "/gem 'packetfu'/a #use upstream readline instead of bundled\ngem 'rb-readline'" Gemfile || die - sed -i "/gem 'fivemat'/s/, '1.2.1'//" Gemfile || die - #remove the bundled readline - #https://github.com/rapid7/metasploit-framework/pull/3105 - #this PR was closed due to numerous changes to their local fork, almost entirely for non-linux - rm lib/rbreadline.rb - #now we edit the Gemfile based on use flags - #even if we pass --without=blah bundler still calculates the deps and messes us up - if ! use pcap; then - sed -i -e "/^group :pcap do/,/^end$/d" Gemfile || die - fi - if ! use development; then - sed -i -e "/^group :development do/,/^end$/d" Gemfile || die - fi - if ! use test; then - sed -i -e "/^group :test/,/^end$/d" Gemfile || die - fi - if ! use test && ! use development; then - sed -i -e "/^group :development/,/^end$/d" Gemfile || die - fi - if use test; then - #We don't need simplecov - sed -i -e "s#gem 'simplecov', '0.5.4', :require => false##" Gemfile || die - sed -i -e "s#require 'simplecov'##" spec/spec_helper.rb || die - fi - - #let's bogart msfupdate - rm msfupdate - echo "#!/bin/sh" > msfupdate - echo "echo \"[*]\"" >> msfupdate - echo "echo \"[*] Attempting to update the Metasploit Framework...\"" >> msfupdate - echo "echo \"[*]\"" >> msfupdate - echo "echo \"\"" >> msfupdate - if [[ ${PV} == "9999" ]] ; then - echo "emerge --oneshot \"=${CATEGORY}/${PF}\"" >> msfupdate - else - echo "echo \"Unable to update tagged version of metasploit.\"" >> msfupdate - echo "echo \"If you want the latest please install and eselect the live version (metasploit9999)\"" >> msfupdate - echo "echo \"emerge metasploit:9999 -vat && eselect metasploit set metasploit9999\"" >> msfupdate - fi - #this is set executable in src_install - - #install our database.yml file before tests are run - cp "${FILESDIR}"/database.yml config/ - -} - -each_ruby_prepare() { - ${RUBY} -S bundle install --local || die - ${RUBY} -S bundle check || die - - #force all metasploit executables to ruby19, ruby18 is not supported anymore and ruby20 is not supported yet - #https://dev.metasploit.com/redmine/issues/8357 - for file in $(ls -1 msf*) - do - #poorly adapted from python.eclass - sed -e "1s:^#![[:space:]]*\([^[:space:]]*/usr/bin/env[[:space:]]\)\?[[:space:]]*\([^[:space:]]*/\)\?ruby\([[:digit:]]\+\(\.[[:digit:]]\+\)\?\)\?\(\$\|[[:space:]].*\):#!\1\2${RUBY}:" -i "${file}" || die "Conversion of shebang in '${file}' failed" - done -} - -each_ruby_test() { - #review dev-python/pymongo for ways to make the test compatible with FEATURES=network-sandbox - - #we bogart msfupdate so no point in trying to test it - rm spec/msfupdate_spec.rb || die - #we don't really want to be uploading to virustotal during the tests - rm spec/tools/virustotal_spec.rb || die - - # https://dev.metasploit.com/redmine/issues/8425 - ${RUBY} -S bundle exec rake db:create || die - ${RUBY} -S bundle exec rake db:migrate || die - - MSF_DATABASE_CONFIG=config/database.yml ${RUBY} -S bundle exec rake || die - su postgres -c "dropuser msf_test_user" || die "failed to cleanup msf_test-user" -} - -each_ruby_install() { - #Tests have already been run, we don't need this stuff - rm -r spec || die - rm -r test || die - rm Gemfile.lock || die - - #I'm 99% sure that this will only work for as long as we only support one ruby version. Creativity will be needed if we wish to support multiple. - # should be as simple as copying everything into the target... - dodir /usr/$(get_libdir)/${PN}${SLOT} - cp -R * "${ED}"/usr/$(get_libdir)/${PN}${SLOT} || die "Copy files failed" - rm -Rf "${ED}"/usr/$(get_libdir)/${PN}${SLOT}/documentation "${ED}"/usr/$(get_libdir)/${PN}${SLOT}/README.md - fowners -R root:0 / - -} - -all_ruby_install() { - # do not remove LICENSE, bug #238137 - dodir /usr/share/doc/${PF} - cp -R {documentation,README.md} "${ED}"/usr/share/doc/${PF} || die - dosym /usr/share/doc/${PF}/documentation /usr/$(get_libdir)/${PN}${SLOT}/documentation - - fperms +x /usr/$(get_libdir)/${PN}${SLOT}/msfupdate - - #tell revdep-rebuild to ignore binaries meant for the target - dodir /etc/revdep-rebuild - cat <<-EOF > "${ED}"/etc/revdep-rebuild/99-metasploit${SLOT} - #These dirs contain prebuilt binaries for running on the TARGET not the HOST - SEARCH_DIRS_MASK="/usr/lib*/${PN}${SLOT}/data/meterpreter" - SEARCH_DIRS_MASK="/usr/lib*/${PN}${SLOT}/data/exploits" - EOF -} - -pkg_postinst() { - elog "Before use you should run 'env-update' and '. /etc/profile'" - elog "otherwise you may be missing important environmental variables." - - elog "You need to prepare the database by running:" - elog "emerge --config postgresql-server" - elog "/etc/init.d/postgresql- start" - elog "emerge --config =metasploit-${PV}" - - "${EROOT}"/usr/bin/eselect metasploit set --use-old ${PN}${SLOT} - - einfo - elog "Adjust /usr/lib/${PN}${SLOT}/config/database.yml if necessary" -} - -pkg_config() { - einfo "If the following fails, it is likely because you forgot to start/config postgresql first" - su postgres -c "createuser msf_user -D -S -R" - su postgres -c "createdb --owner=msf_user msf_database" -} diff --git a/profiles/package.mask b/profiles/package.mask index 95df78d6cb46e..107a6045d2d06 100644 --- a/profiles/package.mask +++ b/profiles/package.mask @@ -30,6 +30,10 @@ #--- END OF EXAMPLES --- +# Rick Farina (04 Sep 2015) +# Ancient, please upgrade to ~arch version +=net-analyzer/metasploit-2.7 + # Michael Palimaka (01 Sep 2015) # Fails to build (bug #559330). Dead upstream. # Masked for removal in 30 days.