mirror of
https://git.FreeBSD.org/src.git
synced 2025-01-13 14:40:22 +00:00
- 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
This commit is contained in:
parent
565d58edd2
commit
517f30c2c1
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=93159
@ -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;
|
||||
|
||||
|
@ -307,6 +307,11 @@ vfs_mount(td, fstype, fspath, fsflags, fsdata)
|
||||
vput(vp);
|
||||
return error;
|
||||
}
|
||||
error = securelevel_gt(td->td_ucred, 0);
|
||||
if (error != 0) {
|
||||
vput(vp);
|
||||
return (EPERM);
|
||||
}
|
||||
error = linker_load_file(fstype, &lf);
|
||||
if (error || lf == NULL) {
|
||||
vput(vp);
|
||||
|
@ -307,6 +307,11 @@ vfs_mount(td, fstype, fspath, fsflags, fsdata)
|
||||
vput(vp);
|
||||
return error;
|
||||
}
|
||||
error = securelevel_gt(td->td_ucred, 0);
|
||||
if (error != 0) {
|
||||
vput(vp);
|
||||
return (EPERM);
|
||||
}
|
||||
error = linker_load_file(fstype, &lf);
|
||||
if (error || lf == NULL) {
|
||||
vput(vp);
|
||||
|
Loading…
Reference in New Issue
Block a user