summaryrefslogtreecommitdiffstats
path: root/main/open-vm-tools-grsec/vmci_driver_c.patch
blob: 67faea551340eba1a14091339af1f296e8699030 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
diff -Naur open-vm-tools-2011.09.23-491607-before/modules/linux/vmci/linux/driver.c open-vm-tools-2011.09.23-491607-after/modules/linux/vmci/linux/driver.c
--- open-vm-tools-2011.09.23-491607-before/modules/linux/vmci/linux/driver.c	2011-09-26 15:16:30.000000000 -0500
+++ open-vm-tools-2011.09.23-491607-after/modules/linux/vmci/linux/driver.c	2011-10-13 15:13:19.266661488 -0500
@@ -241,7 +241,24 @@
 #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 @@
       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;