power: fix buffer overruns
authorDavid Hunt <david.hunt@intel.com>
Tue, 9 Apr 2019 09:22:01 +0000 (10:22 +0100)
committerThomas Monjalon <thomas@monjalon.net>
Mon, 22 Apr 2019 22:15:10 +0000 (00:15 +0200)
commit751227a08d92c36bc69a1d25416b223c50fd278a
tree28dd45eb38e58025e1398f63053559e9b4b21cc1
parenta0d15e43e42b158e25b9ad13052368ba22ecf113
power: fix buffer overruns

A previous change removed the limit of 64 cores by
moving away from 64-bit masks to char arrays. However
this left a buffer overrun issue, where the max channels
was defined as 64, and max cores was defined as 256. These
should all be consistently set to RTE_MAX_LCORE.

The #defines being removed are CHANNEL_CMDS_MAX_CPUS,
CHANNEL_CMDS_MAX_CHANNELS, POWER_MGR_MAX_CPUS, and
CHANNEL_CMDS_MAX_VM_CHANNELS, and are being replaced
with RTE_MAX_LCORE for consistency and simplicity.

Coverity issue: 337672, 337673, 337678
Fixes: fd73630e95c1 ("examples/power: change 64-bit masks to arrays")
Cc: stable@dpdk.org
Signed-off-by: David Hunt <david.hunt@intel.com>
Acked-by: Anatoly Burakov <anatoly.burakov@intel.com>
examples/vm_power_manager/channel_manager.c
examples/vm_power_manager/channel_manager.h
examples/vm_power_manager/power_manager.c
examples/vm_power_manager/power_manager.h
examples/vm_power_manager/vm_power_cli.c
lib/librte_power/channel_commands.h
lib/librte_power/power_kvm_vm.c