VMware – Updated vmnet Patch for Kernel 4.9/4.10..
Thanks to Mikkel Kroman, there is a more complete patch for VMware 12.5.2 vmnet on Kernel 4.9.x and 4.10-rc’s:
The change is to the get_user_pages parameter list, to now include the FOLL_WRITE parameter, and is as follows:
In vmnet-only/userif.c, around line 113, change
#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 6, 0) retval = get_user_pages(addr, 1, 1, 0, &page, NULL); #else retval = get_user_pages(current, current->mm, addr, 1, 1, 0, &page, NULL); #endif
to
#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 9, 0) retval = get_user_pages(addr, 1, FOLL_WRITE, &page, NULL); #else #if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 6, 0) retval = get_user_pages(addr, 1, 1, 0, &page, NULL); #else retval = get_user_pages(current, current->mm, addr, 1, 1, 0, &page, NULL); #endif #endif
VMware had been working OK on my system with the original version of the patch, and I have applied this new version of the patch, and it all works correctly..
Robert Gadsdon. January 31, 2017.
While it compiles and works seemingly normal it still produces kernel panics in vmnet under more complex scenarios.
I haven’t seen any of that, but – of course – my use may not be very ‘complex’ (mostly Win7/Photoshop..)..
RG
You might try to trigger that by enabling USB tethering on a connected phone while VMs are running. Other scenarios I encountered involved Kubernetes cluster (non-tainted).
I made a small script that fixes the vmware / vmmon failed bug based on your patch: https://bugfixes.promisedev.com/
Direct download link – https://bugfixes.promisedev.com/download/patches/vmwkp4.9.tar
md5 of vmwkp4.9.tar [9e6040716b3001912147e23a10c4c596]
Hope you don’t mind, credit goes to your name.
Mentioned it in your other threads as well. (If you consider any of the links I posted spam kindly let me know)
d7x
Thanks, man! You are the best!
@Plamen Dimitrov Thank you for your script! Made the process painless and easy! Also worked around a GCC issue I’ve been having. All the best!
Hi, nice work, I’d just like to add the following change to vmmon as well:
Change the following around line 1166 in linux/hostif.c:
#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 9, 0)
retval = get_user_pages((unsigned long)uvAddr, numPages, 0, ppages, NULL);
#else
#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 6, 0)
retval = get_user_pages((unsigned long)uvAddr, numPages, 0, 0, ppages, NULL);
#else
retval = get_user_pages(current, current->mm, (unsigned long)uvAddr,
numPages, 0, 0, ppages, NULL);
#endif
#endif
And it will also build against 4.10!
I can confirm that enabling USB tethering on a connected phone while VMs are running crashes the kernel with a panic. VMWARE workstation 12.5.5 Kernel 4.10.8 🙁
thanks @Plamen Dimitrov your script worked flawesly with:
– VMware Workstation 12.5.2 build-4638234
– linux-image-virtual-hwe-16.04 4.10.0.27.30 amd64
– Ubuntu 16.04.2 LTS
Anyone have tried with for Kali-4.9.0 ?