[Bug 1835576] Re: virtualbox-guest-dkms-hwe 5.2.18-dfsg-3~ubuntu18.04.3 fails to build on 5.0 based kernels [In function ‘VBoxGuest_RTR0MemUserIsValidAddr’: error: macro "access_ok" passed 3 arguments, but takes just 2]

Gianfranco Costamagna costamagnagianfranco at yahoo.it
Sat Jul 13 20:22:37 UTC 2019


@Connor, sorry for stealing your work! I did take it, but I think we really should update virtualbox to 5.2.30, which fixes natively mostly all of the issues wrt compatibility with newer kernels.
I took one patch that renames the kbuild stuff, I like that one, even if upstream is still working on such bits.

-- 
You received this bug notification because you are a member of Ubuntu
Sponsors Team, which is subscribed to the bug report.
https://bugs.launchpad.net/bugs/1835576

Title:
  virtualbox-guest-dkms-hwe 5.2.18-dfsg-3~ubuntu18.04.3 fails to build
  on 5.0 based kernels [In function ‘VBoxGuest_RTR0MemUserIsValidAddr’:
  error: macro "access_ok" passed 3 arguments, but takes just 2]

Status in virtualbox package in Ubuntu:
  New
Status in virtualbox-ext-pack package in Ubuntu:
  New
Status in virtualbox-guest-additions-iso package in Ubuntu:
  New
Status in virtualbox-hwe package in Ubuntu:
  Fix Released
Status in virtualbox source package in Bionic:
  New
Status in virtualbox-ext-pack source package in Bionic:
  New
Status in virtualbox-guest-additions-iso source package in Bionic:
  New
Status in virtualbox-hwe source package in Bionic:
  In Progress

Bug description:
  [Impact]

   * virtualbox-guest-dkms-hwe fails to build on 5.0 kernels. This
  affects Bionic because the Bionic HWE Edge kernels are based on 5.0.
  virtualbox-guest-dkms-hwe cannot be installed successfully since the
  DKMS module can't be compiled due to API changes introduced between
  Linux 4.15 and 5.0.

  [Test Case]

   * Install the HWE Edge kernel on Bionic:
     - `sudo apt install linux-generic-hwe-18.04-edge`
   * Reboot into the new kernel (you should be on a 5.0 kernel now)
   * Try installing `virtualbox-guest-dkms-hwe` (`sudo apt install virtualbox-guest-dkms-hwe`)
     - Expected result: package installs successfully, module can be viewed with `sudo dkms status`
     - Actual result: Installation fails due to compilation errors when building the DKMS module.

  [Testing]

  These steps were performed in an amd64 virtual machine installed from
  a Bionic cloud image.

   * Create a .deb with the .debdiff attached to comment #1
     - Uncomment the `deb-src` lines in /etc/apt/sources.list
     - `sudo apt build-dep virtualbox-hwe`
     - `pull-lp-source virtualbox-hwe bionic`
     - `cd virtualbox-hwe` (it will be a longer, but similar name to that)
     - `patch -p1 < path/to/patch.debdiff`
     - `quilt push -a`
     - `debuild -b -us -uc` (note: this build can take some time)

   * Install `dkms`
     - `sudo apt install dkms`

  == On the stock 4.15 Ubuntu kernel ==
   * Install the .deb you prepared in the first step.
     - `sudo dpkg --install path-to-file.deb`
     - Confirm that it installs successfully (as you are running the 4.15 Ubuntu kernel)
   * Install the 5.0 edge kernel
     - `sudo apt install linux-generic-hwe-18.04-edge`
   * As part of the installation of the new kernel, the active virtualbox DKMS module should be rebuilt. If it is not, remove uninstall the package `sudo apt remove virtualbox-guest-dkms-hwe`, reboot into the new 5.0 kernel, and perform the install step on your .deb again and confirm it installs correctly without compilation failures.

  [Regression Potential]

  These changes are conditionally compiled depending on the kernel
  version. The only exception to this is the addition of an inlined
  function for operating on timespec64. That is conditionally compiled
  based on whether the kernel has timespec64, not necessarily just on
  the kernel version.

  However, there are a large number of changes and to keep it
  manageable, some backporting was required as there were a couple of
  patches that were based on previous revisions that had undergone large
  code cleanups (no logic changes, just refactorings and updating
  certain error paths). These backports were limited to surgically
  updating the call sites with the new API compatibility wrappers
  introduced by the patch or a small update to the Makefile so a header
  file can be located once again. I believe these changes are logically
  equivalent to what they were before, but this time, compileable since
  they use the new interfaces/wrappers added by the upstream developers.


  Original bug description follows:
  -----------------------------------

  The Bionic HWE Edge kernels run on 5.0. Some compilation errors are
  expected due to the API changes between 4.15 and 5.0. One can see one
  such error here when trying to install the package on the HWE edge
  kernel in Bionic: https://paste.ubuntu.com/p/Bf4KQwjfgX/

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/virtualbox/+bug/1835576/+subscriptions



More information about the Ubuntu-sponsors mailing list