Skip to content

Commit 5c0992a

Browse files
committed
crypto: qat/qat_4xxx - 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 475b509 Author: Dan Carpenter <dan.carpenter@linaro.org> Date: Sat Sep 28 13:05:08 2024 +0300 crypto: qat/qat_4xxx - fix off by one in uof_get_name() The fw_objs[] array has "num_objs" elements so the > needs to be >= to prevent an out of bounds read. Fixes: 10484c6 ("crypto: qat - refactor fw config logic for 4xxx") 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 02c4118 commit 5c0992a

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

drivers/crypto/intel/qat/qat_4xxx/adf_4xxx_hw_data.c

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

337-
if (id < 0 || id > num_objs)
337+
if (id < 0 || id >= num_objs)
338338
return NULL;
339339

340340
return fw_objs[id];

0 commit comments

Comments
 (0)