Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 4 Jun 2025 21:26:03 GMT
From:      Mark Johnston <markj@FreeBSD.org>
To:        src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org
Subject:   git: 98ef590f7739 - main - dtrace/profile: Stop storing the probe name in struct profile_probe
Message-ID:  <202506042126.554LQ31s025403@gitrepo.freebsd.org>

next in thread | raw e-mail | index | archive | help
The branch main has been updated by markj:

URL: https://cgit.FreeBSD.org/src/commit/?id=98ef590f77392159938d2e6f9fd45bf31d10b9c1

commit 98ef590f77392159938d2e6f9fd45bf31d10b9c1
Author:     Mark Johnston <markj@FreeBSD.org>
AuthorDate: 2025-06-04 21:13:08 +0000
Commit:     Mark Johnston <markj@FreeBSD.org>
CommitDate: 2025-06-04 21:13:08 +0000

    dtrace/profile: Stop storing the probe name in struct profile_probe
    
    It's unused, and the naked strcpy() was susceptible to buffer overflow
    if one creates, say, a probe called "profile-2000000000ns".
    
    Reported by:    CHERI
    MFC after:      1 week
    Sponsored by:   Innovate UK
---
 sys/cddl/dev/profile/profile.c | 2 --
 1 file changed, 2 deletions(-)

diff --git a/sys/cddl/dev/profile/profile.c b/sys/cddl/dev/profile/profile.c
index 677c7543795f..3e106aab1c85 100644
--- a/sys/cddl/dev/profile/profile.c
+++ b/sys/cddl/dev/profile/profile.c
@@ -118,7 +118,6 @@ struct profile_probe_percpu;
 #endif
 
 typedef struct profile_probe {
-	char		prof_name[PROF_NAMELEN];
 	dtrace_id_t	prof_id;
 	int		prof_kind;
 #ifdef illumos
@@ -302,7 +301,6 @@ profile_create(hrtime_t interval, char *name, int kind)
 	}
 
 	prof = kmem_zalloc(sizeof (profile_probe_t), KM_SLEEP);
-	(void) strcpy(prof->prof_name, name);
 #ifdef illumos
 	prof->prof_interval = interval;
 	prof->prof_cyclic = CYCLIC_NONE;



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