summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorJean-Marc Lenoir2019-10-05 16:17:53 +0200
committerJean-Marc Lenoir2019-10-05 16:17:53 +0200
commitb439fe07b09c6938fb6ad6dc2acb72dd760ef684 (patch)
tree26273da7ee33d8fb954dcc638e6edfcafeef51cf
parent914997757fd2604392721657a6d119d152deb480 (diff)
downloadaur-b439fe07b09c6938fb6ad6dc2acb72dd760ef684.tar.gz
Compatibility with Linux 5.4-rc1
-rw-r--r--.SRCINFO2
-rw-r--r--PKGBUILD2
-rw-r--r--vmnet.patch85
3 files changed, 87 insertions, 2 deletions
diff --git a/.SRCINFO b/.SRCINFO
index ad7cd1d52f5..1a732257d98 100644
--- a/.SRCINFO
+++ b/.SRCINFO
@@ -89,7 +89,7 @@ pkgbase = vmware-workstation14
sha256sums = 05e26d8b21d190ebabb7f693998114d9d5991d9dfb71acb4d990293a65b6b487
sha256sums = 6ce902b1dab8fc69be253abd8e79017011985eca850ff7acc7282f9ab668e35d
sha256sums = 410cb17dead645dacb1d35c6fedf6ca8de5294117f929a69740a8df462c8a95c
- sha256sums = 9503ab7064fe7b63f18dfbc061e6246e0af26f01812e39f6d778a169dd93dd13
+ sha256sums = 38eb0f5aedf79ab6098f9c4676df521be5acbf2aa7ed47c658cba0f33c13f297
sha256sums = 195313791f2c2cf880b0ba6c9d130e40ab6729335c0980fcc40df4209c1ed52b
sha256sums = e36fb99a56a65d2c4d82168c8adb1ed19a9a7aaf75807c667c79a79f4968740a
sha256sums = 29e0b0db9c0296ab81eee543803c4bd430e2c69c76e33492910e17280da1c05c
diff --git a/PKGBUILD b/PKGBUILD
index 8792aedaf54..1c31c4b5e4c 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -124,7 +124,7 @@ sha256sums=(
'05e26d8b21d190ebabb7f693998114d9d5991d9dfb71acb4d990293a65b6b487'
'6ce902b1dab8fc69be253abd8e79017011985eca850ff7acc7282f9ab668e35d'
'410cb17dead645dacb1d35c6fedf6ca8de5294117f929a69740a8df462c8a95c'
- '9503ab7064fe7b63f18dfbc061e6246e0af26f01812e39f6d778a169dd93dd13'
+ '38eb0f5aedf79ab6098f9c4676df521be5acbf2aa7ed47c658cba0f33c13f297'
)
options=(!strip emptydirs)
diff --git a/vmnet.patch b/vmnet.patch
index 115c7984410..82cf37ca89a 100644
--- a/vmnet.patch
+++ b/vmnet.patch
@@ -90,3 +90,88 @@
&recvClusterPage,
&recvClusterCount)) < 0) {
goto error_free;
+From f404bc6855ea2c731b617d3b0a2971481eb31cbd Mon Sep 17 00:00:00 2001
+From: Michal Kubecek <mkubecek@suse.cz>
+Date: Thu, 19 Sep 2019 12:20:20 +0200
+Subject: [PATCH] vmnet: handle switch of skb_frag_t to bio_vec
+
+The switch from custom skb_frag_t implementation to bio_vec in v5.4-rc1 is
+mostly transparent for modules which use accessor for skb_frag_t members.
+Unfortunately many users access the members directly and function
+VNetCsumCopyDatagram() in vmnet is one of those.
+
+Use accessors everywhere so that vmnet code is compatible with kernel 5.4
+and newer. Use "compat_" prefix to avoid clashes with backports adding the
+accessors to older codebase.
+---
+ vmnet-only/userif.c | 39 +++++++++++++++++++++++++++++----------
+ 1 file changed, 29 insertions(+), 10 deletions(-)
+
+diff --git a/vmnet-only/userif.c b/vmnet-only/userif.c
+index d385088..aab9478 100644
+--- a/vmnet-only/userif.c
++++ b/vmnet-only/userif.c
+@@ -78,13 +78,31 @@ static int VNetUserIfSetUplinkState(VNetPort *port, uint8 linkUp);
+ extern unsigned int vnet_max_qlen;
+
+ #if COMPAT_LINUX_VERSION_CHECK_LT(3, 2, 0)
+-# define compat_kmap(page) kmap(page)
+-# define compat_kunmap(page) kunmap(page)
++# define compat_kmap_frag(frag) kmap((frag)->page)
++# define compat_kunmap_frag(page) kunmap((frag)->page)
+ #else
+-# define compat_kmap(page) kmap((page).p)
+-# define compat_kunmap(page) kunmap((page).p)
++# define compat_kmap_frag(frag) kmap(skb_frag_page(frag))
++# define compat_kunmap_frag(frag) kunmap(skb_frag_page(frag))
+ #endif
+
++static unsigned int compat_skb_frag_size(const skb_frag_t *frag)
++{
++#if COMPAT_LINUX_VERSION_CHECK_LT(3, 2, 0)
++ return frag->size;
++#else
++ return skb_frag_size(frag);
++#endif
++}
++
++static unsigned int compat_skb_frag_off(const skb_frag_t *frag)
++{
++#if COMPAT_LINUX_VERSION_CHECK_LT(5, 4, 0)
++ return frag->page_offset;
++#else
++ return skb_frag_off(frag);
++#endif
++}
++
+ /*
+ *-----------------------------------------------------------------------------
+ *
+@@ -564,20 +582,21 @@ VNetCsumCopyDatagram(const struct sk_buff *skb, // IN: skb to copy
+ for (frag = skb_shinfo(skb)->frags;
+ frag != skb_shinfo(skb)->frags + skb_shinfo(skb)->nr_frags;
+ frag++) {
+- if (frag->size > 0) {
++ if (compat_skb_frag_size(frag) > 0) {
+ unsigned int tmpCsum;
+ const void *vaddr;
+
+- vaddr = compat_kmap(frag->page);
+- tmpCsum = csum_and_copy_to_user(vaddr + frag->page_offset,
+- curr, frag->size, 0, &err);
+- compat_kunmap(frag->page);
++ vaddr = compat_kmap_frag(frag);
++ tmpCsum = csum_and_copy_to_user(vaddr + compat_skb_frag_off(frag),
++ curr, compat_skb_frag_size(frag), 0,
++ &err);
++ compat_kunmap_frag(frag);
+
+ if (err) {
+ return err;
+ }
+ csum = csum_block_add(csum, tmpCsum, curr - buf);
+- curr += frag->size;
++ curr += compat_skb_frag_size(frag);
+ }
+ }
+