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]

Bug #1835576 reported by Connor Kuehl
110
This bug affects 23 people
Affects Status Importance Assigned to Milestone
virtualbox (Ubuntu)
Fix Released
Undecided
Unassigned
Bionic
Fix Released
Undecided
Unassigned
virtualbox-ext-pack (Ubuntu)
Fix Released
Undecided
Unassigned
Bionic
Fix Released
Undecided
Unassigned
virtualbox-guest-additions-iso (Ubuntu)
Fix Released
Undecided
Unassigned
Bionic
Fix Released
Undecided
Unassigned
virtualbox-hwe (Ubuntu)
Fix Released
Undecided
Unassigned
Bionic
Fix Released
Medium
Connor Kuehl

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/

Connor Kuehl (connork)
Changed in virtualbox-hwe (Ubuntu Bionic):
status: New → In Progress
importance: Undecided → Medium
assignee: nobody → Connor Kuehl (connork)
summary: virtualbox-guest-dkms-hwe 5.2.18-dfsg-3~ubuntu18.04.3 fails to build on
- 5.0 based kernels
+ 5.0 based kernels [In function ‘VBoxGuest_RTR0MemUserIsValidAddr’:
+ error: macro "access_ok" passed 3 arguments, but takes just 2]
Revision history for this message
Connor Kuehl (connork) wrote :

Attaching debdiff to this comment for SRU consideration into Bionic. Adding SRU information to the bug description.

description: updated
Changed in virtualbox-hwe (Ubuntu):
status: New → Invalid
Changed in virtualbox-hwe (Ubuntu):
status: Invalid → Fix Released
Revision history for this message
Ubuntu Foundations Team Bug Bot (crichton) wrote :

The attachment "virtualbox-hwe_5.2.18-dfsg-3~ubuntu18.04.4.debdiff" seems to be a debdiff. The ubuntu-sponsors team has been subscribed to the bug report so that they can review and hopefully sponsor the debdiff. If the attachment isn't a patch, please remove the "patch" flag from the attachment, remove the "patch" tag, and if you are member of the ~ubuntu-sponsors, unsubscribe the team.

[This is an automated message performed by a Launchpad user owned by ~brian-murray, for any issue please contact him.]

tags: added: patch
Revision history for this message
Gianfranco Costamagna (costamagnagianfranco) wrote :

@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.

Revision history for this message
Launchpad Janitor (janitor) wrote :

Status changed to 'Confirmed' because the bug affects multiple users.

Changed in virtualbox (Ubuntu Bionic):
status: New → Confirmed
Changed in virtualbox (Ubuntu):
status: New → Confirmed
Changed in virtualbox-ext-pack (Ubuntu Bionic):
status: New → Confirmed
Changed in virtualbox-ext-pack (Ubuntu):
status: New → Confirmed
Changed in virtualbox-guest-additions-iso (Ubuntu Bionic):
status: New → Confirmed
Changed in virtualbox-guest-additions-iso (Ubuntu):
status: New → Confirmed
Revision history for this message
Łukasz Zemczak (sil2100) wrote : Please test proposed package

Hello Connor, or anyone else affected,

Accepted virtualbox into bionic-proposed. The package will build now and be available at https://launchpad.net/ubuntu/+source/virtualbox/5.2.32-dfsg-0~ubuntu18.04.1 in a few hours, and then in the -proposed repository.

Please help us by testing this new package. See https://wiki.ubuntu.com/Testing/EnableProposed for documentation on how to enable and use -proposed. Your feedback will aid us getting this update out to other Ubuntu users.

If this package fixes the bug for you, please add a comment to this bug, mentioning the version of the package you tested and change the tag from verification-needed-bionic to verification-done-bionic. If it does not fix the bug for you, please add a comment stating that, and change the tag to verification-failed-bionic. In either case, without details of your testing we will not be able to proceed.

Further information regarding the verification process can be found at https://wiki.ubuntu.com/QATeam/PerformingSRUVerification . Thank you in advance for helping!

N.B. The updated package will be released to -updates after the bug(s) fixed by this package have been verified and the package has been in -proposed for a minimum of 7 days.

Changed in virtualbox (Ubuntu Bionic):
status: Confirmed → Fix Committed
tags: added: verification-needed verification-needed-bionic
Revision history for this message
Łukasz Zemczak (sil2100) wrote :

Hello Connor, or anyone else affected,

Accepted virtualbox-hwe into bionic-proposed. The package will build now and be available at https://launchpad.net/ubuntu/+source/virtualbox-hwe/5.2.32-dfsg-0~ubuntu18.04.1 in a few hours, and then in the -proposed repository.

Please help us by testing this new package. See https://wiki.ubuntu.com/Testing/EnableProposed for documentation on how to enable and use -proposed. Your feedback will aid us getting this update out to other Ubuntu users.

