Skip to content

Instantly share code, notes, and snippets.

View stuartgillibrand's full-sized avatar

stuartgillibrand

View GitHub Profile
@stuartgillibrand
stuartgillibrand / .patch
Last active April 7, 2020 01:06
VMware workstation (12.5.9) vmci (vmci-only) patches for kernel 5 (specifically 5.0.0-1035-azure which doesn't have VMCI compiled in by default)
nf@dev2:/usr/lib/vmware/modules/source$ diff -ru vmci-only vmci-only.mod
Only in vmci-only.mod: .driverLog.o.cmd
Only in vmci-only.mod: .tmp_versions
Only in vmci-only.mod: .vmci.ko.cmd
Only in vmci-only.mod: .vmci.mod.o.cmd
Only in vmci-only.mod: .vmci.o.cmd
Only in vmci-only.mod: Module.symvers
Only in vmci-only.mod/common: .vmciContext.o.cmd
Only in vmci-only.mod/common: .vmciDatagram.o.cmd
Only in vmci-only.mod/common: .vmciDoorbell.o.cmd
@stuartgillibrand
stuartgillibrand / .patch
Last active April 6, 2020 23:22
VMware workstation (12.5.9) vmblock (vmblock-only) patches for kernel 5 (specifically 5.0.0-1035-azure)
nf@dev2:/usr/lib/vmware/modules/source$ diff -ru vmblock-only vmblock-only.mod
Only in vmblock-only.mod: .tmp_versions
Only in vmblock-only.mod: .vmblock.ko.cmd
Only in vmblock-only.mod: .vmblock.mod.o.cmd
Only in vmblock-only.mod: .vmblock.o.cmd
Only in vmblock-only.mod: Module.symvers
Only in vmblock-only.mod/linux: .block.o.cmd
Only in vmblock-only.mod/linux: .control.o.cmd
Only in vmblock-only.mod/linux: .dentry.o.cmd
Only in vmblock-only.mod/linux: .file.o.cmd
generated/utsrelease.h contains currently built kernel version (on later kernels)
e.g.
root@dev2:/tmp/vmware-root# cat /usr/src/linux-headers-5.0.0-1035-azure/include/generated/utsrelease.h
#define UTS_RELEASE "5.0.0-1035-azure"
#define UTS_UBUNTU_RELEASE_ABI 1035
@stuartgillibrand
stuartgillibrand / vmciKernelIf.c.patch
Last active April 6, 2020 23:36
VMware workstation (14) vmci (vmci-only) vmciKernelIf.c patch for kernel 5 (specifically 5.0.0-1035-azure which doesn't have VMCI compiled in by default)
--- vmciKernelIf.c.bak 2020-04-04 11:26:35.338057419 +0000
+++ vmciKernelIf.c 2020-04-04 12:10:54.851830116 +0000
@@ -40,6 +40,8 @@
#include <linux/socket.h> /* For memcpy_{to,from}iovec(). */
#include <linux/vmalloc.h>
#include <linux/wait.h>
+#include <linux/sched/signal.h>
+#include <linux/skbuff.h>
#include "compat_highmem.h"
@stuartgillibrand
stuartgillibrand / driver.c.patch
Last active April 6, 2020 23:37
VMware workstation (14) vmci (vmci-only) driver.c patch for kernel 5 (specifically 5.0.0-1035-azure which doesn't have VMCI compiled in by default)
nf@dev2:/usr/lib/vmware/modules/source/vmci-only/linux$ diff -u driver.c.bak driver.c
--- driver.c.bak 2020-04-04 11:06:09.785080943 +0000
+++ driver.c 2020-04-04 12:09:20.104265869 +0000
@@ -1437,7 +1437,11 @@
VMCIUserVAInvalidPointer(VA uva, // IN:
size_t size) // IN:
{
+#if LINUX_VERSION_CODE < KERNEL_VERSION(5, 0, 0)
return !access_ok(VERIFY_WRITE, (void *)uva, size);
+#else
// define narrow / wide helpers for std:: string related
#ifdef UNICODE
#ifndef _tstring
#define _tstring std::wstring
#endif
#ifndef _tostream
#define _tostream std::wostream
#endif
#ifndef _tstreambuf
#define _tstreambuf std::wstreambuf