grantbylabel_syscall check p_textvp != NULL

kernel process will not have valid p_textvp

Reviewed by:	stevek
Differential Revision:	https://reviews.freebsd.org/D50368
This commit is contained in:
Simon J. Gerraty committed 2025-05-16 15:19:06 -07:00
1 parent 95c414dd27
commit 496b3c3a1c
1 file changed
+4
@@ -409,6 +409,10 @@ cleanup_file:
proc = pfind(gbl_args.u.pid);
if (proc == NULL)
return (EINVAL);
else if (proc->p_textvp == NULL) {
PROC_UNLOCK(proc);
return (EINVAL);
}
proc_locked = 1;
}
gbl_args.gbl = (SLOT(proc->p_textvp->v_label) |