Subject: Re: lkm problems...
To: None <>
From: Mike Long <>
List: current-users
Date: 11/21/1995 13:06:37
>Date: Tue, 21 Nov 1995 02:26:51 -0500
>From: Frank Dana <>

>The only problem I had, other than needing to hack the code a little, is
>that I _could_not_ do the modload from within multi-user mode. Even su'd
>to root on the console, I got an erro from modload that it "could not
>allocate memory: Operation mnot permitted." after which it did an exit(9);

This is a security feature.  You don't want random lusers loading LKMs
because LKMs can do _anything_ to kernel internals.

It seems strange that it's failing even when you su to root, though.
Maybe the LKM driver is checking the ruid when it should be checking
the euid?  Look for the UID check in /sys/kern/kern_lkm.c.

>Is there an easier way? Some device I need to reconfigure or something?
>The modload and lkm manpages weren't of any help.

The easiest workaround is to add 'options INSECURE' to your kernel
config and rebuild.

I have no problems loading XFree86's aperture driver from
/etc/rc.local, even though I don't use 'options INSECURE'.  You may
have similar success with the amiga audio LKM.

WARNING: If you load LKMs from /etc/rc{,.local} and then boot with a
kernel other than /netbsd, your kernel may panic!  The reason is that
modload links the LKM against /netbsd by default, and if /netbsd isn't
the running kernel Bad Things may happen.  Solution: boot single-user
if you have to boot from a kernel other than /netbsd.
Mike Long <> 
VLSI Design Engineer         finger for PGP public key
Analog Devices, CPD Division          CCBF225E7D3F7ECB2C8F7ABB15D9BE7B
Norwood, MA 02062 USA                assert(*this!=opinionof(Analog));