module_register_init error 12
Robert Watson
rwatson at FreeBSD.org
Sat Oct 30 21:07:24 GMT 2004
On Sat, 30 Oct 2004, sam wun wrote:
> I have added "options MAC" in the kernel configuration file of FreeBSD
> RC1 kernel source, and have successfully built a new kernel with this
> option.
>
> However when the system starting up, it shows up the following messages:
>
> kernel: KLD mac_partition.ko: depends on kernel_mac_support - not
> available
>
> kernel: KLD mac_lomac.ko: depends on kernel_mac_support - not available
There appears to be a bug in 5.3-RC1 due to a change in the way CV's are
implemented that prevents "early" loaded modules from properly
registering. I'm not sure it is the same bug you're seeing, however.
I've corrected the known bug, and will merge the fix to the RELENG_5_*
branches so that it's in RC2 shortly. I've attached the patch below.
Could you let me know if it also resolves the problem that you are seeing?
Robert N M Watson FreeBSD Core Team, TrustedBSD Projects
robert at fledge.watson.org Principal Research Scientist, McAfee Research
Index: kern_mac.c
===================================================================
RCS file: /home/ncvs/src/sys/kern/kern_mac.c,v
retrieving revision 1.113
retrieving revision 1.114
diff -u -r1.113 -r1.114
--- kern_mac.c 15 Jul 2004 08:26:05 -0000 1.113
+++ kern_mac.c 30 Oct 2004 14:20:59 -0000 1.114
@@ -188,6 +188,9 @@
{
#ifndef MAC_STATIC
+ if (!mac_late)
+ return;
+
WITNESS_WARN(WARN_GIANTOK | WARN_SLEEPOK, NULL,
"mac_policy_grab_exclusive() at %s:%d", __FILE__, __LINE__);
mtx_lock(&mac_policy_mtx);
@@ -201,6 +204,9 @@
{
#ifndef MAC_STATIC
+ if (!mac_late)
+ return;
+
mtx_assert(&mac_policy_mtx, MA_OWNED);
KASSERT(mac_policy_count == 0,
("mac_policy_assert_exclusive(): not exclusive"));
@@ -212,6 +218,9 @@
{
#ifndef MAC_STATIC
+ if (!mac_late)
+ return;
+
KASSERT(mac_policy_count == 0,
("mac_policy_release_exclusive(): not exclusive"));
mtx_unlock(&mac_policy_mtx);
@@ -224,6 +233,9 @@
{
#ifndef MAC_STATIC
+ if (!mac_late)
+ return;
+
mtx_lock(&mac_policy_mtx);
mac_policy_count++;
mtx_unlock(&mac_policy_mtx);
@@ -236,6 +248,9 @@
#ifndef MAC_STATIC
int ret;
+ if (!mac_late)
+ return (1);
+
mtx_lock(&mac_policy_mtx);
if (!LIST_EMPTY(&mac_policy_list)) {
mac_policy_count++;
@@ -245,6 +260,9 @@
mtx_unlock(&mac_policy_mtx);
return (ret);
#else
+ if (!mac_late)
+ return (1);
+
return (1);
#endif
}
@@ -254,6 +272,9 @@
{
#ifndef MAC_STATIC
+ if (!mac_late)
+ return;
+
mtx_lock(&mac_policy_mtx);
mac_policy_count--;
KASSERT(mac_policy_count >= 0, ("MAC_POLICY_LIST_LOCK"));
To Unsubscribe: send mail to majordomo at trustedbsd.org
with "unsubscribe trustedbsd-discuss" in the body of the message
More information about the trustedbsd-discuss
mailing list