diff options
| author | Heinrich Schuchardt <[email protected]> | 2023-11-17 14:59:31 +0100 |
|---|---|---|
| committer | Anup Patel <[email protected]> | 2023-11-22 20:55:22 +0530 |
| commit | 574b9c8ec22e742e63b6204ad43916c54fc49eba (patch) | |
| tree | 0f0ae9da7e5b2504dd12d9e3719a0d39dced6d33 /lib/utils | |
| parent | 16bb9305338b4ae87d95ce776cf029accf07bc49 (diff) | |
lib: sbi_pmu: avoid buffer overflow
total_ctrs is bounded by
SBI_PMU_FW_CTR_MAX + SBI_PMU_HW_CTR_MAX) == 48
which exceeds BITS_PER_LONG on 32 bit systems.
Iterating over the bits of &cmask results in a buffer overflow when looking
for a bit >= BITS_PER_LONG.
Adjust the iterators in sbi_pmu_ctr_start() and sbi_pmu_ctr_stop()
accordingly.
Signed-off-by: Heinrich Schuchardt <[email protected]>
Reviewed-by: Anup Patel <[email protected]>
Diffstat (limited to 'lib/utils')
0 files changed, 0 insertions, 0 deletions
