Skip to content

Commit 02c4118

Browse files
committed
crypto: qat/qat_420xx - fix off by one in uof_get_name()
JIRA: https://issues.redhat.com/browse/RHEL-52749 Upstream Status: merged into herbert/crypto-2.6.git commit 93a1160 Author: Dan Carpenter <dan.carpenter@linaro.org> Date: Sat Sep 28 13:05:01 2024 +0300 crypto: qat/qat_420xx - fix off by one in uof_get_name() This is called from uof_get_name_420xx() where "num_objs" is the ARRAY_SIZE() of fw_objs[]. The > needs to be >= to prevent an out of bounds access. Fixes: fcf60f4 ("crypto: qat - add support for 420xx devices") Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org> Acked-by: Giovanni Cabiddu <giovanni.cabiddu@intel.com> Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au> Signed-off-by: Vladis Dronov <vdronov@redhat.com>
1 parent 340e200 commit 02c4118

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

drivers/crypto/intel/qat/qat_420xx/adf_420xx_hw_data.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -375,7 +375,7 @@ static const char *uof_get_name(struct adf_accel_dev *accel_dev, u32 obj_num,
375375
else
376376
id = -EINVAL;
377377

378-
if (id < 0 || id > num_objs)
378+
if (id < 0 || id >= num_objs)
379379
return NULL;
380380

381381
return fw_objs[id];

0 commit comments

Comments
 (0)