diff --git a/fixes_for_kernel_6.4.patch b/fixes_for_kernel_6.4.patch new file mode 100644 index 0000000..507fdf5 --- /dev/null +++ b/fixes_for_kernel_6.4.patch @@ -0,0 +1,47 @@ +Index: VirtualBox-7.0.8/src/VBox/Additions/linux/sharedfolders/regops.c +=================================================================== +--- VirtualBox-7.0.8.orig/src/VBox/Additions/linux/sharedfolders/regops.c ++++ VirtualBox-7.0.8/src/VBox/Additions/linux/sharedfolders/regops.c +@@ -179,7 +179,11 @@ static size_t vbsf_iov_iter_count(struct + { + size_t cbRet = 0; + size_t cLeft = iter->nr_segs; ++#if RTLNX_VER_MIN(6, 4, 0) ++ struct iovec const *iov = iter_iov(iter); ++#else + struct iovec const *iov = iter->iov; ++#endif + while (cLeft-- > 0) { + cbRet += iov->iov_len; + iov++; +@@ -295,8 +299,12 @@ void vbsf_iov_iter_revert(struct vbsf_io + } + + while (cbRewind > 0) { +- struct iovec const *pIov = --iter->iov; +- size_t const cbSeg = pIov->iov_len; ++#if RTLNX_VER_MIN(6, 4, 0) ++ struct iovec const *pIov = --iter_iov(iter); ++#else ++ struct iovec const *pIov = --iter->iov; ++#endif ++ size_t const cbSeg = pIov->iov_len; + iter->nr_segs++; + + Assert((uintptr_t)pIov >= (uintptr_t)iter->iov_org); +@@ -2399,9 +2407,13 @@ static size_t vbsf_iter_max_span_of_page + # if RTLNX_VER_MIN(3,16,0) + if (iter_is_iovec(iter) || (VBSF_GET_ITER_TYPE(iter) & ITER_KVEC)) { + # endif ++#if RTLNX_VER_MIN(6, 4, 0) ++ const struct iovec *pCurIov = iter_iov(iter); ++#else + const struct iovec *pCurIov = iter->iov; +- size_t cLeft = iter->nr_segs; +- size_t cPagesSpan = 0; ++#endif ++ size_t cLeft = iter->nr_segs; ++ size_t cPagesSpan = 0; + + /* iovect and kvec are identical, except for the __user tagging of iov_base. */ + AssertCompileMembersSameSizeAndOffset(struct iovec, iov_base, struct kvec, iov_base); diff --git a/virtualbox.changes b/virtualbox.changes index 8f10e8f..fb36dd0 100644 --- a/virtualbox.changes +++ b/virtualbox.changes @@ -1,3 +1,9 @@ +------------------------------------------------------------------- +Tue Jun 27 19:08:03 UTC 2023 - Larry Finger + +- Fix builds on kernel 6.4 (boo#1212761) + File "fixes_for_kernel_6.4.patch" added. + ------------------------------------------------------------------- Wed Jun 14 02:18:18 UTC 2023 - Larry Finger diff --git a/virtualbox.spec b/virtualbox.spec index 7933e23..3b3adb1 100644 --- a/virtualbox.spec +++ b/virtualbox.spec @@ -165,6 +165,8 @@ Patch37: fix_7.0.6_locking_problems.patch # Support python 3.11 Patch38: python311.patch Patch39: fix_sdl_build.patch +# Fix build on kernel 6.4 +Patch40: fixes_for_kernel_6.4.patch # # Common BuildRequires for both virtualbox and virtualbox-kmp BuildRequires: %{kernel_module_package_buildreqs} @@ -486,6 +488,7 @@ This package contains the kernel-modules that VirtualBox uses to create or run v %patch37 -p1 %patch38 -p1 %patch39 -p1 +%patch40 -p1 ### Documents for virtualbox main package ### %if %{main_package}