diff options
| author | Naveen Kumar Chaudhary <naveen.osdev@gmail.com> | 2026-06-04 23:15:02 +0530 |
|---|---|---|
| committer | Petr Pavlu <petr.pavlu@suse.com> | 2026-08-06 13:29:02 +0200 |
| commit | 93c29ebd1622fb0670701e1c1b3a978a5cac08b7 (patch) | |
| tree | 4729b60633c56419f1304acd1e879d84b2cbccb8 /tools/perf/scripts/python/bin/export-to-sqlite-record | |
| parent | df8de94eb3dce16ac9b7b2696efe9b11aed4f3a5 (diff) | |
module: use strscpy() to copy module names in stats and dup tracking
Both try_add_failed_module() and kmod_dup_request_exists_wait() use
memcpy() with strlen() to copy module names into fixed-size
char[MODULE_NAME_LEN] buffers. Neither performs a bounds check on the
copy. Current callers always pass names originating from
mod->name (itself char[MODULE_NAME_LEN]), so this is not exploitable
today. However both functions accept a plain const char * with no
documented length contract, making them latent buffer overflows if a
future caller passes a longer string.
Replace memcpy() with strscpy() in both sites, which bounds the copy
to MODULE_NAME_LEN and always NUL-terminates.
Signed-off-by: Naveen Kumar Chaudhary <naveen.osdev@gmail.com>
Reviewed-by: Petr Pavlu <petr.pavlu@suse.com>
Signed-off-by: Petr Pavlu <petr.pavlu@suse.com>
Diffstat (limited to 'tools/perf/scripts/python/bin/export-to-sqlite-record')
0 files changed, 0 insertions, 0 deletions
