kern/71388: panic due mac_policy_list_conditional_busy called
before mac_init
Dan Lukes
dan at obluda.cz
Sat Sep 4 22:40:22 PDT 2004
>Number: 71388
>Category: kern
>Synopsis: panic due mac_policy_list_conditional_busy called before mac_init
>Confidential: no
>Severity: non-critical
>Priority: low
>Responsible: freebsd-bugs
>State: open
>Quarter:
>Keywords:
>Date-Required:
>Class: sw-bug
>Submitter-Id: current-users
>Arrival-Date: Sun Sep 05 05:40:20 GMT 2004
>Closed-Date:
>Last-Modified:
>Originator: Dan Lukes
>Release: FreeBSD 5.3-BETA3 i386
>Organization:
Obludarium
>Environment:
System: FreeBSD 5.3-BETA3 #5: Sun Sep 5 05:30:03 CEST 2004 /usr/obj/usr/src/sys/Dan i386
cvsup of RELENG_5 on Sep 5 01:55 CEST
src/sys/kern/kern_mac.c,v 1.113 2004/07/15 08:26:05 phk
option MAC within kernel configuration file;
no other MAC_* options nor modules
SMP, ACPI
a kernel loadable module with an external reference that can't be resolved
by linker
>Description:
On the start of boot, when linker link the preloaded modules,
including the one with unresolvable external reference, the system paniced:
panic: mtx_lock() of spin mutex (null) @ /usr/src/sys/kern/kern_mac.c:239
>How-To-Repeat:
Preload module that has unresolvable reference
(for example, if_fxp when miibus.ko unavaiable) on boot (kernel with MAC
compiled-in)
>Fix:
I'm sorry, no exact fix hint.
The relevant part of source:
src/sys/kern/kern_mac.c:
233: int
234: mac_policy_list_conditional_busy(void)
235: {
236: #ifndef MAC_STATIC
237: int ret;
238:
239: mtx_lock(&mac_policy_mtx);
The mac_policy_mtx is NULL as mac_init has not been called yet.
The mac_policy_list_conditional_busy is called from
mac_check_kld_unload via MAC_CHECK macro.
Althought I have no back-trace, the caller of mac_check_kld_unload
seems to be link_elf_link_preload via linker_file_unload.
I'm not sure about the best place to test that the MAC layer is not
initialized yet. May be mac_policy_list_conditional_busy should return error
when called with mac_policy_mtx==NULL
>Release-Note:
>Audit-Trail:
>Unformatted:
More information about the freebsd-bugs
mailing list