summaryrefslogtreecommitdiffstats
path: root/main/open-vm-tools-grsec
diff options
context:
space:
mode:
authorNatanael Copa <ncopa@alpinelinux.org>2014-05-07 09:50:46 +0000
committerNatanael Copa <ncopa@alpinelinux.org>2014-05-07 09:50:46 +0000
commit5ddada6fca3b5eca0566da912613c9c6eb21e77b (patch)
tree5918030a3cb0d1fac383c0896fb59ef8b5eeab69 /main/open-vm-tools-grsec
parentcab5c81e9742ed1da401a33c1f23cb65dabfc11d (diff)
downloadaports-5ddada6fca3b5eca0566da912613c9c6eb21e77b.tar.bz2
aports-5ddada6fca3b5eca0566da912613c9c6eb21e77b.tar.xz
main/open-vm-tools-grsec: disable. does not build with 3.14 kernel
Diffstat (limited to 'main/open-vm-tools-grsec')
-rw-r--r--main/open-vm-tools-grsec/APKBUILD14
-rw-r--r--main/open-vm-tools-grsec/frozen.patch28
-rw-r--r--main/open-vm-tools-grsec/kernel.patch364
-rw-r--r--main/open-vm-tools-grsec/putname.patch13
4 files changed, 369 insertions, 50 deletions
diff --git a/main/open-vm-tools-grsec/APKBUILD b/main/open-vm-tools-grsec/APKBUILD
index a1a8d83ee..3ba6c5258 100644
--- a/main/open-vm-tools-grsec/APKBUILD
+++ b/main/open-vm-tools-grsec/APKBUILD
@@ -3,7 +3,7 @@
_flavor=grsec
_kpkg=linux-$_flavor
_realname=open-vm-tools
-_kver=3.13.10
+_kver=3.14.2
_kpkgrel=0
_realver=9.4.0_p1280544
@@ -41,8 +41,7 @@ depends_dev="bash glib-dev gettext-dev linux-${_flavor}-dev=${_kernelver}"
makedepends="$depends_dev"
source="http://downloads.sourceforge.net/project/open-vm-tools/open-vm-tools/stable-${_realver%.*}.x/open-vm-tools-${_ver}.tar.gz
linux-3.10.patch
- frozen.patch
- putname.patch
+ kernel.patch
vmware-modules.initd
"
install_if="linux-${_flavor}=${_kernelver} open-vm-tools"
@@ -89,16 +88,13 @@ package() {
md5sums="91f74bf6e42a3f460a42b3be31db31dc open-vm-tools-9.4.0-1280544.tar.gz
cc82715976e9af9fb8f44465af2ca5aa linux-3.10.patch
-40706c98b9a3d124cb16a7ad58526313 frozen.patch
-9bca49147ac32f592efa859dbbd9a5f9 putname.patch
+70398edfbcac530ca9a7a4714bedffeb kernel.patch
afba2c3487d0b12cee80eb2f04b05ba1 vmware-modules.initd"
sha256sums="5d30652eb0f6dc5e930781029c184837e700be5543b6a7116db4c62a6f3ca399 open-vm-tools-9.4.0-1280544.tar.gz
f3108ab321f9b32ecb59aa4760f9958f97335492345a04de79d95bd98a7af8ff linux-3.10.patch
-5997f5aa4d1d2bb262b9ef24888d4706f1227af4d359862d3d49b4e6c961d193 frozen.patch
-dccba065f71f7a27dd7d38e3eb7d1de9e87b82a18db618538054043829c5d961 putname.patch
+96b4f0bf5f956803fbdffb388488c7d425f99e22ca069a66bb0283bc5cae67ed kernel.patch
6ceb5c75b002991c511d9dadb6cf91720771e76b701e5f2d91ac9ede4b168265 vmware-modules.initd"
sha512sums="07b36f49713140606f74864b59c2e01c9ed83a960dd3f5d172b84fc75e760f7370065774a0e26897924af60454c86b682ca0fd32276b0e9fb17b268247f8cbdf open-vm-tools-9.4.0-1280544.tar.gz
0b36a6318ef419832817f22d50f85d8a5ae080e9496ecdf16753b17e8a693573e46eb896c3dc83a44fc596e6737130245663908befe8aa4a038e16b08cc499a3 linux-3.10.patch
-5dbee1a119d6abd13b8217d66b8f611fee92c863b0d48029b1c05f33a06f6a20f35eaf6f01fb268a811270c6c799a1fef26939f7bfc97a42421e7f14b4cfa46d frozen.patch
-4a6da3c33bdd4b03ed7cf536c40c18d76a902687378e85cce08cf9ef9b23ae6ccedb0d334f69daee3588e6e83c080adce456f36fad69848e7089401052c4d2c2 putname.patch
+af51159f7357b1442449ec11d9328b2051c2b3865044ff2db184ad522e3495a9a0a76a3cc01d82e79e7d7d293b43b0a9f10fa4767d2a5efd3d7095f598e6896c kernel.patch
639098221975cadaed0ae0f32454a6718ceaa5f43f17d949a84a85dee56fbf5f9e6248899c10a46b12c9c9cf28b837d83a37c25aba62b11cb7849a1cf8d32e1e vmware-modules.initd"
diff --git a/main/open-vm-tools-grsec/frozen.patch b/main/open-vm-tools-grsec/frozen.patch
deleted file mode 100644
index 8b3fd7f37..000000000
--- a/main/open-vm-tools-grsec/frozen.patch
+++ /dev/null
@@ -1,28 +0,0 @@
-diff -urpN a/modules/linux/vmsync/sync.c b/modules/linux/vmsync/sync.c
---- a/modules/linux/vmsync/sync.c 2012-08-01 19:02:59.000000000 -0700
-+++ b/modules/linux/vmsync/sync.c 2012-10-14 07:38:18.000000000 -0700
-@@ -162,7 +162,11 @@ VmSyncThawDevices(void *_state) // IN
- cancel_delayed_work(&state->thawTask);
- list_for_each_safe(cur, tmp, &state->devices) {
- dev = list_entry(cur, VmSyncBlockDevice, list);
-+#if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 6, 0)
-+ if (dev->sb != NULL && dev->sb->s_writers.frozen != SB_UNFROZEN) {
-+#else
- if (dev->sb != NULL && dev->sb->s_frozen != SB_UNFROZEN) {
-+#endif
- thaw_bdev(dev->bdev, dev->sb);
- atomic_dec(&gFreezeCount);
- }
-@@ -237,7 +241,11 @@ VmSyncAddPath(const VmSyncState *state,
- * the superblock is already frozen.
- */
- if (inode->i_sb->s_bdev == NULL ||
-+#if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 6, 0)
-+ inode->i_sb->s_writers.frozen != SB_UNFROZEN) {
-+#else
- inode->i_sb->s_frozen != SB_UNFROZEN) {
-+#endif
- result = (inode->i_sb->s_bdev == NULL) ? -EINVAL : -EALREADY;
- compat_path_release(&nd);
- goto exit;
-
diff --git a/main/open-vm-tools-grsec/kernel.patch b/main/open-vm-tools-grsec/kernel.patch
new file mode 100644
index 000000000..819b63d9a
--- /dev/null
+++ b/main/open-vm-tools-grsec/kernel.patch
@@ -0,0 +1,364 @@
+From 34503f06e284eed7be41801bc6f1dbe9920ee4b2 Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?D=C4=81vis?= <davispuh@gmail.com>
+Date: Mon, 5 May 2014 22:32:43 +0300
+Subject: [PATCH] Update for changes in latest kernel ~ 3.11
+
+---
+ .../modules/linux/vmblock/linux/control.c | 26 +++++++++++++++++-----
+ open-vm-tools/modules/linux/vmblock/linux/dentry.c | 14 ++++++++++++
+ open-vm-tools/modules/linux/vmblock/linux/file.c | 18 +++++++++++++++
+ open-vm-tools/modules/linux/vmblock/linux/inode.c | 12 ++++++++--
+ open-vm-tools/modules/linux/vmhgfs/inode.c | 15 ++++++++++---
+ open-vm-tools/modules/linux/vmsync/sync.c | 25 ++++++++++++++++++++-
+ 6 files changed, 99 insertions(+), 11 deletions(-)
+
+diff --git a/modules/linux/vmblock/linux/control.c b/modules/linux/vmblock/linux/control.c
+index 79716bd..306f193 100644
+--- a/modules/linux/vmblock/linux/control.c
++++ b/modules/linux/vmblock/linux/control.c
+@@ -208,17 +208,23 @@ SetupProcDevice(void)
+ VMBlockSetProcEntryOwner(controlProcMountpoint);
+
+ /* Create /proc/fs/vmblock/dev */
++#if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 10, 0)
++ controlProcEntry = proc_create(VMBLOCK_CONTROL_DEVNAME, VMBLOCK_CONTROL_MODE, controlProcDirEntry, &ControlFileOps);
++#else
+ controlProcEntry = create_proc_entry(VMBLOCK_CONTROL_DEVNAME,
+ VMBLOCK_CONTROL_MODE,
+ controlProcDirEntry);
+- if (!controlProcEntry) {
++#endif
++ if (controlProcEntry == NULL) {
+ Warning("SetupProcDevice: could not create " VMBLOCK_DEVICE "\n");
+ remove_proc_entry(VMBLOCK_CONTROL_MOUNTPOINT, controlProcDirEntry);
+ remove_proc_entry(VMBLOCK_CONTROL_PROC_DIRNAME, NULL);
+ return -EINVAL;
+ }
+
++#if LINUX_VERSION_CODE < KERNEL_VERSION(3, 10, 0)
+ controlProcEntry->proc_fops = &ControlFileOps;
++#endif
+ return 0;
+ }
+
+@@ -278,22 +284,32 @@ ExecuteBlockOp(const char __user *buf, // IN: buffer with name
+ int (*blockOp)(const char *filename, // IN: block operation
+ const os_blocker_id_t blocker))
+ {
++#if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 7, 0)
++ struct filename *fname;
++#else
++ char *fname;
++#endif
+ char *name;
+ int i;
+ int retval;
+
+- name = getname(buf);
+- if (IS_ERR(name)) {
+- return PTR_ERR(name);
++ fname = getname(buf);
++ if (IS_ERR(fname)) {
++ return PTR_ERR(fname);
+ }
+
++#if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 7, 0)
++ name = (char *)fname->name;
++#else
++ name = fname;
++#endif
+ 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/modules/linux/vmblock/linux/dentry.c b/modules/linux/vmblock/linux/dentry.c
+index 05ea95a..3d43c5e 100644
+--- a/modules/linux/vmblock/linux/dentry.c
++++ b/modules/linux/vmblock/linux/dentry.c
+@@ -32,7 +32,11 @@
+ #include "block.h"
+
+
++#if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 6, 0)
++static int DentryOpRevalidate(struct dentry *dentry, unsigned int flags);
++#else
+ static int DentryOpRevalidate(struct dentry *dentry, struct nameidata *nd);
++#endif
+
+ struct dentry_operations LinkDentryOps = {
+ .d_revalidate = DentryOpRevalidate,
+@@ -58,9 +62,15 @@ struct dentry_operations LinkDentryOps = {
+ *----------------------------------------------------------------------------
+ */
+
++#if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 6, 0)
++static int
++DentryOpRevalidate(struct dentry *dentry, // IN: dentry revalidating
++ unsigned int flags) // IN: lookup flags
++#else
+ static int
+ DentryOpRevalidate(struct dentry *dentry, // IN: dentry revalidating
+ struct nameidata *nd) // IN: lookup flags & intent
++#endif
+ {
+ VMBlockInodeInfo *iinfo;
+ struct nameidata actualNd;
+@@ -101,7 +111,11 @@ DentryOpRevalidate(struct dentry *dentry, // IN: dentry revalidating
+ if (actualDentry &&
+ actualDentry->d_op &&
+ actualDentry->d_op->d_revalidate) {
++#if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 6, 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/modules/linux/vmblock/linux/file.c b/modules/linux/vmblock/linux/file.c
+index d7ac1f6..513f2d5 100644
+--- a/modules/linux/vmblock/linux/file.c
++++ b/modules/linux/vmblock/linux/file.c
+@@ -38,6 +38,7 @@ typedef u64 inode_num_t;
+ typedef ino_t inode_num_t;
+ #endif
+
++#if LINUX_VERSION_CODE < KERNEL_VERSION(3, 11, 0)
+ /* Specifically for our filldir_t callback */
+ typedef struct FilldirInfo {
+ filldir_t filldir;
+@@ -76,6 +77,7 @@ Filldir(void *buf, // IN: Dirent buffer passed from FileOpReaddir
+ /* Specify DT_LNK regardless */
+ return info->filldir(info->dirent, name, namelen, offset, ino, DT_LNK);
+ }
++#endif
+
+
+ /* File operations */
+@@ -164,13 +166,21 @@ FileOpOpen(struct inode *inode, // IN
+ *----------------------------------------------------------------------------
+ */
+
++#if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 11, 0)
++static int
++FileOpIterate(struct file *file, // IN
++ struct dir_context *ctx) // IN
++#else
+ static int
+ FileOpReaddir(struct file *file, // IN
+ void *dirent, // IN
+ filldir_t filldir) // IN
++#endif
+ {
+ int ret;
++#if LINUX_VERSION_CODE < KERNEL_VERSION(3, 11, 0)
+ FilldirInfo info;
++#endif
+ struct file *actualFile;
+
+ if (!file) {
+@@ -184,12 +194,16 @@ FileOpReaddir(struct file *file, // IN
+ return -EINVAL;
+ }
+
++#if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 11, 0)
++ ret = iterate_dir(actualFile, ctx);
++#else
+ info.filldir = filldir;
+ info.dirent = dirent;
+
+ actualFile->f_pos = file->f_pos;
+ ret = vfs_readdir(actualFile, Filldir, &info);
+ file->f_pos = actualFile->f_pos;
++#endif
+
+ return ret;
+ }
+@@ -237,7 +251,11 @@ FileOpRelease(struct inode *inode, // IN
+
+
+ struct file_operations RootFileOps = {
++#if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 11, 0)
++ .iterate = FileOpIterate,
++#else
+ .readdir = FileOpReaddir,
++#endif
+ .open = FileOpOpen,
+ .release = FileOpRelease,
+ };
+diff --git a/modules/linux/vmblock/linux/inode.c b/modules/linux/vmblock/linux/inode.c
+index 098c94c..37dc0fc 100644
+--- a/modules/linux/vmblock/linux/inode.c
++++ b/modules/linux/vmblock/linux/inode.c
+@@ -36,7 +36,11 @@
+
+ /* Inode operations */
+ static struct dentry *InodeOpLookup(struct inode *dir,
++#if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 6, 0)
++ struct dentry *dentry, unsigned int flags);
++#else
+ struct dentry *dentry, struct nameidata *nd);
++#endif
+ 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 +79,11 @@ static struct inode_operations LinkInodeOps = {
+ static struct dentry *
+ InodeOpLookup(struct inode *dir, // IN: parent directory's inode
+ struct dentry *dentry, // IN: dentry to lookup
++#if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 6, 0)
++ unsigned int flags) // IN: lookup flags
++#else
+ struct nameidata *nd) // IN: lookup intent and information
++#endif
+ {
+ char *filename;
+ struct inode *inode;
+@@ -206,7 +214,7 @@ static int
+ InodeOpFollowlink(struct dentry *dentry, // IN : dentry of symlink
+ struct nameidata *nd) // OUT: stores result
+ {
+- int ret;
++ int ret = 0;
+ VMBlockInodeInfo *iinfo;
+
+ if (!dentry) {
+@@ -221,7 +229,7 @@ InodeOpFollowlink(struct dentry *dentry, // IN : dentry of symlink
+ 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)
+diff --git a/modules/linux/vmhgfs/inode.c b/modules/linux/vmhgfs/inode.c
+index 2999b94..f82a57b 100644
+--- a/modules/linux/vmhgfs/inode.c
++++ b/modules/linux/vmhgfs/inode.c
+@@ -31,6 +31,9 @@
+ #include <linux/namei.h>
+ #endif
+ #include <linux/highmem.h>
++#if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 11, 0)
++#include <linux/dcache.h>
++#endif
+
+ #include "compat_cred.h"
+ #include "compat_fs.h"
+@@ -1890,7 +1893,11 @@ HgfsPermission(struct inode *inode,
+ #endif
+ &inode->i_dentry,
+ d_alias) {
++#if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 11, 0)
++ int dcount = d_count(dentry);
++#else
+ int dcount = dentry->d_count;
++#endif
+ if (dcount) {
+ LOG(4, ("Found %s %d \n", dentry->d_name.name, dcount));
+ return HgfsAccessInt(dentry, mask & (MAY_READ | MAY_WRITE | MAY_EXEC));
+@@ -1943,10 +1950,12 @@ HgfsPermission(struct inode *inode,
+ list_for_each(pos, &inode->i_dentry) {
+ int dcount;
+ struct dentry *dentry = list_entry(pos, struct dentry, d_alias);
+-#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 38)
+- dcount = atomic_read(&dentry->d_count);
+-#else
++#if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 11, 0)
++ dcount = d_count(dentry);
++#elif LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 38)
+ dcount = dentry->d_count;
++#else
++ dcount = atomic_read(&dentry->d_count);
+ #endif
+ if (dcount) {
+ LOG(4, ("Found %s %d \n", (dentry)->d_name.name, dcount));
+diff --git a/modules/linux/vmsync/sync.c b/modules/linux/vmsync/sync.c
+index d05ccad..1869771 100644
+--- a/modules/linux/vmsync/sync.c
++++ b/modules/linux/vmsync/sync.c
+@@ -162,7 +162,11 @@ VmSyncThawDevices(void *_state) // IN
+ cancel_delayed_work(&state->thawTask);
+ list_for_each_safe(cur, tmp, &state->devices) {
+ dev = list_entry(cur, VmSyncBlockDevice, list);
++#if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 6, 0)
++ if (dev->sb != NULL && dev->sb->s_writers.frozen != SB_UNFROZEN) {
++#else
+ if (dev->sb != NULL && dev->sb->s_frozen != SB_UNFROZEN) {
++#endif
+ thaw_bdev(dev->bdev, dev->sb);
+ atomic_dec(&gFreezeCount);
+ }
+@@ -237,7 +241,11 @@ VmSyncAddPath(const VmSyncState *state, // IN
+ * the superblock is already frozen.
+ */
+ if (inode->i_sb->s_bdev == NULL ||
++#if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 6, 0)
++ inode->i_sb->s_writers.frozen != SB_UNFROZEN) {
++#else
+ inode->i_sb->s_frozen != SB_UNFROZEN) {
++#endif
+ result = (inode->i_sb->s_bdev == NULL) ? -EINVAL : -EALREADY;
+ compat_path_release(&nd);
+ goto exit;
+@@ -303,7 +311,11 @@ VmSyncFreezeDevices(VmSyncState *state, // IN
+ const char __user *userPaths) // IN
+ {
+ int result = 0;
++#if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 7, 0)
++ struct filename *paths;
++#else
+ char *paths;
++#endif
+ char *currPath;
+ char *nextSep;
+ struct list_head *cur, *tmp;
+@@ -328,7 +340,11 @@ VmSyncFreezeDevices(VmSyncState *state, // IN
+ /*
+ * First, try to add all paths to the list of paths to be frozen.
+ */
++#if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 7, 0)
++ currPath = (char *)paths->name;
++#else
+ currPath = paths;
++#endif
+ do {
+ nextSep = strchr(currPath, ':');
+ if (nextSep != NULL) {
+@@ -670,17 +686,24 @@ init_module(void)
+ }
+
+ /* Create /proc/driver/vmware-sync */
++#if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 10, 0)
++ controlProcEntry = proc_create("driver/vmware-sync", S_IFREG | S_IRUSR | S_IRGRP | S_IROTH,
++ NULL, &VmSyncFileOps);
++#else
+ controlProcEntry = create_proc_entry("driver/vmware-sync",
+ S_IFREG | S_IRUSR | S_IRGRP | S_IROTH,
+ NULL);
+- if (!controlProcEntry) {
++#endif
++ if (controlProcEntry == NULL) {
+ printk(KERN_ERR "vmsync: could not create /proc/driver/vmware-sync\n");
+ kmem_cache_destroy(gSyncStateCache);
+ kmem_cache_destroy(gBlockDeviceCache);
+ return -EINVAL;
+ }
+
++#if LINUX_VERSION_CODE < KERNEL_VERSION(3, 10, 0)
+ controlProcEntry->proc_fops = &VmSyncFileOps;
++#endif
+ return 0;
+ }
+
+--
+1.9.1
+
diff --git a/main/open-vm-tools-grsec/putname.patch b/main/open-vm-tools-grsec/putname.patch
deleted file mode 100644
index b605e12fa..000000000
--- a/main/open-vm-tools-grsec/putname.patch
+++ /dev/null
@@ -1,13 +0,0 @@
-diff --git a/modules/linux/vmblock/linux/control.c b/modules/linux/vmblock/linux/control.c
-index 79716bd..2dd83fe 100644
---- a/modules/linux/vmblock/linux/control.c
-+++ b/modules/linux/vmblock/linux/control.c
-@@ -293,7 +293,7 @@ ExecuteBlockOp(const char __user *buf, // IN: buffer with name
-
- retval = i < 0 ? -EINVAL : blockOp(name, blocker);
-
-- putname(name);
-+ __putname(name);
-
- return retval;
- }