compress/qat: fix out-of-bounds write
authorFiona Trahe <fiona.trahe@intel.com>
Wed, 31 Oct 2018 00:39:54 +0000 (00:39 +0000)
committerAkhil Goyal <akhil.goyal@nxp.com>
Fri, 2 Nov 2018 11:26:06 +0000 (12:26 +0100)
commitcea6abe3796cd06cfa135964476565ab6ba74791
treea4c2fd09afce5138011453194cc5c8eefdd96361
parentfeb441cd22514717d96c23fe38410a965d0d599c
compress/qat: fix out-of-bounds write

QAT array for sgls in intermediate buffer structure
was #defined to 1, but setup code hardcoded as if 2 buffers
so causing out of bounds write. Reworked to loop correctly
using #define.

Fixes: a124830a6f00 ("compress/qat: enable dynamic huffman encoding")

Reported-by: Jerin Jacob <jerin.jacob@caviumnetworks.com>
Signed-off-by: Fiona Trahe <fiona.trahe@intel.com>
Tested-by: Jerin Jacob <jerin.jacob@caviumnetworks.com>
Acked-by: Bruce Richardson <bruce.richardson@intel.com>
Acked-by: Tomasz Jozwiak <tomaszx.jozwiak@intel.com>
drivers/compress/qat/qat_comp_pmd.c