summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorJean-Marc Lenoir2023-01-04 23:17:28 +0100
committerJean-Marc Lenoir2023-01-04 23:17:28 +0100
commit16072b7e98495e28c11a30d967fabccb439bdc31 (patch)
tree32a1916e471076241397e6dccfb67c57be54e516
parent030d3c2455b3fd6b7c89ded686c487edc14450b6 (diff)
downloadaur-16072b7e98495e28c11a30d967fabccb439bdc31.tar.gz
Fix vmnet on Linux 6.1
-rw-r--r--.SRCINFO4
-rw-r--r--PKGBUILD4
-rw-r--r--vmnet.patch75
3 files changed, 79 insertions, 4 deletions
diff --git a/.SRCINFO b/.SRCINFO
index ca33ce71154d..a2fa5e0671e8 100644
--- a/.SRCINFO
+++ b/.SRCINFO
@@ -1,7 +1,7 @@
pkgbase = vmware-workstation
pkgdesc = The industry standard for running multiple operating systems as virtual machines on a single Linux PC.
pkgver = 17.0.0
- pkgrel = 2
+ pkgrel = 3
url = https://www.vmware.com/products/workstation-for-linux.html
install = vmware-workstation.install
arch = x86_64
@@ -57,6 +57,6 @@ pkgbase = vmware-workstation
sha256sums = 10562d11d50edab9abc2b29c8948714edcb9b084f99b3766d07ddd21259e372e
sha256sums = 273d4357599a3e54259c78cc49054fef8ecfd2c2eda35cbcde3a53a62777a5ac
sha256sums = 1060b5d45caeda5119b220fab4e1ece398af34d75131139a5dc6f74ee06672c3
- sha256sums = 7c3b6a7871b19e31fafdcc2631751dd9569196740d8e7c2026653d155c0c8da0
+ sha256sums = 465bd02962e990c0a03b26b36e1ede691c0344231d80650d4a7c79db76fe3d7a
pkgname = vmware-workstation
diff --git a/PKGBUILD b/PKGBUILD
index 90ed645d4dc5..791f489617e5 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -17,7 +17,7 @@ pkgname=vmware-workstation
pkgver=17.0.0
_buildver=20800274
_pkgver=${pkgver}_${_buildver}
-pkgrel=2
+pkgrel=3
pkgdesc='The industry standard for running multiple operating systems as virtual machines on a single Linux PC.'
arch=(x86_64)
url='https://www.vmware.com/products/workstation-for-linux.html'
@@ -93,7 +93,7 @@ sha256sums=(
'10562d11d50edab9abc2b29c8948714edcb9b084f99b3766d07ddd21259e372e'
'273d4357599a3e54259c78cc49054fef8ecfd2c2eda35cbcde3a53a62777a5ac'
'1060b5d45caeda5119b220fab4e1ece398af34d75131139a5dc6f74ee06672c3'
- '7c3b6a7871b19e31fafdcc2631751dd9569196740d8e7c2026653d155c0c8da0'
+ '465bd02962e990c0a03b26b36e1ede691c0344231d80650d4a7c79db76fe3d7a'
)
options=(!strip emptydirs)
diff --git a/vmnet.patch b/vmnet.patch
index 60fc5a12d86f..f671ddea71ec 100644
--- a/vmnet.patch
+++ b/vmnet.patch
@@ -12,3 +12,78 @@
# Header directory for the running kernel
ifdef LINUXINCLUDE
+From 78b77816d39a77b1643426ece1ebd48776d83c1b Mon Sep 17 00:00:00 2001
+From: Michal Kubecek <mkubecek@suse.cz>
+Date: Fri, 7 Oct 2022 12:56:44 +0200
+Subject: [PATCH] vmnet: work around field-spanning write warning
+
+The vmnet code uses struct VNet_EventHeader for an event header which is
+followed by variable amount of payload data but does use a flexible array
+member like most similar structures. When building with FORTIFY_SOURCE
+against kernel 6.1-rc1, this results in runtime warnings like
+
+ memcpy: detected field-spanning write (size 28) of single field "&t->event"
+
+in VNetEvent_Send() and VNetUserListenerEventHandler(). Create a helper for
+copying full event structure and for implement it using two separate copy
+statements, one for fixed header and one for the variable payload. Another
+approach would be the use of unsafe_memcpy() but this code does not seem to
+be performance critical so let us split the memcpy() instead.
+---
+ vmnet-only/vnet.h | 8 ++++++++
+ vmnet-only/vnetEvent.c | 2 +-
+ vmnet-only/vnetUserListener.c | 2 +-
+ 3 files changed, 10 insertions(+), 2 deletions(-)
+
+diff --git a/vmnet-only/vnet.h b/vmnet-only/vnet.h
+index d6691d5c..d5bb5572 100644
+--- a/vmnet-only/vnet.h
++++ b/vmnet-only/vnet.h
+@@ -269,6 +269,7 @@ typedef struct VNet_EventHeader {
+ uint32 eventId;
+ uint32 classSet;
+ uint32 type;
++ char payload[];
+ } VNet_EventHeader;
+ #pragma pack(pop)
+
+@@ -286,6 +287,13 @@ typedef struct VNet_LinkStateEvent {
+ } VNet_LinkStateEvent;
+ #pragma pack(pop)
+
++static inline void VNet_Event_copy(VNet_EventHeader *dst,
++ const VNet_EventHeader *src)
++{
++ *dst = *src;
++ memcpy(dst->payload, src->payload, src->size - sizeof(*src));
++}
++
+ /*
+ *----------------------------------------------------------------------------
+ */
+diff --git a/vmnet-only/vnetEvent.c b/vmnet-only/vnetEvent.c
+index 3fda7f5a..062398e0 100644
+--- a/vmnet-only/vnetEvent.c
++++ b/vmnet-only/vnetEvent.c
+@@ -402,7 +402,7 @@ VNetEvent_Send(VNetEvent_Sender *s, // IN: a sender
+ p->nextEvent = s->firstEvent;
+ s->firstEvent = p;
+ }
+- memcpy(&p->event, e, e->size);
++ VNet_Event_copy(&p->event, e);
+
+ /* send event */
+ classSet = e->classSet;
+diff --git a/vmnet-only/vnetUserListener.c b/vmnet-only/vnetUserListener.c
+index 114f3907..e9f51755 100644
+--- a/vmnet-only/vnetUserListener.c
++++ b/vmnet-only/vnetUserListener.c
+@@ -226,7 +226,7 @@ VNetUserListenerEventHandler(void *context, // IN: the user listener
+ return;
+ }
+ t->nextEvent = NULL;
+- memcpy(&t->event, e, e->size);
++ VNet_Event_copy(&t->event, e);
+
+ /* append event to event list */
+ userListener = (VNetUserListener*)context;