If this package fixes the bug for you, please add a comment to this bug, mentioning the version of the package you tested and change the tag from verification-needed-bionic to verification-done-bionic. If it does not fix the bug for you, please add a comment stating that, and change the tag to verification-failed-bionic. In either case, without details of your testing we will not be able to proceed.

Further information regarding the verification process can be found at https://wiki.ubuntu.com/QATeam/PerformingSRUVerification . Thank you in advance for helping!

N.B. The updated package will be released to -updates after the bug(s) fixed by this package have been verified and the package has been in -proposed for a minimum of 7 days.

Changed in virtualbox-hwe (Ubuntu Bionic):
status: In Progress → Fix Committed
Changed in virtualbox-ext-pack (Ubuntu Bionic):
status: Confirmed → Fix Committed
Revision history for this message
Łukasz Zemczak (sil2100) wrote :

Hello Connor, or anyone else affected,

Accepted virtualbox-ext-pack into bionic-proposed. The package will build now and be available at https://launchpad.net/ubuntu/+source/virtualbox-ext-pack/5.2.32-1~ubuntu18.04.1 in a few hours, and then in the -proposed repository.

Please help us by testing this new package. See https://wiki.ubuntu.com/Testing/EnableProposed for documentation on how to enable and use -proposed. Your feedback will aid us getting this update out to other Ubuntu users.

If this package fixes the bug for you, please add a comment to this bug, mentioning the version of the package you tested and change the tag from verification-needed-bionic to verification-done-bionic. If it does not fix the bug for you, please add a comment stating that, and change the tag to verification-failed-bionic. In either case, without details of your testing we will not be able to proceed.

Further information regarding the verification process can be found at https://wiki.ubuntu.com/QATeam/PerformingSRUVerification . Thank you in advance for helping!

N.B. The updated package will be released to -updates after the bug(s) fixed by this package have been verified and the package has been in -proposed for a minimum of 7 days.

Changed in virtualbox-guest-additions-iso (Ubuntu Bionic):
status: Confirmed → Fix Committed
Revision history for this message
Łukasz Zemczak (sil2100) wrote :

Hello Connor, or anyone else affected,

Accepted virtualbox-guest-additions-iso into bionic-proposed. The package will build now and be available at https://launchpad.net/ubuntu/+source/virtualbox-guest-additions-iso/5.2.32-1~ubuntu18.04.1 in a few hours, and then in the -proposed repository.

Please help us by testing this new package. See https://wiki.ubuntu.com/Testing/EnableProposed for documentation on how to enable and use -proposed. Your feedback will aid us getting this update out to other Ubuntu users.

If this package fixes the bug for you, please add a comment to this bug, mentioning the version of the package you tested and change the tag from verification-needed-bionic to verification-done-bionic. If it does not fix the bug for you, please add a comment stating that, and change the tag to verification-failed-bionic. In either case, without details of your testing we will not be able to proceed.

Further information regarding the verification process can be found at https://wiki.ubuntu.com/QATeam/PerformingSRUVerification . Thank you in advance for helping!

N.B. The updated package will be released to -updates after the bug(s) fixed by this package have been verified and the package has been in -proposed for a minimum of 7 days.

Mathew Hodson (mhodson)
Changed in virtualbox (Ubuntu):
status: Confirmed → Fix Released
Changed in virtualbox-ext-pack (Ubuntu):
status: Confirmed → Fix Released
Changed in virtualbox-guest-additions-iso (Ubuntu):
status: Confirmed → Fix Released
Revision history for this message
Gianfranco Costamagna (costamagnagianfranco) wrote :

vboxguest.ko:
Running module version sanity check.
 - Original module
 - Installation
   - Installing to /lib/modules/5.0.0-21-generic/updates/dkms/

vboxsf.ko:
Running module version sanity check.
 - Original module
 - Installation
   - Installing to /lib/modules/5.0.0-21-generic/updates/dkms/

vboxvideo.ko:
Running module version sanity check.
 - Original module
 - Installation
   - Installing to /lib/modules/5.0.0-21-generic/updates/dkms/

depmod...

DKMS: install completed.

tags: added: verification-done verification-done-bionic
removed: verification-needed verification-needed-bionic
Revision history for this message
Gianfranco Costamagna (costamagnagianfranco) wrote :

The fix worked like a charm, however, due to the massive number of changes, I would prefer to wait some more days, to see if regressions are spot.

Revision history for this message
Simon Iremonger (ubuntu-iremonger) wrote :

I can confirm Virtualbox 5.2.32 working at least as well as 5.2.18, but now builds on newer kernels. I note this also fixes some security vulnerabilities.

Revision history for this message
Sim Brody (sim-bro) wrote :

VirtualBox v5.2.32 is now working for me too, following this update.

