summarylogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--.SRCINFO4
-rw-r--r--PKGBUILD4
-rw-r--r--vmnet.patch182
3 files changed, 185 insertions, 5 deletions
diff --git a/.SRCINFO b/.SRCINFO
index 064ca263048..d70687a5c0a 100644
--- a/.SRCINFO
+++ b/.SRCINFO
@@ -1,7 +1,7 @@
pkgbase = vmware-workstation14
pkgdesc = The industry standard for running multiple operating systems as virtual machines on a single Linux PC.
pkgver = 14.1.7
- pkgrel = 15
+ pkgrel = 16
url = https://www.vmware.com/products/workstation-for-linux.html
install = vmware-workstation.install
arch = x86_64
@@ -89,6 +89,6 @@ pkgbase = vmware-workstation14
sha256sums = 10562d11d50edab9abc2b29c8948714edcb9b084f99b3766d07ddd21259e372e
sha256sums = 273d4357599a3e54259c78cc49054fef8ecfd2c2eda35cbcde3a53a62777a5ac
sha256sums = 33597acdf43b7e8b22724781d9da0043db1c76a498613933c706452c2dc326c2
- sha256sums = 534d4e3fbd6b30d8fe9f9aecfd2487d6684ace64ab14f2fc19cd51c66cd44024
+ sha256sums = 43f6f78aeff69fd08ca3e0b539240d67f8d75808f8be63688dbb2f5abe45ca74
pkgname = vmware-workstation14
diff --git a/PKGBUILD b/PKGBUILD
index 1879662f6c5..3057d0d1f7f 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -16,7 +16,7 @@ pkgname=vmware-workstation14
pkgver=14.1.7
_buildver=12989993
_pkgver=${pkgver}_${_buildver}
-pkgrel=15
+pkgrel=16
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'
@@ -126,7 +126,7 @@ sha256sums=(
'10562d11d50edab9abc2b29c8948714edcb9b084f99b3766d07ddd21259e372e'
'273d4357599a3e54259c78cc49054fef8ecfd2c2eda35cbcde3a53a62777a5ac'
'33597acdf43b7e8b22724781d9da0043db1c76a498613933c706452c2dc326c2'
- '534d4e3fbd6b30d8fe9f9aecfd2487d6684ace64ab14f2fc19cd51c66cd44024'
+ '43f6f78aeff69fd08ca3e0b539240d67f8d75808f8be63688dbb2f5abe45ca74'
)
options=(!strip emptydirs)
diff --git a/vmnet.patch b/vmnet.patch
index 2d2c41ae72e..c4887a8ec22 100644
--- a/vmnet.patch
+++ b/vmnet.patch
@@ -195,6 +195,94 @@
if (port->jack.state == FALSE || hubJack == NULL) {
return -EINVAL;
}
+From 4af1a71978962f9805fe2e7e6ceb05c24f42c7f0 Mon Sep 17 00:00:00 2001
+From: Michal Kubecek <mkubecek@suse.cz>
+Date: Tue, 11 Jan 2022 17:25:45 +0100
+Subject: [PATCH] vmnet: use accessors for net_device::dev_addr
+
+Mainline commit adeef3e32146 ("net: constify netdev->dev_addr") in 5.17-rc1
+makes dev_addr member of struct net_device const but accessors should be
+used to modify it since 5.15 to make sure rbtree with hardware address list
+is updated properly.
+
+Use dev_addr_set() and __dev_addr_set() in VNetNetifSetMAC() and
+VNetNetIf_Create(). For kernels before 5.15 provide our own version of the
+accessors. As SMAC_SetMac() only reads dev_addr, constify the corresponding
+argument.
+---
+ vmnet-only/netif.c | 18 +++++++++++++++---
+ vmnet-only/smac.c | 2 +-
+ vmnet-only/smac.h | 2 +-
+ 3 files changed, 17 insertions(+), 5 deletions(-)
+
+diff --git a/vmnet-only/netif.c b/vmnet-only/netif.c
+index c70f7f4..8c3bbf8 100644
+--- a/vmnet-only/netif.c
++++ b/vmnet-only/netif.c
+@@ -65,6 +64,19 @@ static int VNetNetIfProcRead(char *page, char **start, off_t off,
+ static int VNetNetIfProcRead(char *page, char **start, off_t off,
+ int count, int *eof, void *data);
+
++#if LINUX_VERSION_CODE < KERNEL_VERSION(5, 15, 0)
++static void
++__dev_addr_set(struct net_device *dev, const void *addr, size_t len)
++{
++ memcpy(dev->dev_addr, addr, len);
++}
++
++static void dev_addr_set(struct net_device *dev, const u8 *addr)
++{
++ __dev_addr_set(dev, addr, dev->addr_len);
++}
++#endif
++
+ /*
+ *----------------------------------------------------------------------
+ *
+@@ -219,7 +232,7 @@ VNetNetIf_Create(char *devName, // IN:
+
+ memset(&netIf->stats, 0, sizeof netIf->stats);
+
+- memcpy(dev->dev_addr, netIf->port.paddr, sizeof netIf->port.paddr);
++ __dev_addr_set(dev, netIf->port.paddr, sizeof(netIf->port.paddr));
+
+ if (register_netdev(dev) != 0) {
+ LOG(0, (KERN_NOTICE "%s: could not register network device\n",
+@@ -498,7 +511,7 @@ VNetNetifSetMAC(struct net_device *dev, // IN:
+ return -EINVAL;
+ }
+ memcpy(netIf->port.paddr, addr->sa_data, dev->addr_len);
+- memcpy(dev->dev_addr, addr->sa_data, dev->addr_len);
++ dev_addr_set(dev, addr->sa_data);
+ return 0;
+ }
+
+diff --git a/vmnet-only/smac.c b/vmnet-only/smac.c
+index f18be8a..7f38e7a 100644
+--- a/vmnet-only/smac.c
++++ b/vmnet-only/smac.c
+@@ -4118,7 +4118,7 @@ SMAC_InitState(SMACState **ptr) // OUT: pointer to alloced/inited state
+
+ void SMACINT
+ SMAC_SetMac(SMACState *state, // IN: state to update
+- uint8 *mac) // IN: pointer to host adapter's MAC
++ const uint8 *mac) // IN: pointer to host adapter's MAC
+ {
+ VNETKdPrintCall(("SMAC_SetMac"));
+ ASSERT(state);
+diff --git a/vmnet-only/smac.h b/vmnet-only/smac.h
+index c8df9d2..f03fd3f 100644
+--- a/vmnet-only/smac.h
++++ b/vmnet-only/smac.h
+@@ -72,7 +72,7 @@ Bool BridgeIPv4MatchAddrMAC(const ULONG ipAddr, const uint8 *mac);
+ void SMACINT
+ SMAC_InitState(struct SMACState **ptr); // IN: state to alloc/init
+ void SMACINT
+-SMAC_SetMac(struct SMACState *state, uint8 *mac); // IN: state, and host MAC
++SMAC_SetMac(struct SMACState *state, const uint8 *mac); // IN: state, and host MAC
+ void SMACINT
+ SMAC_CleanupState(struct SMACState **ptr); // IN: state to cleanup/dealloc
+
From 409623bd4693afada659af82e823a6291f70797a Mon Sep 17 00:00:00 2001
From: Michal Kubecek <mkubecek@suse.cz>
Date: Mon, 4 Apr 2022 02:05:17 +0200
@@ -249,7 +337,7 @@ diff --git a/vmnet-only/netif.c b/vmnet-only/netif.c
index 8c3bbf8..35256a0 100644
--- a/vmnet-only/netif.c
+++ b/vmnet-only/netif.c
-@@ -311,7 +311,7 @@ VNetNetIfReceive(VNetJack *this, // IN: jack
+@@ -324,7 +324,7 @@ VNetNetIfReceive(VNetJack *this, // IN: jack
/* send to the host interface */
skb->dev = netIf->dev;
skb->protocol = eth_type_trans(skb, netIf->dev);
@@ -258,3 +346,95 @@ index 8c3bbf8..35256a0 100644
netIf->stats.rx_packets++;
return;
+From e02b540ab528917c1afd7848ef64ca146a634994 Mon Sep 17 00:00:00 2001
+From: Michal Kubecek <mkubecek@suse.cz>
+Date: Tue, 31 May 2022 23:29:42 +0200
+Subject: [PATCH] vmnet: open code csum_and_copy_to_user on kernel >= 5.19
+
+Mainline commit 6308499b5e99 ("net: unexport csum_and_copy_{from,to}_user")
+in 5.19-rc1 unexports csum_and_copy_to_user as no in-tree module is using
+it. A clean solution would probably be rewriting the code to use iovec
+iterator as csum_and_copy_to_iter() is still exported (or perhaps
+skb_copy_and_csum_datagram() might be used instead). Anything like this
+would be way too intrusive so it would have to wait for VMware developers.
+
+For now, use the simplest solution and replace the calls to
+csum_and_copy_to_user() on 5.19 and newer with open coded implementation.
+As the optimized x86 version uses csum_partial_copy_generic() which is not
+exported on x86_64 either, copy the generic one from include/net/checksum.h
+instead. This will be less efficient but hopefully the performace hit will
+not be noticeable.
+---
+ vmnet-only/userif.c | 45 +++++++++++++++++++++++++++++++--------------
+ 1 file changed, 31 insertions(+), 14 deletions(-)
+
+diff --git a/vmnet-only/userif.c b/vmnet-only/userif.c
+index e99c436..2c5a24a 100644
+--- a/vmnet-only/userif.c
++++ b/vmnet-only/userif.c
+@@ -85,6 +85,33 @@ extern unsigned int vnet_max_qlen;
+ # define skb_frag_off(frag) (frag)->page_offset
+ #endif
+
++#if COMPAT_LINUX_VERSION_CHECK_LT(5, 10, 0)
++static inline unsigned int
++compat_csum_and_copy_to_user(const void *src, void __user *dst, int len,
++ int *err)
++{
++ return csum_and_copy_to_user(src, dst, len, 0, err);
++}
++#else
++static inline unsigned int
++compat_csum_and_copy_to_user(const void *src, void __user *dst, int len,
++ int *err)
++{
++ unsigned int csum;
++
++#if COMPAT_LINUX_VERSION_CHECK_LT(5, 19, 0)
++ csum = csum_and_copy_to_user(src, dst, len);
++#else
++ csum = csum_partial(src, len, ~0U);
++ if (copy_to_user(dst, src, len))
++ csum = 0;
++#endif /* 5.19 */
++
++ *err = (csum == 0 ? -EFAULT : 0);
++ return csum;
++}
++#endif /* 5.10 */
++
+ /*
+ *-----------------------------------------------------------------------------
+ *
+@@ -555,12 +582,7 @@ VNetCsumCopyDatagram(const struct sk_buff *skb, // IN: skb to copy
+ return -EINVAL;
+ }
+
+-#if COMPAT_LINUX_VERSION_CHECK_LT(5, 10, 0)
+- csum = csum_and_copy_to_user(skb->data + offset, curr, len, 0, &err);
+-#else
+- csum = csum_and_copy_to_user(skb->data + offset, curr, len);
+- err = (csum == 0) ? -EFAULT : 0;
+-#endif
++ csum = compat_csum_and_copy_to_user(skb->data + offset, curr, len, &err);
+ if (err) {
+ return err;
+ }
+@@ -574,14 +596,9 @@ VNetCsumCopyDatagram(const struct sk_buff *skb, // IN: skb to copy
+ const void *vaddr;
+
+ vaddr = kmap(skb_frag_page(frag));
+-#if COMPAT_LINUX_VERSION_CHECK_LT(5, 10, 0)
+- tmpCsum = csum_and_copy_to_user(vaddr + skb_frag_off(frag),
+- curr, skb_frag_size(frag), 0, &err);
+-#else
+- tmpCsum = csum_and_copy_to_user(vaddr + skb_frag_off(frag),
+- curr, skb_frag_size(frag));
+- err = (tmpCsum == 0) ? -EFAULT : 0;
+-#endif
++ tmpCsum = compat_csum_and_copy_to_user(vaddr + skb_frag_off(frag),
++ curr, skb_frag_size(frag),
++ &err);
+ kunmap(skb_frag_page(frag));
+
+ if (err) {