From: Dan Carpenter <dan.carpenter@linaro.org>
To: Jie Wang <jie.wang@intel.com>
Cc: Giovanni Cabiddu <giovanni.cabiddu@intel.com>,
Herbert Xu <herbert@gondor.apana.org.au>,
"David S. Miller" <davem@davemloft.net>,
Damian Muszynski <damian.muszynski@intel.com>,
Tero Kristo <tero.kristo@linux.intel.com>,
Shashank Gupta <shashank.gupta@intel.com>,
Lucas Segarra Fernandez <lucas.segarra.fernandez@intel.com>,
Dong Xie <dong.xie@intel.com>,
qat-linux@intel.com, linux-crypto@vger.kernel.org,
linux-kernel@vger.kernel.org, kernel-janitors@vger.kernel.org
Subject: [PATCH] crypto: qat - (qat_420xx) fix off by one in uof_get_name()
Date: Sat, 28 Sep 2024 13:05:01 +0300 [thread overview]
Message-ID: <796ecd7c-54ad-4bec-b748-3e156cc0a1aa@stanley.mountain> (raw)
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: fcf60f4bcf54 ("crypto: qat - add support for 420xx devices")
Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org>
---
drivers/crypto/intel/qat/qat_420xx/adf_420xx_hw_data.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/crypto/intel/qat/qat_420xx/adf_420xx_hw_data.c b/drivers/crypto/intel/qat/qat_420xx/adf_420xx_hw_data.c
index 78f0ea49254d..9faef33e54bd 100644
--- a/drivers/crypto/intel/qat/qat_420xx/adf_420xx_hw_data.c
+++ b/drivers/crypto/intel/qat/qat_420xx/adf_420xx_hw_data.c
@@ -375,7 +375,7 @@ static const char *uof_get_name(struct adf_accel_dev *accel_dev, u32 obj_num,
else
id = -EINVAL;
- if (id < 0 || id > num_objs)
+ if (id < 0 || id >= num_objs)
return NULL;
return fw_objs[id];
--
2.45.2
next reply other threads:[~2024-09-28 10:05 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-09-28 10:05 Dan Carpenter [this message]
2024-10-01 11:05 ` Cabiddu, Giovanni
2024-10-05 5:38 ` Herbert Xu
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=796ecd7c-54ad-4bec-b748-3e156cc0a1aa@stanley.mountain \
--to=dan.carpenter@linaro.org \
--cc=damian.muszynski@intel.com \
--cc=davem@davemloft.net \
--cc=dong.xie@intel.com \
--cc=giovanni.cabiddu@intel.com \
--cc=herbert@gondor.apana.org.au \
--cc=jie.wang@intel.com \
--cc=kernel-janitors@vger.kernel.org \
--cc=linux-crypto@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=lucas.segarra.fernandez@intel.com \
--cc=qat-linux@intel.com \
--cc=shashank.gupta@intel.com \
--cc=tero.kristo@linux.intel.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®