commit c70cbdf2940b00c291cdb09328a123ae5046df8c
Author: Sérgio M. Basto <sergio(a)serjux.com>
Date: Thu Sep 21 16:22:49 2017 +0100
Add fixes for kernel 4.14
VirtualBox-kmod.spec | 7 ++++++-
fixes_for_4.14.patch | 50 ++++++++++++++++++++++++++++++++++++++++++++++++++
2 files changed, 56 insertions(+), 1 deletion(-)
---
diff --git a/VirtualBox-kmod.spec b/VirtualBox-kmod.spec
index 0239156..f2e08d3 100644
--- a/VirtualBox-kmod.spec
+++ b/VirtualBox-kmod.spec
@@ -29,7 +29,7 @@
Name: VirtualBox-kmod
Version: 5.1.28
#Release: 1%%{?prerel:.%%{prerel}}%%{?dist}
-Release: 3%{?dist}
+Release: 4%{?dist}
Summary: Kernel module for VirtualBox
Group: System Environment/Kernel
@@ -37,6 +37,7 @@ License: GPLv2 or CDDL
URL:
http://www.virtualbox.org/wiki/VirtualBox
# This filters out the XEN kernel, since we don't run on XEN
Source1: VirtualBox-kmod-excludekernel-filter.txt
+Patch1: fixes_for_4.14.patch
%global AkmodsBuildRequires %{_bindir}/kmodtool, VirtualBox-kmodsrc >=
%{version}%{vboxreltag}, xz, time
BuildRequires: %{AkmodsBuildRequires}
@@ -59,6 +60,7 @@ Kernel module for VirtualBox
%prep
%setup -T -c
tar --use-compress-program xz -xf
%{_datadir}/%{name}-%{version}/%{name}-%{version}.tar.xz
+%patch1 -p1 -b .kernel_4.14
# error out if there was something wrong with kmodtool
%{?kmodtool_check}
@@ -107,6 +109,9 @@ DIRS=$(ls %{name}-%{version} |wc -l)
%changelog
+* Thu Sep 21 2017 Sérgio Basto <sergio(a)serjux.com> - 5.1.28-4
+- Add fixes for kernel 4.14
+
* Sat Sep 16 2017 Sérgio Basto <sergio(a)serjux.com> - 5.1.28-3
- Reenable buildsys-build-rpmfusion-kerneldevpkgs-current
diff --git a/fixes_for_4.14.patch b/fixes_for_4.14.patch
new file mode 100644
index 0000000..e352bcb
--- /dev/null
+++ b/fixes_for_4.14.patch
@@ -0,0 +1,50 @@
+Index: VirtualBox-5.1.28/src/VBox/HostDrivers/VBoxPci/linux/VBoxPci-linux.c
+===================================================================
+--- ./VirtualBox-kmod-5.1.28/vboxpci/linux/VBoxPci-linux.c.orig
++++ ./VirtualBox-kmod-5.1.28/vboxpci/linux/VBoxPci-linux.c
+@@ -353,12 +353,17 @@ static void vboxPciFileClose(struct fil
+ static int vboxPciFileWrite(struct file* file, unsigned long long offset, unsigned char*
data, unsigned int size)
+ {
+ int ret;
++# if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 14, 0)
++
++ ret = kernel_write(file, data, size, &offset);
++#else
+ mm_segment_t fs_save;
+
+ fs_save = get_fs();
+ set_fs(get_ds());
+ ret = vfs_write(file, data, size, &offset);
+ set_fs(fs_save);
++#endif
+ if (ret < 0)
+ printk(KERN_DEBUG "vboxPciFileWrite: error %d\n", ret);
+
+Index: VirtualBox-5.1.28/src/VBox/HostDrivers/VBoxNetFlt/linux/VBoxNetFlt-linux.c
+===================================================================
+--- ./VirtualBox-kmod-5.1.28/vboxnetflt/linux/VBoxNetFlt-linux.c
++++ ./VirtualBox-kmod-5.1.28/vboxnetflt/linux/VBoxNetFlt-linux.c
+@@ -124,6 +124,10 @@ typedef struct VBOXNETFLTNOTIFIER *PVBOX
+ # define bstats stats
+ # define qstats stats
+ # endif
++#endif
++
++# if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 14, 0)
++#define SKB_GSO_UDP 0
+ #endif
+
+ #if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 20, 0)
+@@ -722,9 +726,11 @@ static struct sk_buff *vboxNetFltLinuxSk
+ case PDMNETWORKGSOTYPE_IPV4_TCP:
+ fGsoType = SKB_GSO_TCPV4;
+ break;
++# if LINUX_VERSION_CODE < KERNEL_VERSION(4, 14, 0)
+ case PDMNETWORKGSOTYPE_IPV4_UDP:
+ fGsoType = SKB_GSO_UDP;
+ break;
++#endif
+ case PDMNETWORKGSOTYPE_IPV6_TCP:
+ fGsoType = SKB_GSO_TCPV6;
+ break;
+