Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 08 Oct 2016 20:41:02 +0000
From:      bugzilla-noreply@freebsd.org
To:        freebsd-bugs@FreeBSD.org
Subject:   [Bug 213315] MODULE_DEPENDs are satisfied by modules that fail MOD_LOAD
Message-ID:  <bug-213315-8@https.bugs.freebsd.org/bugzilla/>

next in thread | raw e-mail | index | archive | help
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D213315

            Bug ID: 213315
           Summary: MODULE_DEPENDs are satisfied by modules that fail
                    MOD_LOAD
           Product: Base System
           Version: CURRENT
          Hardware: Any
                OS: Any
            Status: New
          Severity: Affects Only Me
          Priority: ---
         Component: kern
          Assignee: freebsd-bugs@FreeBSD.org
          Reporter: cem@freebsd.org

This seems undesirable.

Consider a kernel object (KO1) that contains two modules, A and B.  If MOD_=
LOAD
succeeds for A and fails for B, KO1 is kept loaded and both A and B appear =
on
kern_linker.c's `found_modules` list.

Because B failed to load, only A appears on kern_module.c's `modules` list.

After this, a second kernel object (KO2) that contains a module C is loaded=
.  C
has a MODULE_DEPEND on B.  Because B is still on `found_modules`, C is allo=
wed
to load.  It may fail to probe or panic if it assumes B is actually present.

Maybe that's not the promise MODULE_DEPEND makes.  But it would be nice if =
it
was.

The common case of one module per ko is already handled by the runtime load=
er
(and proposed patch to do the same in the preload linker is on phabricator:
https://reviews.freebsd.org/D8200 ).  (If the linker detects that all modul=
es
in a KO failed to MOD_LOAD, the entire KO is unloaded.)

Fixing this just for runtime module loading maybe isn't too hard.  Load one
module at a time and only put successful modules (already maintained in
lf->modules) on the `found_modules` global list.

Solving this generally for preloaded kernel objects is more difficult, at l=
east
without changing how preloaded KO sysinits are run.  I'm not sure changing =
that
is a real problem, though.

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



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