Skip to content

Guest Additions 7.2.8: incomplete RHEL 9.8 kernel compat — from_timer and struct_mutex build failures #689

@fistilis

Description

@fistilis

Summary

VirtualBox Guest Additions 7.2.8 fails to build kernel modules on RHEL 9.8 (kernel 5.14.0-687.10.1.el9_8.x86_64). The RHEL 9.8 fixes introduced in 7.2.6 (gh-467) are incomplete — some RTLNX_RHEL_RANGE version checks were updated to include (9,8, 9,99) but several others were missed.

Environment

  • Host OS: Windows (VirtualBox 7.2.8)
  • Guest OS: RHEL 9.8 (kernel 5.14.0-687.10.1.el9_8.x86_64)
  • Guest Additions version: 7.2.8

Build errors

Error 1: from_timer removed (timer API)

r0drv/linux/timer-r0drv-linux.c:754:37: error: implicit declaration of function 'from_timer'

RHEL 9.8 backported the timer_container_of replacement for from_timer (upstream 6.16), but line 751 only checks RTLNX_VER_MIN(6,16,0) || RTLNX_RHEL_RANGE(10,2, 10,99).

Error 2: struct_mutex removed (DRM)

vbox_main.c:693:28: error: 'struct drm_device' has no member named 'struct_mutex'

RHEL 9.8 backported the struct_mutex removal (upstream 6.18), but lines 484, 686 in vbox_main.c and line 305 in vbox_drv.h only check RTLNX_VER_MIN(6,18,0) || RTLNX_RHEL_RANGE(10,2, 10,99).

Lines already fixed vs missed

Already have RTLNX_RHEL_RANGE(9,8, 9,99) (from the 7.2.6 fix):

  • vboxvideo/vbox_main.c:179
  • vboxvideo/vbox_main.c:200

Missing RTLNX_RHEL_RANGE(9,8, 9,99):

  • vboxvideo/vbox_main.c:484 — struct_mutex init
  • vboxvideo/vbox_main.c:686 — struct_mutex usage
  • vboxvideo/vbox_drv.h:305 — struct_mutex declaration
  • vboxguest/r0drv/linux/timer-r0drv-linux.c:425 — timer_delete
  • vboxguest/r0drv/linux/timer-r0drv-linux.c:477 — timer_delete_sync
  • vboxguest/r0drv/linux/timer-r0drv-linux.c:751 — timer_container_of / from_timer
  • vboxguest/r0drv/linux/timer-r0drv-linux.c:1641 — hrtimer_setup

Workaround

Adding || RTLNX_RHEL_RANGE(9,8, 9,99) to all the missed conditionals and rebuilding with /sbin/rcvboxadd quicksetup resolves the build failures.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions