freebsd-dev/sys/kern
Bill Paul f13524346b Fix module handling to stop oddball modules (if_ppp_mod, if_sl_mod,
if_tun_mod, etc...) from crashing the system. These modules are useful,
but because they don't yet have proper load()/unload() functions,
they can lead to panics: if, for example, you load the if_ppp module,
any user can panic the system by running modstat.

You can also hang the system outright if you try to unload the PPP
module too.

Changes are as follows:

- Save the name passed to us during the RESERVE stage for name matching
(we can't load if_ppp_mod twice: we've have two ppp0's and two ppp1's,
which is beyond strange). This makes the lkmexists() cheks somewhat
redundant, but there's no way around it that I can see.

- If we call the module entry point and find that we have no lkm_any
structure in our 'private' section, create a fake one. This keeps
modstat happy. We mark such modules as LM_UNKNOWN.

- Don't allow LM_UNLOAD modules to be unloaded: it just ain't
possible. (Unless someone wants to write a pppunattach() function. :( )

- In lkmunreserve(), mark private.lkm_any as NULL so we don't get
confused later. I think this is bogus, but I can't prove it.

XXX: the name matching used to keep the user from loading two
instances of the same module can easily be defeated simply by
changing the module name or, in the case of the oddball modules,
simply by renaming the module files. I haven't found a nice simple
way to tell one module from another.
1995-04-18 02:29:26 +00:00
..
imgact_aout.c Add and move declarations to fix all of the warnings from `gcc -Wimplicit' 1995-03-16 18:17:34 +00:00
imgact_gzip.c Add and move declarations to fix all of the warnings from `gcc -Wimplicit' 1995-03-16 18:17:34 +00:00
imgact_shell.c While in the real world, I had a bad case of being swapped out for a lot of 1994-09-25 19:34:02 +00:00
inflate.c Changes needed for kzip to work. 1995-04-15 06:54:13 +00:00
init_main.c Changes to make FreeBSD use a CDROM as rootdev, for installation purposes. 1995-04-10 07:44:31 +00:00
init_sysent.c Added a third "flags" argument to msync() ...as other systems have. 1995-03-25 16:52:24 +00:00
kern_acct.c All of this is cosmetic. prototypes, #includes, printfs and so on. Makes 1994-10-02 17:35:40 +00:00
kern_clock.c Add and move declarations to fix all of the warnings from `gcc -Wimplicit' 1995-03-16 18:17:34 +00:00
kern_descrip.c Add and move declarations to fix all of the warnings from `gcc -Wimplicit' 1995-03-28 07:58:53 +00:00
kern_devconf.c Actually copy the class field over from the kernel to the user structure. 1995-04-13 15:33:14 +00:00
kern_exec.c Use 'p' rather than 'curproc' when appropriate. 1995-03-25 01:34:21 +00:00
kern_exit.c Add and move declarations to fix all of the warnings from `gcc -Wimplicit' 1995-03-16 18:17:34 +00:00
kern_fork.c Add and move declarations to fix all of the warnings from `gcc -Wimplicit' 1995-03-16 18:17:34 +00:00
kern_ktrace.c All of this is cosmetic. prototypes, #includes, printfs and so on. Makes 1994-10-02 17:35:40 +00:00
kern_lkm.c Fix module handling to stop oddball modules (if_ppp_mod, if_sl_mod, 1995-04-18 02:29:26 +00:00
kern_lockf.c Changed some variable names in lf_addblock to make the code both 1994-10-25 11:27:51 +00:00
kern_malloc.c Make vegetarian and animal rights people happy and use 0xdeadc0de instead 1995-04-16 11:25:15 +00:00
kern_ntptime.c Add vm/vm.h for complete sysctl type. 1994-09-19 17:39:21 +00:00
kern_physio.c Add and move declarations to fix all of the warnings from `gcc -Wimplicit' 1995-03-16 18:17:34 +00:00
kern_proc.c Cosmetics. related to getting prototypes into view. 1994-10-10 01:00:49 +00:00
kern_prot.c Added ifdef COMPAT_IBCS2 around setre[ug]id. 1994-10-13 20:59:49 +00:00
kern_resource.c Implement maxprocperuid and maxfilesperproc. They are tunable 1995-02-20 19:42:42 +00:00
kern_sig.c Add and move declarations to fix all of the warnings from `gcc -Wimplicit' 1995-03-16 18:17:34 +00:00
kern_subr.c Added a few more entries to the list of prime numbers. 1995-04-09 01:19:25 +00:00
kern_synch.c Add and move declarations to fix all of the warnings from `gcc -Wimplicit' 1995-03-16 18:17:34 +00:00
kern_sysctl.c Add and move declarations to fix all of the warnings from `gcc -Wimplicit' 1995-03-16 18:17:34 +00:00
kern_tc.c Add and move declarations to fix all of the warnings from `gcc -Wimplicit' 1995-03-16 18:17:34 +00:00
kern_time.c Add and move declarations to fix all of the warnings from `gcc -Wimplicit' 1995-03-16 18:17:34 +00:00
kern_timeout.c Add and move declarations to fix all of the warnings from `gcc -Wimplicit' 1995-03-16 18:17:34 +00:00
kern_xxx.c Implemented a "TEXT_SET" called 'cleanup_set' which will be called before 1994-12-04 19:58:43 +00:00
Make.tags.inc Added $Id$ 1994-08-02 07:55:43 +00:00
Makefile Added namespace information for future pollution-control measures. 1994-09-13 00:48:26 +00:00
makesyscalls.sh Add and move declarations to fix all of the warnings from `gcc -Wimplicit' 1995-03-16 18:17:34 +00:00
md5c.c Clean a bunch of -Wall warnings. 1995-02-24 08:51:34 +00:00
subr_autoconf.c Added $Id$ 1994-08-02 07:55:43 +00:00
subr_clist.c Fix cblock starvation bugs by reserving enough cblocks for minimal 1994-11-26 19:24:13 +00:00
subr_disklabel.c Woops, add back that #define...it's used later in the file. 1995-03-18 07:06:51 +00:00
subr_diskmbr.c Add more compatibility cruft: 1995-03-25 12:07:31 +00:00
subr_diskslice.c Don't warn about missing labels for non-BSD slices. 1995-03-04 11:42:27 +00:00
subr_dkbad.c subr_diskslice.c implements everything related to slices and labels except 1994-12-12 00:20:34 +00:00
subr_log.c All of this is cosmetic. prototypes, #includes, printfs and so on. Makes 1994-10-02 17:35:40 +00:00
subr_param.c Implement maxprocperuid and maxfilesperproc. They are tunable 1995-02-20 19:42:42 +00:00
subr_prf.c Implement a simple hook (or hack?) to allow graphics device console 1995-04-08 21:32:11 +00:00
subr_prof.c Add and move declarations to fix all of the warnings from `gcc -Wimplicit' 1995-03-16 18:17:34 +00:00
subr_rlist.c Add and move declarations to fix all of the warnings from `gcc -Wimplicit' 1995-03-16 18:17:34 +00:00
subr_rmap.c Added $Id$ 1994-08-02 07:55:43 +00:00
subr_trap.c Added a new version of trap_pfault() that disallows kernel page faults 1995-03-21 07:16:12 +00:00
subr_xxx.c Added $Id$ 1994-08-02 07:55:43 +00:00
sys_generic.c Backed out previous change - it reduces performance. (oops). 1995-04-13 18:24:33 +00:00
sys_process.c Add and move declarations to fix all of the warnings from `gcc -Wimplicit' 1995-03-16 18:17:34 +00:00
sys_socket.c All of this is cosmetic. prototypes, #includes, printfs and so on. Makes 1994-10-02 17:35:40 +00:00
syscalls.c Add and move declarations to fix all of the warnings from `gcc -Wimplicit' 1995-03-16 18:17:34 +00:00
syscalls.master Added a third "flags" argument to msync() ...as other systems have. 1995-03-25 16:52:24 +00:00
sysv_ipc.c Added SYSV ipcs. 1994-09-13 14:47:38 +00:00
sysv_msg.c All of this is cosmetic. prototypes, #includes, printfs and so on. Makes 1994-10-02 17:35:40 +00:00
sysv_sem.c Use tsleep() rather than sleep so that 'ps' is more informative about 1994-10-06 21:07:04 +00:00
sysv_shm.c Use of vm_allocate() and vm_deallocate() has been deprecated. 1995-02-20 22:23:31 +00:00
tty_compat.c Extract "set" family functions to separate module, needed for 1995-04-11 17:54:25 +00:00
tty_conf.c Set it so you can add and remove line disciplines without replicating 1995-03-21 11:24:05 +00:00
tty_cons.c Implement a simple hook (or hack?) to allow graphics device console 1995-04-08 21:32:11 +00:00
tty_pty.c Call ptsstop in ptsclose instead of ptcwakeup 1995-04-10 01:45:43 +00:00
tty_snoop.c same 1995-02-27 19:47:53 +00:00
tty_subr.c Fix cblock starvation bugs by reserving enough cblocks for minimal 1994-11-26 19:24:13 +00:00
tty_tb.c Added $Id$ 1994-08-02 07:55:43 +00:00
tty_tty.c don't allow ctty to be set to ctty - infinite kernel recursion 1994-12-04 01:46:13 +00:00
tty.c Speed up ttnread() in the !(ICANON | ISIG) case by copying to user space 1995-04-15 21:04:58 +00:00
uipc_domain.c Submitted by: Wolfgang Stanglmeier <wolf@dentaro.GUN.de> 1995-01-05 19:51:51 +00:00
uipc_mbuf.c Special cased the handling of mb_map in the M_WAITOK case. kmem_malloc() 1995-03-15 07:52:06 +00:00
uipc_proto.c Added $Id$ 1994-08-02 07:55:43 +00:00
uipc_sockbuf.c All of this is cosmetic. prototypes, #includes, printfs and so on. Makes 1994-10-02 17:35:40 +00:00
uipc_socket2.c All of this is cosmetic. prototypes, #includes, printfs and so on. Makes 1994-10-02 17:35:40 +00:00
uipc_socket.c getsockopt(s, SOL_SOCKET, SO_SNDTIMEO, ...) would construct the returned 1995-02-16 01:07:43 +00:00
uipc_syscalls.c Add and move declarations to fix all of the warnings from `gcc -Wimplicit' 1995-03-16 18:17:34 +00:00
uipc_usrreq.c Fixed bug caused by attempting a connect with a null 'nam'. 1995-02-15 11:30:35 +00:00
vfs_bio.c Removed unused & empty bufstats() function. 1995-04-16 12:02:42 +00:00
vfs_cache.c Fixed serious off by one bug I introduced that will likely cause the 1995-04-15 00:49:35 +00:00
vfs_cluster.c Check for case of blkno already known to avoid unnecessary VOP_BMAP's. 1995-04-04 02:10:17 +00:00
vfs_conf.c Make a kernel sans FFS possible. 1994-11-12 01:47:43 +00:00
vfs_export.c Changed #ifdef around printlockedvnodes() from DEBUG to DDB. 1995-04-16 11:33:33 +00:00
vfs_extattr.c Added a set of braces to make the compiler happy. 1995-03-29 11:54:02 +00:00
vfs_init.c Actually implement the functionality documented in sysctl.h for type CTL_FS. 1994-10-20 00:48:28 +00:00
vfs_lookup.c Use tsleep() rather than sleep so that 'ps' is more informative about 1994-10-06 21:07:04 +00:00
vfs_mount.c Make a kernel sans FFS possible. 1994-11-12 01:47:43 +00:00
vfs_subr.c Changed #ifdef around printlockedvnodes() from DEBUG to DDB. 1995-04-16 11:33:33 +00:00
vfs_syscalls.c Added a set of braces to make the compiler happy. 1995-03-29 11:54:02 +00:00
vfs_vnops.c Removed unnecessary call to vnode_pager_uncache(). We automatically clear 1995-03-19 12:08:03 +00:00
vnode_if.pl Added $Id$ 1994-08-02 07:55:43 +00:00
vnode_if.sh Added $Id$ 1994-08-02 07:55:43 +00:00
vnode_if.src Make NFS ask the filesystems for directory cookies instead of making them 1994-09-28 16:45:22 +00:00