diff options
author | Jean-Marc Lenoir | 2023-01-04 23:17:17 +0100 |
---|---|---|
committer | Jean-Marc Lenoir | 2023-01-04 23:17:17 +0100 |
commit | 2deba0e550c29eb4af9d8a58308d292bb3f1bb06 (patch) | |
tree | 1469f9adfdc6ebdfa21192b5c81c5cc2c08ccdcd | |
parent | d9c69e9ba4345fce53919a09a14d969ab393f79b (diff) | |
download | aur-2deba0e550c29eb4af9d8a58308d292bb3f1bb06.tar.gz |
Fix vmnet on Linux 6.1
-rw-r--r-- | .SRCINFO | 4 | ||||
-rw-r--r-- | PKGBUILD | 4 | ||||
-rw-r--r-- | vmnet.patch | 75 |
3 files changed, 79 insertions, 4 deletions
@@ -1,7 +1,7 @@ pkgbase = vmware-workstation15 pkgdesc = The industry standard for running multiple operating systems as virtual machines on a single Linux PC. pkgver = 15.5.7 - pkgrel = 10 + pkgrel = 11 url = https://www.vmware.com/products/workstation-for-linux.html install = vmware-workstation.install arch = x86_64 @@ -87,6 +87,6 @@ pkgbase = vmware-workstation15 sha256sums = 10562d11d50edab9abc2b29c8948714edcb9b084f99b3766d07ddd21259e372e sha256sums = 273d4357599a3e54259c78cc49054fef8ecfd2c2eda35cbcde3a53a62777a5ac sha256sums = 5b7c4ada0218214fa04ccb1f6c8033571f3991a83c5a613692db7a71e48d62c7 - sha256sums = 2463f3e7104d0a0627ab2cc17edb3d0e65615613e157817f4b39af8339e8628b + sha256sums = ff5cb0e5bac64728dc04c3cc67a58ff382dc01fa244beb510ddac2202eddc53b pkgname = vmware-workstation15 @@ -16,7 +16,7 @@ pkgname=vmware-workstation15 pkgver=15.5.7 _buildver=17171714 _pkgver=${pkgver}_${_buildver} -pkgrel=10 +pkgrel=11 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' @@ -124,7 +124,7 @@ sha256sums=( '10562d11d50edab9abc2b29c8948714edcb9b084f99b3766d07ddd21259e372e' '273d4357599a3e54259c78cc49054fef8ecfd2c2eda35cbcde3a53a62777a5ac' '5b7c4ada0218214fa04ccb1f6c8033571f3991a83c5a613692db7a71e48d62c7' - '2463f3e7104d0a0627ab2cc17edb3d0e65615613e157817f4b39af8339e8628b' + 'ff5cb0e5bac64728dc04c3cc67a58ff382dc01fa244beb510ddac2202eddc53b' ) options=(!strip emptydirs) diff --git a/vmnet.patch b/vmnet.patch index 4fb225528066..85124c566560 100644 --- a/vmnet.patch +++ b/vmnet.patch @@ -201,3 +201,78 @@ # include <stddef.h> #else /* +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 +@@ -274,6 +274,7 @@ typedef struct VNet_EventHeader { + uint32 eventId; + uint32 classSet; + uint32 type; ++ char payload[]; + } VNet_EventHeader; + #pragma pack(pop) + +@@ -291,6 +292,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; |