Pastebin launched a little side project called VERYVIRAL.com, check it out ;-) Want more features on Pastebin? Sign Up, it's FREE!
Guest

Untitled

By: a guest on May 9th, 2010  |  syntax: None  |  size: 14.60 KB  |  views: 224  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. diff -rupN orig/vmnet-only/driver-config.h patched/vmnet-only/driver-config.h
  2. --- orig/vmnet-only/driver-config.h     2009-10-21 03:43:26.000000000 +0200
  3. +++ patched/vmnet-only/driver-config.h   2010-05-09 10:34:11.556430370 +0200
  4. @@ -32,7 +32,7 @@
  5.  #define INCLUDE_ALLOW_VMNIXMOD
  6.  #include "includeCheck.h"
  7.  
  8. -#include <linux/autoconf.h>
  9. +//#include <linux/autoconf.h>
  10.  #include "compat_version.h"
  11.  
  12.  /*
  13. diff -rupN orig/vmmon-only/include/driver-config.h patched/vmmon-only/include/driver-config.h
  14. --- orig/vmmon-only/include/driver-config.h     2009-10-21 03:43:25.000000000 +0200
  15. +++ patched/vmmon-only/include/driver-config.h   2010-05-09 10:33:07.015055213 +0200
  16. @@ -32,7 +32,7 @@
  17.  #define INCLUDE_ALLOW_VMNIXMOD
  18.  #include "includeCheck.h"
  19.  
  20. -#include <linux/autoconf.h>
  21. +//#include <linux/autoconf.h>
  22.  #include "compat_version.h"
  23.  
  24.  /*
  25. diff -rupN orig/vsock-only/include/driver-config.h patched/vsock-only/include/driver-config.h
  26. --- orig/vsock-only/include/driver-config.h     2009-10-21 03:43:28.000000000 +0200
  27. +++ patched/vsock-only/include/driver-config.h   2010-05-09 10:28:17.093067269 +0200
  28. @@ -32,7 +32,7 @@
  29.  #define INCLUDE_ALLOW_VMNIXMOD
  30.  #include "includeCheck.h"
  31.  
  32. -#include <linux/autoconf.h>
  33. +//#include <linux/autoconf.h>
  34.  #include "compat_version.h"
  35.  
  36.  /*
  37. diff -rupN orig/vmci-only/include/driver-config.h patched/vmci-only/include/driver-config.h
  38. --- orig/vmci-only/include/driver-config.h     2009-10-21 03:43:27.000000000 +0200
  39. +++ patched/vmci-only/include/driver-config.h        2010-05-09 10:11:35.172403415 +0200
  40. @@ -32,7 +32,7 @@
  41.  #define INCLUDE_ALLOW_VMNIXMOD
  42.  #include "includeCheck.h"
  43.  
  44. -#include <linux/autoconf.h>
  45. +//#include <linux/autoconf.h>
  46.  #include "compat_version.h"
  47.  
  48.  /*
  49. diff -rupN orig/vmci-only/include/compat_wait.h patched/vmci-only/include/compat_wait.h
  50. --- orig/vmci-only/include/compat_wait.h        2009-03-27 07:17:11.000000000 +0000
  51. +++ patched/vmci-only/include/compat_wait.h     2009-10-14 11:39:57.199696858 +0000
  52. @@ -75,7 +75,11 @@ extern void poll_initwait(compat_poll_wq
  53.  #elif LINUX_VERSION_CODE >= KERNEL_VERSION(2, 4, 0) // {
  54.  
  55.  /* If prototype does not match, build will abort here */
  56. +#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 29)
  57.  extern void poll_initwait(compat_poll_wqueues *);
  58. +#else
  59. +extern void poll_initwait(struct poll_wqueues *pwq);
  60. +#endif
  61.  
  62.  #define compat_poll_initwait(wait, table) ( \
  63.     (wait) = (table), \
  64. diff -rupN orig/vmci-only/linux/vmciKernelIf.c patched/vmci-only/linux/vmciKernelIf.c
  65. --- orig/vmci-only/linux/vmciKernelIf.c 2009-03-27 07:17:11.000000000 +0000
  66. +++ patched/vmci-only/linux/vmciKernelIf.c      2009-10-14 11:45:36.273704758 +0000
  67. @@ -34,6 +34,7 @@
  68.  #define EXPORT_SYMTAB
  69.  #define __NO_VERSION__
  70.  #include "compat_module.h"
  71. +#include "compat_sched.h"
  72.  
  73.  #include "compat_version.h"
  74.  #include "compat_wait.h"
  75. diff -rupN orig/vmmon-only/include/compat_wait.h patched/vmmon-only/include/compat_wait.h
  76. --- orig/vmmon-only/include/compat_wait.h       2009-03-27 07:17:09.000000000 +0000
  77. +++ patched/vmmon-only/include/compat_wait.h    2009-10-14 11:52:31.841571827 +0000
  78. @@ -75,7 +75,11 @@ extern void poll_initwait(compat_poll_wq
  79.  #elif LINUX_VERSION_CODE >= KERNEL_VERSION(2, 4, 0) // {
  80.  
  81.  /* If prototype does not match, build will abort here */
  82. +#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 29)
  83.  extern void poll_initwait(compat_poll_wqueues *);
  84. +#else
  85. +extern void poll_initwait(struct poll_wqueues *pwq);
  86. +#endif
  87.  
  88.  #define compat_poll_initwait(wait, table) ( \
  89.     (wait) = (table), \
  90. diff -rupN orig/vmmon-only/linux/driver.c patched/vmmon-only/linux/driver.c
  91. --- orig/vmmon-only/linux/driver.c      2009-03-27 07:17:09.000000000 +0000
  92. +++ patched/vmmon-only/linux/driver.c   2009-10-14 11:55:35.289574574 +0000
  93. @@ -1984,10 +1984,17 @@ pageLockEnd:
  94.     }
  95.  
  96.     case IOCTL_VMX86_ALLOW_CORE_DUMP:
  97. -      if (current->euid == current->uid &&
  98. -         current->fsuid == current->uid &&
  99. -          current->egid == current->gid &&
  100. -         current->fsgid == current->gid) {
  101. +#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 29)
  102. +       if (current->euid == current->uid &&
  103. +       current->fsuid == current->uid &&
  104. +       current->egid == current->gid &&
  105. +       current->fsgid == current->gid) {
  106. +#else /* 2.6.29 and higher */
  107. +      if (current->cred->euid == current->cred->uid &&
  108. +          current->cred->fsuid == current->cred->uid &&
  109. +          current->cred->egid == current->cred->gid &&
  110. +          current->cred->fsgid == current->cred->gid) {
  111. +#endif /* 2.6.29 check */
  112.  #if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 23) || defined(MMF_DUMPABLE)
  113.           /* Dump core, readable by user. */
  114.           set_bit(MMF_DUMPABLE, &current->mm->flags);
  115. diff -rupN orig/vmmon-only/linux/hostif.c patched/vmmon-only/linux/hostif.c
  116. --- orig/vmmon-only/linux/hostif.c      2009-03-27 07:17:08.000000000 +0000
  117. +++ patched/vmmon-only/linux/hostif.c   2009-10-14 11:52:31.846571625 +0000
  118. @@ -2719,13 +2719,22 @@ HostIF_SemaphoreWait(VMDriver *vm,
  119.     set_fs(get_ds());
  120.  
  121.     {
  122. +#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 29)
  123.        compat_poll_wqueues table;
  124.        poll_table *wait;
  125. +#else /* 2.6.29 and above */
  126. +      struct poll_wqueues table;
  127. +      struct poll_wqueues *wait;
  128. +#endif /* 2.6.29 and above */
  129.        unsigned int mask;
  130.        
  131.        compat_poll_initwait(wait, &table);
  132.        current->state = TASK_INTERRUPTIBLE;
  133. +#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 29)
  134.        mask = file->f_op->poll(file, wait);
  135. +#else
  136. +      mask = file->f_op->poll(file, (poll_table *) wait);
  137. +#endif /* 2.6.29 */
  138.        if (!(mask & (POLLIN | POLLERR | POLLHUP))) {
  139.  #ifdef KERNEL_2_4_0
  140.          vm->vmhost->vcpuSemaTask[vcpuid] = current;
  141. @@ -2744,7 +2753,6 @@ HostIF_SemaphoreWait(VMDriver *vm,
  142.     }
  143.  
  144.     res = file->f_op->read(file, &ch, 1, &file->f_pos);
  145. -
  146.     set_fs(old_fs);
  147.     compat_fput(file);
  148.  
  149. @@ -3456,8 +3464,13 @@ HostIFFastClockThread(void *data)  // IN
  150.     oldFS = get_fs();
  151.     set_fs(KERNEL_DS);
  152.     compat_allow_signal(SIGKILL);
  153. +#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 29)
  154.     cap_raise(current->cap_effective, CAP_SYS_RESOURCE);
  155.     compat_set_user_nice(current, linuxState.fastClockPriority);
  156. +#else /* 2.6.29 */
  157. +   (void) cap_raised(current->cred->cap_effective, CAP_SYS_RESOURCE);
  158. +   set_user_nice(current, linuxState.fastClockPriority);
  159. +#endif /* 2.6.29 and higher */  
  160.  
  161.     while (linuxState.fastClockRate > HZ + HZ/16) {
  162.        unsigned long buf;
  163. @@ -3580,19 +3593,38 @@ HostIF_SetFastClockRate(unsigned int rat
  164.           Bool cap;
  165.           long pid;
  166.  
  167. +#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 29)
  168.           fsuid = current->fsuid;
  169.           current->fsuid = 0;
  170. +#else
  171. +     fsuid = current->cred->fsuid;
  172. +#warning     current->cred->fsuid = 0;
  173. +#endif /* 2.6.29 */
  174.           filp = filp_open("/dev/rtc", O_RDONLY, 0);
  175. +
  176. +#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 29)
  177.           current->fsuid = fsuid;
  178. +#else
  179. +#warning     current->cred->fsuid = fsuid;
  180. +#endif /* 2.6.29 */
  181.           if (IS_ERR(filp)) {
  182.              Warning("/dev/rtc open failed: %d\n", (int)(VA)filp);
  183.              return -(int)(VA)filp;
  184.           }
  185. +#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 29)
  186.           cap = cap_raised(current->cap_effective, CAP_SYS_RESOURCE);
  187.           cap_raise(current->cap_effective, CAP_SYS_RESOURCE);
  188. +#else /* 2.6.29 */
  189. +         cap = cap_raised(current->cred->cap_effective, CAP_SYS_RESOURCE);
  190. +         (void) cap_raised(current->cred->cap_effective, CAP_SYS_RESOURCE);
  191. +#endif /* 2.6.29 */
  192.           res = HostIFDoIoctl(filp, RTC_PIE_ON, 0);
  193.           if (!cap) {
  194. -            cap_lower(current->cap_effective, CAP_SYS_RESOURCE);            
  195. +#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 29)
  196. +            cap_lower(current->cap_effective, CAP_SYS_RESOURCE);
  197. +#else
  198. +#warning        cap_lower(current->cred->cap_effective, CAP_SYS_RESOURCE);
  199. +#endif /* 2.6.29 */        
  200.           }
  201.           if (res < 0) {
  202.              Warning("/dev/rtc enable interrupt failed: %d\n", res);
  203. diff -rupN orig/vmmon-only/linux/vmmonInt.h patched/vmmon-only/linux/vmmonInt.h
  204. --- orig/vmmon-only/linux/vmmonInt.h    2009-03-27 07:17:08.000000000 +0000
  205. +++ patched/vmmon-only/linux/vmmonInt.h 2009-10-14 11:52:31.846571625 +0000
  206. @@ -46,7 +46,10 @@
  207.  #endif
  208.  
  209.  #if defined(CONFIG_SMP) && LINUX_VERSION_CODE >= KERNEL_VERSION(2, 2, 8)
  210. -#ifdef VMW_HAVE_SMP_CALL_3ARG
  211. +#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 29)
  212. +#define VMW_HAVE_SMP_CALL_3ARG
  213. +#endif
  214. +#ifdef VMW_HAVE_SMP_CALL_3ARG
  215.  #define compat_smp_call_function(fn, info, wait) smp_call_function(fn, info, wait)
  216.  #else
  217.  #define compat_smp_call_function(fn, info, wait) smp_call_function(fn, info, 1, wait)
  218. diff -rupN orig/vmnet-only/bridge.c patched/vmnet-only/bridge.c
  219. --- orig/vmnet-only/bridge.c    2009-03-27 07:17:10.000000000 +0000
  220. +++ patched/vmnet-only/bridge.c 2009-10-14 11:58:27.712572979 +0000
  221. @@ -646,7 +646,11 @@ VNetBridgeReceiveFromVNet(VNetJack      
  222.          dev_unlock_list();
  223.        } else {
  224.          struct sock *sk = bridge->sk;
  225. -        atomic_add(skb->truesize, &sk->sk_wmem_alloc);
  226. +#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 29)
  227. +      atomic_add(skb->truesize, &sk->sk_wmem_alloc);
  228. +#else
  229. +#warning EHUD gotta figure out what this does and how to fix it: atomic_add(skb->truesize, &sk->sk_wmem_alloc);
  230. +#endif /* 2.6.29 */;
  231.          clone->sk = sk;
  232.          clone->protocol = ((struct ethhdr *)skb->data)->h_proto; // XXX
  233.          if ((dev->flags & IFF_UP) != 0) {
  234. diff -rupN orig/vmnet-only/compat_wait.h patched/vmnet-only/compat_wait.h
  235. --- orig/vmnet-only/compat_wait.h       2009-03-27 07:17:10.000000000 +0000
  236. +++ patched/vmnet-only/compat_wait.h    2009-10-14 11:52:31.847572660 +0000
  237. @@ -75,7 +75,11 @@ extern void poll_initwait(compat_poll_wq
  238.  #elif LINUX_VERSION_CODE >= KERNEL_VERSION(2, 4, 0) // {
  239.  
  240.  /* If prototype does not match, build will abort here */
  241. +#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 29)
  242.  extern void poll_initwait(compat_poll_wqueues *);
  243. +#else /* 2.6.29 */
  244. +extern void poll_initwait(struct poll_wqueues *);
  245. +#endif /* 2.6.29 */
  246.  
  247.  #define compat_poll_initwait(wait, table) ( \
  248.     (wait) = (table), \
  249. diff -rupN orig/vmnet-only/driver.c patched/vmnet-only/driver.c
  250. --- orig/vmnet-only/driver.c    2009-03-27 07:17:10.000000000 +0000
  251. +++ patched/vmnet-only/driver.c 2009-10-14 11:52:31.848572228 +0000
  252. @@ -146,6 +146,13 @@ struct proto vmnet_proto = {
  253.     .owner    = THIS_MODULE,
  254.     .obj_size = sizeof(struct sock),
  255.  };
  256. +#elif LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 29)
  257. +struct proto vmnet_proto = {
  258. +   .name     = "VMNET",
  259. +   .owner    = THIS_MODULE,
  260. +   .obj_size = sizeof(struct sock),
  261. +};
  262. +
  263.  #endif
  264.  
  265.  /*
  266. diff -rupN orig/vmnet-only/netif.c patched/vmnet-only/netif.c
  267. --- orig/vmnet-only/netif.c     2009-03-27 07:17:10.000000000 +0000
  268. +++ patched/vmnet-only/netif.c  2009-10-14 12:16:46.708698049 +0000
  269. @@ -194,10 +194,27 @@ VNetNetifTxTimeout(struct net_device *de
  270.   *----------------------------------------------------------------------
  271.   */
  272.  
  273. +#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 31)
  274. +
  275. +static const struct net_device_ops vnet_netdev_ops = {
  276. +
  277. +   .ndo_init = VNetNetifProbe,
  278. +   .ndo_open = VNetNetifOpen,
  279. +   .ndo_start_xmit = VNetNetifStartXmit,
  280. +   .ndo_stop = VNetNetifClose,
  281. +   .ndo_get_stats = VNetNetifGetStats,
  282. +   .ndo_set_mac_address = VNetNetifSetMAC,
  283. +   .ndo_set_multicast_list = VNetNetifSetMulticast,
  284. +};
  285. +#endif
  286. +
  287.  static void
  288.  VNetNetIfSetup(struct net_device *dev)  // IN:
  289.  {
  290.     ether_setup(dev); // turns on IFF_BROADCAST, IFF_MULTICAST
  291. +#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 31)
  292. +   dev->netdev_ops = &vnet_netdev_ops;
  293. +#else
  294.     dev->init = VNetNetifProbe;
  295.     dev->open = VNetNetifOpen;
  296.     dev->hard_start_xmit = VNetNetifStartXmit;
  297. @@ -205,7 +222,7 @@ VNetNetIfSetup(struct net_device *dev)  
  298.     dev->get_stats = VNetNetifGetStats;
  299.     dev->set_mac_address = VNetNetifSetMAC;
  300.     dev->set_multicast_list = VNetNetifSetMulticast;
  301. -#ifdef KERNEL_2_3_43
  302. +#endif
  303.     /*
  304.      * We cannot stuck... If someone will report problems under
  305.      * low memory conditions or some such, we should enable it.
  306. @@ -214,7 +231,6 @@ VNetNetIfSetup(struct net_device *dev)  
  307.     dev->tx_timeout = VNetNetifTxTimeout;
  308.     dev->watchdog_timeo = TX_TIMEOUT;
  309.  #endif
  310. -#endif  
  311.  }
  312.  
  313.  
  314. @@ -324,7 +340,10 @@ VNetNetIf_Create(char *devName,  // IN:
  315.        goto out;
  316.     }
  317.  
  318. +#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 29)
  319.     dev->priv = netIf;
  320. +#endif /* 2.6.29 */
  321. +
  322.     netIf->dev = dev;
  323.    
  324.     memcpy(dev->dev_addr, netIf->port.paddr, sizeof netIf->port.paddr);
  325. @@ -566,7 +585,11 @@ int
  326.  VNetNetifStartXmit(struct sk_buff    *skb, // IN:
  327.                     struct net_device *dev) // IN:
  328.  {
  329. +#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 29)
  330.     VNetNetIF *netIf = (VNetNetIF*)dev->priv;
  331. +#else
  332. +   VNetNetIF *netIf = netdev_priv(dev);
  333. +#endif /* 2.6.29 */
  334.  
  335.     if(skb == NULL) {
  336.        return 0;
  337. @@ -618,7 +641,12 @@ int
  338.  VNetNetifSetMAC(struct net_device *dev, // IN:
  339.                  void *p)                // IN:
  340.  {
  341. +#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 29)
  342.     VNetNetIF *netIf = (VNetNetIF*)dev->priv;
  343. +#else
  344. +   VNetNetIF *netIf = netdev_priv(dev);
  345. +#endif /* 2.6.29 */
  346. +
  347.     struct sockaddr const *addr = p;
  348.     if (!VMX86_IS_STATIC_MAC(addr->sa_data)) {
  349.        return -EINVAL;
  350. @@ -675,7 +703,11 @@ VNetNetifSetMulticast(struct net_device
  351.  struct net_device_stats *
  352.  VNetNetifGetStats(struct net_device *dev) // IN:
  353.  {
  354. +#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 29)
  355.     VNetNetIF *netIf = (VNetNetIF*)dev->priv;
  356. +#else
  357. +   VNetNetIF *netIf = netdev_priv(dev);
  358. +#endif /* 2.6.29 */
  359.     return &(netIf->stats);
  360.  }
  361.  
  362. diff -rupN orig/vmnet-only/vnetUserListener.c patched/vmnet-only/vnetUserListener.c
  363. --- orig/vmnet-only/vnetUserListener.c  2009-03-27 07:17:10.000000000 +0000
  364. +++ patched/vmnet-only/vnetUserListener.c       2009-10-14 12:17:34.862572106 +0000
  365. @@ -33,6 +33,7 @@
  366.  #include <linux/poll.h>
  367.  #include "compat_skbuff.h"
  368.  #include "compat_wait.h"
  369. +#include "compat_sched.h"
  370.  #include "vnetInt.h"
  371.  
  372.  typedef struct VNetUserListener_EventNode VNetUserListener_EventNode;
  373. diff -rupN orig/vsock-only/include/compat_wait.h patched/vsock-only/include/compat_wait.h
  374. --- orig/vsock-only/include/compat_wait.h       2009-03-27 07:17:12.000000000 +0000
  375. +++ patched/vsock-only/include/compat_wait.h    2009-10-14 12:23:08.205572121 +0000
  376. @@ -75,7 +75,11 @@ extern void poll_initwait(compat_poll_wq
  377.  #elif LINUX_VERSION_CODE >= KERNEL_VERSION(2, 4, 0) // {
  378.  
  379.  /* If prototype does not match, build will abort here */
  380. +#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 29)
  381.  extern void poll_initwait(compat_poll_wqueues *);
  382. +#else
  383. +extern void poll_initwait(struct poll_wqueues *pwq);
  384. +#endif
  385.  
  386.  #define compat_poll_initwait(wait, table) ( \
  387.     (wait) = (table), \