Revision history for this message
Erk (erkm) wrote :

Today I got an update to 5.0.0-23-generic and the VirtualBox 5.2.18_Ubuntu r123745 no longer works.

Revision history for this message
Erk (erkm) wrote :

I tried to install virtualbox/bionic-proposed but it fails:

Setting up virtualbox (5.2.32-dfsg-0~ubuntu18.04.1) ...
vboxweb.service is a disabled or a static unit not running, not starting it.
Job for virtualbox.service failed because the control process exited with error code.
See "systemctl status virtualbox.service" and "journalctl -xe" for details.
invoke-rc.d: initscript virtualbox, action "restart" failed.
● virtualbox.service - LSB: VirtualBox Linux kernel module
   Loaded: loaded (/etc/init.d/virtualbox; generated)
   Active: failed (Result: exit-code) since Fri 2019-08-02 14:46:24 CEST; 5ms ago
     Docs: man:systemd-sysv-generator(8)
  Process: 26680 ExecStart=/etc/init.d/virtualbox start (code=exited, status=1/FAILURE)

Aug 02 14:46:24 systemd[1]: Starting LSB: VirtualBox Linux kernel module...
Aug 02 14:46:24 virtualbox[26680]: * Loading VirtualBox kernel modules...
Aug 02 14:46:24 virtualbox[26680]: * No suitable module for running kernel found
Aug 02 14:46:24 virtualbox[26680]: ...fail!
Aug 02 14:46:24 systemd[1]: virtualbox.service: Control process exited, code=exited status=1
Aug 02 14:46:24 systemd[1]: virtualbox.service: Failed with result 'exit-code'.
Aug 02 14:46:24 systemd[1]: Failed to start LSB: VirtualBox Linux kernel module.

Revision history for this message
Gianfranco Costamagna (costamagnagianfranco) wrote :

@Erk please update dkms with the version in proposed ( 2.3-3ubuntu9.5 )
and then try to install virtualbox-dkms again.

thanks

Revision history for this message
Gianfranco Costamagna (costamagnagianfranco) wrote :

btw the log error you posted above is not useful, the dkms build is before that part

Revision history for this message
Erk (erkm) wrote :

@costamagnagianfranco thanks a lot! The following worked for me:

sudo apt-get install dkms/bionic-proposed
sudo apt-get install virtualbox-dkms/bionic-proposed
sudo apt-get install virtualbox-qt/bionic-proposed

Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package virtualbox - 5.2.32-dfsg-0~ubuntu18.04.1

