git: f3ac4f027b26 - stable/14 - dtrace/profile: Stop storing the probe name in struct profile_probe

From: Mark Johnston <markj_at_FreeBSD.org>
Date: Fri, 20 Jun 2025 13:52:23 UTC
The branch stable/14 has been updated by markj:

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

commit f3ac4f027b264fa25a11c53f8a37cf9c90addd1a
Author:     Mark Johnston <markj@FreeBSD.org>
AuthorDate: 2025-06-04 21:13:08 +0000
Commit:     Mark Johnston <markj@FreeBSD.org>
CommitDate: 2025-06-20 12:46:09 +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
    
    (cherry picked from commit 98ef590f77392159938d2e6f9fd45bf31d10b9c1)
---
 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 a939c13aad45..3b95254be537 100644
--- a/sys/cddl/dev/profile/profile.c
+++ b/sys/cddl/dev/profile/profile.c
@@ -119,7 +119,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
@@ -303,7 +302,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;