127 lines
3.5 KiB
Diff
127 lines
3.5 KiB
Diff
From 81d5593a3f9f6e5c763f81f6e7d393dc5efda961 Mon Sep 17 00:00:00 2001
|
|
From: Qi Tao <taoqi10@huawei.com>
|
|
Date: Thu, 30 Nov 2023 17:02:26 +0800
|
|
Subject: [PATCH 091/114] uadk: fixed some input parameter checking issues
|
|
|
|
Inside the asynchronous packet receiving interface of all submodules.
|
|
When the number of expected received packets is 0. Failure to intercept
|
|
will result in abnormal packet recycling.
|
|
As a result, the number of normal service packets does not match.
|
|
|
|
In addition, when the expected value is 0, it will cause the while loop
|
|
control adjustment to flip, resulting in other receiving operations.
|
|
|
|
Signed-off-by: Longfang Liu <liulongfang@huawei.com>
|
|
---
|
|
wd_aead.c | 2 +-
|
|
wd_cipher.c | 2 +-
|
|
wd_comp.c | 4 ++--
|
|
wd_dh.c | 4 ++--
|
|
wd_digest.c | 2 +-
|
|
wd_ecc.c | 4 ++--
|
|
wd_rsa.c | 4 ++--
|
|
7 files changed, 11 insertions(+), 11 deletions(-)
|
|
|
|
diff --git a/wd_aead.c b/wd_aead.c
|
|
index 87d61c3..ff43086 100644
|
|
--- a/wd_aead.c
|
|
+++ b/wd_aead.c
|
|
@@ -816,7 +816,7 @@ int wd_aead_poll_ctx(__u32 idx, __u32 expt, __u32 *count)
|
|
__u32 tmp = expt;
|
|
int ret;
|
|
|
|
- if (unlikely(!count)) {
|
|
+ if (unlikely(!count || !expt)) {
|
|
WD_ERR("invalid: aead poll ctx input param is NULL!\n");
|
|
return -WD_EINVAL;
|
|
}
|
|
diff --git a/wd_cipher.c b/wd_cipher.c
|
|
index 58d34f7..0187c9c 100644
|
|
--- a/wd_cipher.c
|
|
+++ b/wd_cipher.c
|
|
@@ -730,7 +730,7 @@ int wd_cipher_poll_ctx(__u32 idx, __u32 expt, __u32 *count)
|
|
__u32 tmp = expt;
|
|
int ret;
|
|
|
|
- if (unlikely(!count)) {
|
|
+ if (unlikely(!count || !expt)) {
|
|
WD_ERR("invalid: cipher poll ctx input param is NULL!\n");
|
|
return -WD_EINVAL;
|
|
}
|
|
diff --git a/wd_comp.c b/wd_comp.c
|
|
index 21c9928..57e8b8f 100644
|
|
--- a/wd_comp.c
|
|
+++ b/wd_comp.c
|
|
@@ -340,8 +340,8 @@ int wd_comp_poll_ctx(__u32 idx, __u32 expt, __u32 *count)
|
|
__u32 tmp = expt;
|
|
int ret;
|
|
|
|
- if (unlikely(!count)) {
|
|
- WD_ERR("invalid: comp poll count is 0!\n");
|
|
+ if (unlikely(!count || !expt)) {
|
|
+ WD_ERR("invalid: comp poll count or expt is 0!\n");
|
|
return -WD_EINVAL;
|
|
}
|
|
|
|
diff --git a/wd_dh.c b/wd_dh.c
|
|
index 40a52e5..dac55ca 100644
|
|
--- a/wd_dh.c
|
|
+++ b/wd_dh.c
|
|
@@ -438,8 +438,8 @@ int wd_dh_poll_ctx(__u32 idx, __u32 expt, __u32 *count)
|
|
__u32 tmp = expt;
|
|
int ret;
|
|
|
|
- if (unlikely(!count)) {
|
|
- WD_ERR("invalid: count is NULL!\n");
|
|
+ if (unlikely(!count || !expt)) {
|
|
+ WD_ERR("invalid: dh poll count or expt is NULL!\n");
|
|
return -WD_EINVAL;
|
|
}
|
|
|
|
diff --git a/wd_digest.c b/wd_digest.c
|
|
index bc67878..1f2b3b2 100644
|
|
--- a/wd_digest.c
|
|
+++ b/wd_digest.c
|
|
@@ -701,7 +701,7 @@ int wd_digest_poll_ctx(__u32 idx, __u32 expt, __u32 *count)
|
|
__u32 tmp = expt;
|
|
int ret;
|
|
|
|
- if (unlikely(!count)) {
|
|
+ if (unlikely(!count || !expt)) {
|
|
WD_ERR("invalid: digest poll ctx input param is NULL!\n");
|
|
return -WD_EINVAL;
|
|
}
|
|
diff --git a/wd_ecc.c b/wd_ecc.c
|
|
index 4323e54..b5e7e36 100644
|
|
--- a/wd_ecc.c
|
|
+++ b/wd_ecc.c
|
|
@@ -2272,8 +2272,8 @@ int wd_ecc_poll_ctx(__u32 idx, __u32 expt, __u32 *count)
|
|
__u32 tmp = expt;
|
|
int ret;
|
|
|
|
- if (unlikely(!count)) {
|
|
- WD_ERR("invalid: param count is NULL!\n");
|
|
+ if (unlikely(!count || !expt)) {
|
|
+ WD_ERR("invalid: ecc poll param count or expt is NULL!\n");
|
|
return -WD_EINVAL;
|
|
}
|
|
|
|
diff --git a/wd_rsa.c b/wd_rsa.c
|
|
index 1813676..b71540f 100644
|
|
--- a/wd_rsa.c
|
|
+++ b/wd_rsa.c
|
|
@@ -495,8 +495,8 @@ int wd_rsa_poll_ctx(__u32 idx, __u32 expt, __u32 *count)
|
|
__u32 tmp = expt;
|
|
int ret;
|
|
|
|
- if (unlikely(!count)) {
|
|
- WD_ERR("invalid: param count is NULL!\n");
|
|
+ if (unlikely(!count || !expt)) {
|
|
+ WD_ERR("invalid: rsa poll count or expt is NULL!\n");
|
|
return -WD_EINVAL;
|
|
}
|
|
|
|
--
|
|
2.25.1
|
|
|