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)
Tue, Nov 25, 7:26 PM
Unknown Object (File)
Mon, Nov 24, 10:38 PM
Unknown Object (File)
Tue, Nov 18, 2:15 AM
Unknown Object (File)
Sat, Nov 15, 11:26 PM
Unknown Object (File)
Fri, Nov 14, 11:43 PM
Unknown Object (File)
Thu, Nov 13, 2:12 AM
Unknown Object (File)
Sat, Nov 8, 11:19 AM
Unknown Object (File)
Tue, Nov 4, 10:55 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