On Tue, Apr 16, 2024 at 12:33:37PM +0200, Lucas Segarra Fernandez wrote: > The function adf_send_admin_tl_start() enables the telemetry (TL) > feature on a QAT device by sending the ICP_QAT_FW_TL_START message to > the firmware. This triggers the FW to start writing TL data to a DMA > buffer in memory and returns an array containing the number of > accelerators of each type (slices) supported by this HW. > The pointer to this array is stored in the adf_tl_hw_data data > structure called slice_cnt. > > The array slice_cnt is then used in the function tl_print_dev_data() > to report in debugfs only statistics about the supported accelerators. > An incorrect value of the elements in slice_cnt might lead to an out > of bounds memory read. > At the moment, there isn't an implementation of FW that returns a wrong > value, but for robustness validate the slice count array returned by FW. > > Fixes: 69e7649f7cc2 ("crypto: qat - add support for device telemetry") > Signed-off-by: Lucas Segarra Fernandez <lucas.segarra.fernandez@xxxxxxxxx> > Reviewed-by: Damian Muszynski <damian.muszynski@xxxxxxxxx> > Reviewed-by: Giovanni Cabiddu <giovanni.cabiddu@xxxxxxxxx> > --- > .../crypto/intel/qat/qat_common/adf_gen4_tl.c | 1 + > .../intel/qat/qat_common/adf_telemetry.c | 21 +++++++++++++++++++ > .../intel/qat/qat_common/adf_telemetry.h | 1 + > 3 files changed, 23 insertions(+) Patch applied. Thanks. -- Email: Herbert Xu <herbert@xxxxxxxxxxxxxxxxxxx> Home Page: http://gondor.apana.org.au/~herbert/ PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt