Fix panic on e.g. "kldload /dev/null".
PR: kern/121427 Reviewed by: sem MFC after: 3 days
This commit is contained in:
parent
b9046423ec
commit
a786aa30ca
@ -571,6 +571,11 @@ link_elf_load_file(linker_class_t cls, const char* filename,
|
||||
return error;
|
||||
vfslocked = NDHASGIANT(&nd);
|
||||
NDFREE(&nd, NDF_ONLY_PNBUF);
|
||||
if (nd.ni_vp->v_type != VREG) {
|
||||
error = ENOEXEC;
|
||||
firstpage = NULL;
|
||||
goto out;
|
||||
}
|
||||
#ifdef MAC
|
||||
error = mac_kld_check_load(curthread->td_ucred, nd.ni_vp);
|
||||
if (error) {
|
||||
|
@ -409,6 +409,10 @@ link_elf_load_file(linker_class_t cls, const char *filename,
|
||||
return error;
|
||||
vfslocked = NDHASGIANT(&nd);
|
||||
NDFREE(&nd, NDF_ONLY_PNBUF);
|
||||
if (nd.ni_vp->v_type != VREG) {
|
||||
error = ENOEXEC;
|
||||
goto out;
|
||||
}
|
||||
#ifdef MAC
|
||||
error = mac_kld_check_load(td->td_ucred, nd.ni_vp);
|
||||
if (error) {
|
||||
|
Loading…
Reference in New Issue
Block a user