patch 'examples/fips_validation: fix dereference and out-of-bound' has been queued to stable release 23.11.2
Xueming Li
xuemingl at nvidia.com
Mon Aug 12 14:48:21 CEST 2024
Hi,
FYI, your patch has been queued to stable release 23.11.2
Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 08/14/24. So please
shout if anyone has objections.
Also note that after the patch there's a diff of the upstream commit vs the
patch applied to the branch. This will indicate if there was any rebasing
needed to apply to the stable branch. If there were code changes for rebasing
(ie: not only metadata diffs), please double check that the rebase was
correctly done.
Queued patches are on a temporary branch at:
https://git.dpdk.org/dpdk-stable/log/?h=23.11-staging
This queued commit can be viewed at:
https://git.dpdk.org/dpdk-stable/commit/?h=23.11-staging&id=cc8ca588a08bc581d8f456794a5a66f584e66c0f
Thanks.
Xueming Li <xuemingl at nvidia.com>
---
>From cc8ca588a08bc581d8f456794a5a66f584e66c0f Mon Sep 17 00:00:00 2001
From: Gowrishankar Muthukrishnan <gmuthukrishn at marvell.com>
Date: Wed, 26 Jun 2024 15:56:23 +0530
Subject: [PATCH] examples/fips_validation: fix dereference and out-of-bound
Cc: Xueming Li <xuemingl at nvidia.com>
[ upstream commit 57c10aaf3880fac5b2d0e1ddcfd8645e22b9f83c ]
Fix NULL dereference, out-of-bound, bad bit shift issues
reported by coverity scan.
Coverity issue: 384440, 384435, 384433, 384429
Fixes: 36128a67c27e ("examples/fips_validation: add asymmetric validation")
Signed-off-by: Gowrishankar Muthukrishnan <gmuthukrishn at marvell.com>
Acked-by: Brian Dooley <brian.dooley at intel.com>
---
examples/fips_validation/fips_validation_rsa.c | 7 +++++--
1 file changed, 5 insertions(+), 2 deletions(-)
diff --git a/examples/fips_validation/fips_validation_rsa.c b/examples/fips_validation/fips_validation_rsa.c
index f675b51051..55f81860a0 100644
--- a/examples/fips_validation/fips_validation_rsa.c
+++ b/examples/fips_validation/fips_validation_rsa.c
@@ -328,6 +328,9 @@ parse_test_rsa_json_interim_writeback(struct fips_val *val)
if (prepare_vec_rsa() < 0)
return -1;
+ if (!vec.rsa.e.val)
+ return -1;
+
writeback_hex_str("", info.one_line_text, &vec.rsa.n);
obj = json_string(info.one_line_text);
json_object_set_new(json_info.json_write_group, "n", obj);
@@ -474,7 +477,7 @@ fips_test_randomize_message(struct fips_val *msg, struct fips_val *rand)
uint16_t rv_len;
if (!msg->val || !rand->val || rand->len > RV_BUF_LEN
- || msg->len > FIPS_TEST_JSON_BUF_LEN)
+ || msg->len > (FIPS_TEST_JSON_BUF_LEN - 1))
return -EINVAL;
memset(rv, 0, sizeof(rv));
@@ -503,7 +506,7 @@ fips_test_randomize_message(struct fips_val *msg, struct fips_val *rand)
m[i + j] ^= rv[j];
m[i + j] = ((uint8_t *)&rv_bitlen)[0];
- m[i + j + 1] = (((uint8_t *)&rv_bitlen)[1] >> 8) & 0xFF;
+ m[i + j + 1] = ((uint8_t *)&rv_bitlen)[1];
rte_free(msg->val);
msg->len = (rv_bitlen + m_bitlen + 16) / 8;
--
2.34.1
---
Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- - 2024-08-12 20:44:03.368304032 +0800
+++ 0024-examples-fips_validation-fix-dereference-and-out-of-.patch 2024-08-12 20:44:01.955069267 +0800
@@ -1 +1 @@
-From 57c10aaf3880fac5b2d0e1ddcfd8645e22b9f83c Mon Sep 17 00:00:00 2001
+From cc8ca588a08bc581d8f456794a5a66f584e66c0f Mon Sep 17 00:00:00 2001
@@ -4,0 +5,3 @@
+Cc: Xueming Li <xuemingl at nvidia.com>
+
+[ upstream commit 57c10aaf3880fac5b2d0e1ddcfd8645e22b9f83c ]
@@ -11 +13,0 @@
-Cc: stable at dpdk.org
More information about the stable
mailing list