git: 496b3c3a1ce8 - main - grantbylabel_syscall check p_textvp != NULL
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Fri, 16 May 2025 22:20:09 UTC
The branch main has been updated by sjg:
URL: https://cgit.FreeBSD.org/src/commit/?id=496b3c3a1ce86b72f56bec993b76bdd64723ee46
commit 496b3c3a1ce86b72f56bec993b76bdd64723ee46
Author: Simon J. Gerraty <sjg@FreeBSD.org>
AuthorDate: 2025-05-16 22:19:06 +0000
Commit: Simon J. Gerraty <sjg@FreeBSD.org>
CommitDate: 2025-05-16 22:19:06 +0000
grantbylabel_syscall check p_textvp != NULL
kernel process will not have valid p_textvp
Reviewed by: stevek
Differential Revision: https://reviews.freebsd.org/D50368
---
sys/security/mac_grantbylabel/mac_grantbylabel.c | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/sys/security/mac_grantbylabel/mac_grantbylabel.c b/sys/security/mac_grantbylabel/mac_grantbylabel.c
index af080e8e34e0..c40885773222 100644
--- a/sys/security/mac_grantbylabel/mac_grantbylabel.c
+++ b/sys/security/mac_grantbylabel/mac_grantbylabel.c
@@ -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) |