From owner-freebsd-bugs@freebsd.org Sat Oct 8 20:41:02 2016 Return-Path: Delivered-To: freebsd-bugs@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6EE3BC06320 for ; Sat, 8 Oct 2016 20:41:02 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from kenobi.freebsd.org (kenobi.freebsd.org [IPv6:2001:1900:2254:206a::16:76]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 46744982 for ; Sat, 8 Oct 2016 20:41:02 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from bugs.freebsd.org ([127.0.1.118]) by kenobi.freebsd.org (8.15.2/8.15.2) with ESMTP id u98Kf2Lk093889 for ; Sat, 8 Oct 2016 20:41:02 GMT (envelope-from bugzilla-noreply@freebsd.org) From: bugzilla-noreply@freebsd.org To: freebsd-bugs@FreeBSD.org Subject: [Bug 213315] MODULE_DEPENDs are satisfied by modules that fail MOD_LOAD Date: Sat, 08 Oct 2016 20:41:02 +0000 X-Bugzilla-Reason: AssignedTo X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: Base System X-Bugzilla-Component: kern X-Bugzilla-Version: CURRENT X-Bugzilla-Keywords: X-Bugzilla-Severity: Affects Only Me X-Bugzilla-Who: cem@freebsd.org X-Bugzilla-Status: New X-Bugzilla-Resolution: X-Bugzilla-Priority: --- X-Bugzilla-Assigned-To: freebsd-bugs@FreeBSD.org X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: bug_id short_desc product version rep_platform op_sys bug_status bug_severity priority component assigned_to reporter Message-ID: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: https://bugs.freebsd.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-BeenThere: freebsd-bugs@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 08 Oct 2016 20:41:02 -0000 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.=