Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 27 Jul 2026 22:32:37 +0000
From:      Mark Johnston <markj@FreeBSD.org>
To:        src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org
Subject:   git: 8044d00cdda3 - stable/14 - dtrace: Improve DOF section size validation
Message-ID:  <6a67dc85.25850.22d02bfb@gitrepo.freebsd.org>

index | next in thread | raw e-mail

The branch stable/14 has been updated by markj:

URL: https://cgit.FreeBSD.org/src/commit/?id=8044d00cdda3be5e5681d5a095b1c4a59e9594cd

commit 8044d00cdda3be5e5681d5a095b1c4a59e9594cd
Author:     Mark Johnston <markj@FreeBSD.org>
AuthorDate: 2026-07-06 13:20:33 +0000
Commit:     Mark Johnston <markj@FreeBSD.org>
CommitDate: 2026-07-27 14:05:07 +0000

    dtrace: Improve DOF section size validation
    
    The loop which validates each DOF section assumes that the section
    header is present, so the section size must be at least as large as the
    header, otherwise a small OOB access is possible.
    
    Reviewed by:    christos
    MFC after:      2 weeks
    Sponsored by:   CHERI Research Centre
    Differential Revision:  https://reviews.freebsd.org/D57975
    
    (cherry picked from commit c1b6ebc2b7584f93cea4d818468b2aee74475674)
---
 sys/cddl/contrib/opensolaris/uts/common/dtrace/dtrace.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/sys/cddl/contrib/opensolaris/uts/common/dtrace/dtrace.c b/sys/cddl/contrib/opensolaris/uts/common/dtrace/dtrace.c
index 853cfb845878..d4c6c5ec449a 100644
--- a/sys/cddl/contrib/opensolaris/uts/common/dtrace/dtrace.c
+++ b/sys/cddl/contrib/opensolaris/uts/common/dtrace/dtrace.c
@@ -14201,8 +14201,8 @@ dtrace_dof_slurp(dof_hdr_t *dof, dtrace_vstate_t *vstate, cred_t *cr,
 		return (-1);
 	}
 
-	if (dof->dofh_secsize == 0) {
-		dtrace_dof_error(dof, "zero section header size");
+	if (dof->dofh_secsize < sizeof (dof_sec_t)) {
+		dtrace_dof_error(dof, "invalid section header size");
 		return (-1);
 	}
 


home | help

Want to link to this message? Use this
URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?6a67dc85.25850.22d02bfb>