DragonFlyBSD Kernel Audit
DF-3081 / fix.diff
← back to finding ↓ download raw
--- a/sys/vfs/procfs/procfs_vnops.c	2026-09-06 02:38:07.821579527 +0000
+++ b/sys/vfs/procfs/procfs_vnops.c	2026-09-06 02:38:07.821579527 +0000
@@ -653,6 +653,16 @@
 			error = EINVAL;
 		}
 
+		/*
+		 * The executable path is privileged information; apply
+		 * the same policy as procfs_docmdline (procfs_status.c).
+		 */
+		if (error == 0 &&
+		    (!CHECKIO(curproc, procp) ||
+		     p_trespass(curproc->p_ucred, procp->p_ucred))) {
+			error = EINVAL;
+		}
+
 		if (error == 0) {
 			vap->va_size = strlen(fullpath);
 			kfree(freepath, M_TEMP);
@@ -1154,6 +1164,14 @@
 			error = EINVAL;
 		}
 
+		/*
+		 * The executable path is privileged information; apply
+		 * the same policy as procfs_docmdline (procfs_status.c).
+		 */
+		if (!CHECKIO(curproc, procp) ||
+		    p_trespass(curproc->p_ucred, procp->p_ucred))
+			error = EINVAL;
+
 		if (error != 0) {
 			pfs_pdone(procp);
 			return (uiomove("unknown", sizeof("unknown") - 1,