summarylogtreecommitdiffstats
path: root/vmnet.patch
diff options
context:
space:
mode:
authorJean-Marc Lenoir2020-12-12 23:00:45 +0100
committerJean-Marc Lenoir2020-12-12 23:00:45 +0100
commit0c64d5462436eb4a65dbaecef16d1d9bde161a3c (patch)
tree36d02fee4e2066bfda27b9a7b570c451307c813b /vmnet.patch
parentb97e34ef23ef13eed6ea3d377b37f2f62a37be55 (diff)
downloadaur-0c64d5462436eb4a65dbaecef16d1d9bde161a3c.tar.gz
Compatibility with Linux 5.10
Diffstat (limited to 'vmnet.patch')
-rw-r--r--vmnet.patch41
1 files changed, 30 insertions, 11 deletions
diff --git a/vmnet.patch b/vmnet.patch
index 5f1159bc7121..5c49010548bb 100644
--- a/vmnet.patch
+++ b/vmnet.patch
@@ -12,7 +12,7 @@
# Header directory for the running kernel
ifdef LINUXINCLUDE
-@@ -98,6 +98,13 @@ auto-build: $(DRIVER_KO)
+@@ -98,6 +102,13 @@ auto-build: $(DRIVER_KO)
$(DRIVER): $(DRIVER_KO)
if [ $< -nt $@ ] || [ ! -e $@ ] ; then cp -f $< $@; fi
@@ -26,7 +26,7 @@
#
# Define a setup target that gets built before the actual driver.
# This target may not be used at all, but if it is then it will be defined
-@@ -107,7 +114,7 @@ prebuild:: ;
+@@ -107,7 +118,7 @@ prebuild:: ;
postbuild:: ;
$(DRIVER_KO): prebuild
@@ -37,7 +37,7 @@
MODULEBUILDDIR=$(MODULEBUILDDIR) postbuild
--- a/vmnet/procfs.c
+++ a/vmnet/procfs.c
-@@ -137,6 +137,7 @@
+@@ -137,6 +137,7 @@ VNetProcShow(struct seq_file *p, // IN:
}
@@ -45,7 +45,7 @@
/*
*----------------------------------------------------------------------
*
-@@ -168,6 +169,7 @@
+@@ -168,6 +169,7 @@ static struct file_operations fops = {
.release = single_release,
};
#endif
@@ -53,7 +53,7 @@
/*
-@@ -203,7 +205,12 @@
+@@ -203,7 +205,12 @@ VNetProcMakeEntryInt(VNetProcEntry *pa
} else {
ent->data = data;
ent->fn = fn;
@@ -68,7 +68,7 @@
*ret = ent;
--- a/vmnet/userif.c
+++ b/vmnet/userif.c
-@@ -78,11 +78,11 @@
+@@ -78,11 +78,11 @@ static int VNetUserIfSetUplinkState(VNe
extern unsigned int vnet_max_qlen;
#if COMPAT_LINUX_VERSION_CHECK_LT(3, 2, 0)
@@ -85,7 +85,7 @@
#endif
/*
-@@ -137,16 +137,21 @@
+@@ -137,16 +137,21 @@ UserifLockPage(VA addr) // IN
*/
static INLINE int
@@ -111,7 +111,7 @@
*p = UserifLockPage(uAddr);
if (*p == NULL) {
-@@ -158,7 +163,7 @@
+@@ -158,7 +163,7 @@ VNetUserIfMapPtr(VA uAddr, // IN:
}
static INLINE int
@@ -120,7 +120,7 @@
struct page **p, // OUT: locked page
uint32 **ptr) // OUT: kernel mapped pointer
{
-@@ -201,7 +206,7 @@
+@@ -201,7 +206,7 @@ VNetUserIfSetupNotify(VNetUserIF *userIf
return -EBUSY;
}
@@ -129,7 +129,7 @@
&pollPtr)) < 0) {
return retval;
}
-@@ -213,7 +218,7 @@
+@@ -213,7 +218,7 @@ VNetUserIfSetupNotify(VNetUserIF *userIf
goto error_free;
}
@@ -138,7 +138,20 @@
&recvClusterPage,
&recvClusterCount)) < 0) {
goto error_free;
-@@ -559,20 +564,20 @@
+@@ -550,7 +555,12 @@ VNetCsumCopyDatagram(const struct sk_buf
+ 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
+ if (err) {
+ return err;
+ }
+@@ -559,20 +569,26 @@ VNetCsumCopyDatagram(const struct sk_buf
for (frag = skb_shinfo(skb)->frags;
frag != skb_shinfo(skb)->frags + skb_shinfo(skb)->nr_frags;
frag++) {
@@ -152,8 +165,14 @@
- curr, frag->size, 0, &err);
- compat_kunmap(frag->page);
+ 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
+ kunmap(skb_frag_page(frag));
if (err) {