Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 13 May 2026 22:10:25 +0000
From:      bugzilla-noreply@freebsd.org
To:        bugs@FreeBSD.org
Subject:   [Bug 295139] 'kldload vboxdrv.ko' fails with 'kernel module was loaded and unloaded it can't be loaded again' when the real problem is 'version mismatch'
Message-ID:  <bug-295139-227-gd3N2OBZZw@https.bugs.freebsd.org/bugzilla/>
In-Reply-To: <bug-295139-227@https.bugs.freebsd.org/bugzilla/>

index | next in thread | previous in thread | raw e-mail

https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=295139

Jim Chen <jim.chen.1827@gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |jim.chen.1827@gmail.com

--- Comment #2 from Jim Chen <jim.chen.1827@gmail.com> ---
Created attachment 270705
  --> https://bugs.freebsd.org/bugzilla/attachment.cgi?id=270705&action=edit
Suggested patch

I believe the bug is caused by a failure to verify that an already-loaded
module (in this case "kernel") satisfies the version requirements.

linker_load_module in /sys/kern/kern_loader.c misdiagnoses the failure to load
as EEXISTS; regardless, linker_load_dependencies does not explicitly check the
error type and (correctly) logs:
> KLD vboxdrv.ko: depends on kernel - not available or version mismatch
Afterwards, the incorrect error code is passed up to kldload(8), which prints
the incorrect message to the terminal.

Whenever a similar case is reached, the error ENOENT is raised, so in my
attached patch, I have done the same. However, I think that ENOEXEC might be
more semantically correct in this case. I'd appreciate any input, including
whether or not it would be reasonable to edit other parts of the source
accordingly.

Thanks!

-- 
You are receiving this mail because:
You are the assignee for the bug.

home | help

Want to link to this message? Use this
URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?bug-295139-227-gd3N2OBZZw>