git: 98ef590f7739 - main - dtrace/profile: Stop storing the probe name in struct profile_probe
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Wed, 04 Jun 2025 21:26:03 UTC
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;