Repository navigation
Commit 8b7e849
telemetry: performance_monitor: fix manifest module entry offset
enable_performance_counters() adds SOF_MAN_MODULE_OFFSET(mod_id), a
byte offset, to a const struct sof_man_fw_desc pointer. The pointer
arithmetic scales it by sizeof(struct sof_man_fw_desc), so module entry
0 is read 2704 bytes into the manifest instead of 52, and entry i at
52 * (52 + 116 * i). instance_max_count is then taken from unrelated
memory past the manifest, which can fault or drive up to 65535 bogus
ipc4_get_comp_dev() lookups per module, and the real instances are not
reinitialized.
It runs on every IPC4_PERF_MEASUREMENTS_STATE change to STOPPED,
STARTED or PAUSED, for the base firmware manifest and every loaded
library.
Cast the descriptor to a byte pointer before adding the offset, as the
other SOF_MAN_MODULE_OFFSET() users in lib_manager.c, llext_manager.c
and helper-kernel.c already do.
Signed-off-by: Shrushti P K <shrusthi@labs.digiscrypt.com>1 parent 6bb19f4 commit 8b7e849
1 file changed
Lines changed: 3 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
498 | 498 | | |
499 | 499 | | |
500 | 500 | | |
501 | | - | |
| 501 | + | |
502 | 502 | | |
503 | 503 | | |
504 | 504 | | |
| |||
523 | 523 | | |
524 | 524 | | |
525 | 525 | | |
526 | | - | |
527 | | - | |
| 526 | + | |
| 527 | + | |
528 | 528 | | |
529 | 529 | | |
530 | 530 | | |
| |||
0 commit comments