---------------
virtualbox (5.2.32-dfsg-0~ubuntu18.04.1) bionic; urgency=medium

  * SRU the latest package for bionic (LP: #1835576, LP: #1829248)
  [ Connor Kuehl ]
  * Fix build for Linux 5.0 (LP: #1835576)
    - debian/patches/ubuntu-0001-linux-5.0-compat.patch
    - debian/patches/ubuntu-0002-linux-5.0-move-ms-remount.patch
    - debian/patches/ubuntu-0003-linux-5.0-make-driver-work-with-Linux-5.0.patch
    - debian/patches/ubuntu-0004-drop-FBINFO_CAN_FORCE_OUTPUT-flag.patch
    - debian/patches/ubuntu-0005-switch-to-drm_get-drm_put-helpers.patch
    - debian/patches/ubuntu-0006-fixup-vboxvideo-module-include.patch
    - debian/patches/ubuntu-0007-update-connector-functions.patch

  [ Gianfranco Costamagna ]
  * Do not apply patches ubuntu-000{1,2,3,4,5,7], because they are included in
    this upstream release
  * New upstream release, update postinst.
  * CVE fixes
    - CVE-2019-2656
    - CVE-2019-2680
    - CVE-2019-2696
    - CVE-2019-2703
    - CVE-2019-2721
    - CVE-2019-2722
    - CVE-2019-2723
    - CVE-2019-2657
    - CVE-2019-2690
    - CVE-2019-2679
    - CVE-2019-2678
    - CVE-2019-2574
  * Drop patches useless with this new upstream release:
    - 18-system-xorg.patch
    - new-gcc.patch
    - kernel-4.18.patch
    - fix-guest-to-host-escape-vulnerability.patch
  * Cherry-pick some fixes from Debian git master branch
    - Enable full hardening
    - automatically detect wsimport from the system
    - bump std-version to 4.3.0
    - Add suid bit to VBoxNetNat to make it work (LP: #1805651)
    - Finally relax dh_strip hack
    - Relax some version constraints, already fullfilled since o-o-stable
    - use cafe instead of beef, to detect if we are inside a VM to fix
      copy-paste.
    - Start VBoxClient too, with the right --vmsvga flag, to fix screen resize
    - Switch to java11, that changed everything (Closes: #920723)
      - add new jaxw dependencies.
    - Switch from iasl to the new acpica-tools name
    - Implement DEB_BUILD_OPTIONS=parallel=n handling during build
      (Closes: #924302)

 -- Gianfranco Costamagna <email address hidden> Thu, 18 Apr 2019 09:30:21 +0200

Changed in virtualbox (Ubuntu Bionic):
status: Fix Committed → Fix Released
Revision history for this message
Andy Whitcroft (apw) wrote : Update Released

The verification of the Stable Release Update for virtualbox has completed successfully and the package has now been released to -updates. Subsequently, the Ubuntu Stable Release Updates Team is being unsubscribed and will not receive messages about this bug report. In the event that you encounter a regression using the package from -updates please report a new bug using ubuntu-bug and tag the bug report regression-update so we can easily find any regressions.

Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package virtualbox-hwe - 5.2.32-dfsg-0~ubuntu18.04.1

---------------
virtualbox-hwe (5.2.32-dfsg-0~ubuntu18.04.1) bionic; urgency=medium

  * SRU latest upstream release to bionic

virtualbox (5.2.32-dfsg-0~ubuntu18.04.1) bionic; urgency=medium

  * SRU the latest package for bionic (LP: #1835576, LP: #1829248)
  [ Connor Kuehl ]
  * Fix build for Linux 5.0 (LP: #1835576)
    - debian/patches/ubuntu-0001-linux-5.0-compat.patch
    - debian/patches/ubuntu-0002-linux-5.0-move-ms-remount.patch
    - debian/patches/ubuntu-0003-linux-5.0-make-driver-work-with-Linux-5.0.patch
    - debian/patches/ubuntu-0004-drop-FBINFO_CAN_FORCE_OUTPUT-flag.patch
    - debian/patches/ubuntu-0005-switch-to-drm_get-drm_put-helpers.patch
    - debian/patches/ubuntu-0006-fixup-vboxvideo-module-include.patch
    - debian/patches/ubuntu-0007-update-connector-functions.patch

  [ Gianfranco Costamagna ]
  * Do not apply patches ubuntu-000{1,2,3,4,5,7], because they are included in
    this upstream release
  * New upstream release, update postinst.
  * CVE fixes
    - CVE-2019-2656
    - CVE-2019-2680
    - CVE-2019-2696
    - CVE-2019-2703
    - CVE-2019-2721
    - CVE-2019-2722
    - CVE-2019-2723
    - CVE-2019-2657
    - CVE-2019-2690
    - CVE-2019-2679
    - CVE-2019-2678
    - CVE-2019-2574
  * Drop patches useless with this new upstream release:
    - 18-system-xorg.patch
    - new-gcc.patch
    - kernel-4.18.patch
    - fix-guest-to-host-escape-vulnerability.patch
  * Cherry-pick some fixes from Debian git master branch
    - Enable full hardening
    - automatically detect wsimport from the system
    - bump std-version to 4.3.0
    - Add suid bit to VBoxNetNat to make it work (LP: #1805651)
    - Finally relax dh_strip hack
    - Relax some version constraints, already fullfilled since o-o-stable
    - use cafe instead of beef, to detect if we are inside a VM to fix
      copy-paste.
    - Start VBoxClient too, with the right --vmsvga flag, to fix screen resize
    - Switch to java11, that changed everything (Closes: #920723)
      - add new jaxw dependencies.
    - Switch from iasl to the new acpica-tools name
    - Implement DEB_BUILD_OPTIONS=parallel=n handling during build
      (Closes: #924302)

 -- Gianfranco Costamagna <email address hidden> Sat, 13 Jul 2019 15:53:11 +0200

Changed in virtualbox-hwe (Ubuntu Bionic):
status: Fix Committed → Fix Released
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package virtualbox-ext-pack - 5.2.32-1~ubuntu18.04.1

---------------
virtualbox-ext-pack (5.2.32-1~ubuntu18.04.1) bionic; urgency=medium

  * SRU the latest package for bionic (LP: #1835576, LP: #1829248)
  * New upstream release, update postinst.

 -- Gianfranco Costamagna <email address hidden> Sat, 13 Jul 2019 15:23:57 +0200

Changed in virtualbox-ext-pack (Ubuntu Bionic):
status: Fix Committed → Fix Released
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package virtualbox-guest-additions-iso - 5.2.32-1~ubuntu18.04.1

---------------
virtualbox-guest-additions-iso (5.2.32-1~ubuntu18.04.1) bionic; urgency=medium

  * SRU the latest package for bionic (LP: #1835576, LP: #1829248)
  * New upstream release

 -- Gianfranco Costamagna <email address hidden> Sat, 13 Jul 2019 15:29:13 +0200

Changed in virtualbox-guest-additions-iso (Ubuntu Bionic):
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.