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
Unknown Object (File)
Sun, Apr 28, 9:57 PM
Unknown Object (File)
Sat, Apr 27, 9:03 PM
Unknown Object (File)
Jan 15 2024, 11:23 AM
Unknown Object (File)
Dec 26 2023, 11:51 PM
Unknown Object (File)
Dec 23 2023, 3:02 AM
Unknown Object (File)
Dec 19 2023, 8:25 PM
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 Not Applicable
Unit
Tests Not Applicable