Page MenuHomeFreeBSD

kern linker: Do not retry loading modules on EEXIST
ClosedPublic

Authored by zlei on Nov 6 2023, 9:53 AM.
Tags
None
Referenced Files
F102682074: D42474.diff
Fri, Nov 15, 7:28 PM
Unknown Object (File)
Thu, Oct 17, 12:51 AM
Unknown Object (File)
Thu, Oct 17, 12:50 AM
Unknown Object (File)
Thu, Oct 17, 12:50 AM
Unknown Object (File)
Wed, Oct 16, 11:45 PM
Unknown Object (File)
Sep 26 2024, 12:20 PM
Unknown Object (File)
Sep 19 2024, 1:08 AM
Unknown Object (File)
Sep 15 2024, 8:41 AM
Subscribers

Details

Summary

LINKER_LOAD_FILE() will call linker_load_dependencies() which would
return EEXIST in case the module has been already compiled into the
kernel. Since we now recognize the module class then there is no need
to retry loading with a different linker, otherwise userland will get
a misleading error ENOEXEC.

PR: 274936
MFC after: 2 weeks

Test Plan

Load modules that are compiled into kernel, verify the output of kldload.

# kldload virtio.ko
kldload: can't load virtio.ko: module already loaded or in kernel

Or

# kldload -n virtio.ko && echo "virtio.ko loaded"
virtio.ko loaded

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Skipped
Unit
Tests Skipped