Gentoo Archives: gentoo-commits

From: "Magnus Granberg (zorry)" <zorry@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] gentoo-x86 commit in app-emulation/vmware-modules/files: 279-hardened.patch
Date: Sat, 23 Nov 2013 14:05:09
Message-Id: 20131123140504.3689C20005@flycatcher.gentoo.org
1 zorry 13/11/23 14:05:04
2
3 Added: 279-hardened.patch
4 Log:
5 Update hardened patch for 279 #491342
6
7 (Portage version: 2.2.7/cvs/Linux x86_64, signed Manifest commit with key FD79807F)
8
9 Revision Changes Path
10 1.1 app-emulation/vmware-modules/files/279-hardened.patch
11
12 file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/app-emulation/vmware-modules/files/279-hardened.patch?rev=1.1&view=markup
13 plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/app-emulation/vmware-modules/files/279-hardened.patch?rev=1.1&content-type=text/plain
14
15 Index: 279-hardened.patch
16 ===================================================================
17 diff --git a/vmmon-only/linux/driver.c b/vmmon-only/linux/driver.c
18 index b21dd44..960c2aa 100644
19 --- a/vmmon-only/linux/driver.c
20 +++ b/vmmon-only/linux/driver.c
21 @@ -178,7 +178,22 @@ static struct vm_operations_struct vmuser_mops = {
22 #endif
23 };
24
25 -static struct file_operations vmuser_fops;
26 +static struct file_operations vmuser_fops = {
27 + .owner = THIS_MODULE,
28 + .poll = LinuxDriverPoll,
29 +#ifdef HAVE_UNLOCKED_IOCTL
30 + .unlocked_ioctl = LinuxDriver_UnlockedIoctl,
31 +#else
32 + .ioctl = LinuxDriver_Ioctl,
33 +#endif
34 +#ifdef HAVE_COMPAT_IOCTL
35 + .compat_ioctl = LinuxDriver_UnlockedIoctl,
36 +#endif
37 + .open = LinuxDriver_Open,
38 + .release = LinuxDriver_Close,
39 + .mmap = LinuxDriverMmap
40 +};
41 +
42 static struct timer_list tscTimer;
43
44 /*
45 @@ -357,27 +372,6 @@ init_module(void)
46 spin_lock_init(&linuxState.pollListLock);
47 #endif
48
49 - /*
50 - * Initialize the file_operations structure. Because this code is always
51 - * compiled as a module, this is fine to do it here and not in a static
52 - * initializer.
53 - */
54 -
55 - memset(&vmuser_fops, 0, sizeof vmuser_fops);
56 - vmuser_fops.owner = THIS_MODULE;
57 - vmuser_fops.poll = LinuxDriverPoll;
58 -#ifdef HAVE_UNLOCKED_IOCTL
59 - vmuser_fops.unlocked_ioctl = LinuxDriver_UnlockedIoctl;
60 -#else
61 - vmuser_fops.ioctl = LinuxDriver_Ioctl;
62 -#endif
63 -#ifdef HAVE_COMPAT_IOCTL
64 - vmuser_fops.compat_ioctl = LinuxDriver_UnlockedIoctl;
65 -#endif
66 - vmuser_fops.open = LinuxDriver_Open;
67 - vmuser_fops.release = LinuxDriver_Close;
68 - vmuser_fops.mmap = LinuxDriverMmap;
69 -
70 #ifdef VMX86_DEVEL
71 devel_init_module();
72 linuxState.minor = 0;
73 diff --git a/vmnet-only/driver.c b/vmnet-only/driver.c
74 index b12b982..40bd4cf 100644
75 --- a/vmnet-only/driver.c
76 +++ b/vmnet-only/driver.c
77 @@ -165,7 +165,22 @@ static long VNetFileOpUnlockedIoctl(struct file * filp,
78 unsigned int iocmd, unsigned long ioarg);
79 #endif
80
81 -static struct file_operations vnetFileOps;
82 +static struct file_operations vnetFileOps = {
83 + .owner = THIS_MODULE,
84 + .read = VNetFileOpRead,
85 + .write = VNetFileOpWrite,
86 + .poll = VNetFileOpPoll,
87 +#ifdef HAVE_UNLOCKED_IOCTL
88 + .unlocked_ioctl = VNetFileOpUnlockedIoctl,
89 +#else
90 + .ioctl = VNetFileOpIoctl,
91 +#endif
92 +#ifdef HAVE_COMPAT_IOCTL
93 + .compat_ioctl = VNetFileOpUnlockedIoctl,
94 +#endif
95 + .open = VNetFileOpOpen,
96 + .release = VNetFileOpClose
97 +};
98
99 /*
100 * Utility functions
101 @@ -476,28 +491,6 @@ init_module(void)
102 goto err_proto;
103 }
104
105 - /*
106 - * Initialize the file_operations structure. Because this code is always
107 - * compiled as a module, this is fine to do it here and not in a static
108 - * initializer.
109 - */
110 -
111 - memset(&vnetFileOps, 0, sizeof vnetFileOps);
112 - vnetFileOps.owner = THIS_MODULE;
113 - vnetFileOps.read = VNetFileOpRead;
114 - vnetFileOps.write = VNetFileOpWrite;
115 - vnetFileOps.poll = VNetFileOpPoll;
116 -#ifdef HAVE_UNLOCKED_IOCTL
117 - vnetFileOps.unlocked_ioctl = VNetFileOpUnlockedIoctl;
118 -#else
119 - vnetFileOps.ioctl = VNetFileOpIoctl;
120 -#endif
121 -#ifdef HAVE_COMPAT_IOCTL
122 - vnetFileOps.compat_ioctl = VNetFileOpUnlockedIoctl;
123 -#endif
124 - vnetFileOps.open = VNetFileOpOpen;
125 - vnetFileOps.release = VNetFileOpClose;
126 -
127 retval = register_chrdev(VNET_MAJOR_NUMBER, "vmnet", &vnetFileOps);
128 if (retval) {
129 LOG(0, (KERN_NOTICE "/dev/vmnet: could not register major device %d\n",