summaryrefslogtreecommitdiffstats
path: root/sys/kern/kern_linker.c
diff options
context:
space:
mode:
authorarr <arr@FreeBSD.org>2002-03-25 18:26:34 +0000
committerarr <arr@FreeBSD.org>2002-03-25 18:26:34 +0000
commitdb4f882c76df49663bf718c966c5e5fd6bebaff4 (patch)
tree168fe348a1e8fea0df5116c3874d1fbc0585b5b3 /sys/kern/kern_linker.c
parent693963da0d17bee552d4c649cf527ccd046a698a (diff)
downloadFreeBSD-src-db4f882c76df49663bf718c966c5e5fd6bebaff4.zip
FreeBSD-src-db4f882c76df49663bf718c966c5e5fd6bebaff4.tar.gz
- Recommit the securelevel_gt() calls removed by commits rev. 1.84 of
kern_linker.c and rev. 1.237 of vfs_syscalls.c since these are not the source of the recent panics occuring around kldloading file system support modules. Requested by: rwatson
Diffstat (limited to 'sys/kern/kern_linker.c')
-rw-r--r--sys/kern/kern_linker.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/sys/kern/kern_linker.c b/sys/kern/kern_linker.c
index 192877c..1050b33 100644
--- a/sys/kern/kern_linker.c
+++ b/sys/kern/kern_linker.c
@@ -698,11 +698,11 @@ kldload(struct thread *td, struct kldload_args *uap)
td->td_retval[0] = -1;
- if (securelevel > 0) /* redundant, but that's OK */
- return (EPERM);
-
mtx_lock(&Giant);
+ if ((error = securelevel_gt(td->td_ucred, 0)) != 0)
+ goto out;
+
if ((error = suser_xxx(td->td_ucred, NULL, 0)) != 0)
goto out;
@@ -745,11 +745,11 @@ kldunload(struct thread *td, struct kldunload_args *uap)
linker_file_t lf;
int error = 0;
- if (securelevel > 0) /* redundant, but that's OK */
- return (EPERM);
-
mtx_lock(&Giant);
+ if ((error = securelevel_gt(td->td_ucred, 0)) != 0)
+ goto out;
+
if ((error = suser_xxx(td->td_ucred, NULL, 0)) != 0)
goto out;
OpenPOWER on IntegriCloud