Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 16 May 2025 22:20:09 GMT
From:      "Simon J. Gerraty" <sjg@FreeBSD.org>
To:        src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org
Subject:   git: 496b3c3a1ce8 - main - grantbylabel_syscall check p_textvp != NULL
Message-ID:  <202505162220.54GMK990045296@gitrepo.freebsd.org>

next in thread | raw e-mail | index | archive | help
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) |



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202505162220.54GMK990045296>