The branch main has been updated by markj:

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

commit 98ef590f77392159938d2e6f9fd45bf31d10b9c1
Author:     Mark Johnston <ma...@freebsd.org>
AuthorDate: 2025-06-04 21:13:08 +0000
Commit:     Mark Johnston <ma...@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;

Reply via email to