[dpdk-stable] patch 'common/cpt: fix possible null dereference' has been queued to LTS release 18.11.6

Kevin Traynor ktraynor at redhat.com
Tue Dec 10 15:59:25 CET 2019


Hi,

FYI, your patch has been queued to LTS release 18.11.6

Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 12/16/19. 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://github.com/kevintraynor/dpdk-stable-queue

This queued commit can be viewed at:
https://github.com/kevintraynor/dpdk-stable-queue/commit/3f6ffc1f80b9f030df2cb7518001058b7e65d32d

Thanks.

Kevin.

---
>From 3f6ffc1f80b9f030df2cb7518001058b7e65d32d Mon Sep 17 00:00:00 2001
From: Kevin Traynor <ktraynor at redhat.com>
Date: Wed, 6 Nov 2019 19:01:57 +0000
Subject: [PATCH] common/cpt: fix possible null dereference

[ upstream commit 01c65002b7153b4a111c77854715d535c0b6e851 ]

Coverity complains that ctrl_flags is set to NULL at the start
of the function and it may not have been set before there is a
jump to fc_success and it is dereferenced.

Check for NULL before dereference.

312fc_success:
   CID 344983 (#1 of 1): Explicit null dereferenced
   (FORWARD_NULL)7. var_deref_op: Dereferencing null pointer ctrl_flags.
313        *ctrl_flags = rte_cpu_to_be_64(*ctrl_flags);

Coverity issue: 344983
Fixes: 6cc54096520d ("crypto/octeontx: add supported sessions")

Signed-off-by: Kevin Traynor <ktraynor at redhat.com>
Reviewed-by: David Marchand <david.marchand at redhat.com>
---
 drivers/common/cpt/cpt_ucode.h | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/common/cpt/cpt_ucode.h b/drivers/common/cpt/cpt_ucode.h
index d408d50e3..f0632caf6 100644
--- a/drivers/common/cpt/cpt_ucode.h
+++ b/drivers/common/cpt/cpt_ucode.h
@@ -316,5 +316,6 @@ cpt_fc_ciph_set_key(void *ctx, cipher_type_t type, uint8_t *key,
 
 fc_success:
-	*ctrl_flags = rte_cpu_to_be_64(*ctrl_flags);
+	if (ctrl_flags != NULL)
+		*ctrl_flags = rte_cpu_to_be_64(*ctrl_flags);
 
 success:
-- 
2.21.0

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2019-12-10 14:49:42.460827448 +0000
+++ 0051-common-cpt-fix-possible-null-dereference.patch	2019-12-10 14:49:39.086457133 +0000
@@ -1 +1 @@
-From 01c65002b7153b4a111c77854715d535c0b6e851 Mon Sep 17 00:00:00 2001
+From 3f6ffc1f80b9f030df2cb7518001058b7e65d32d Mon Sep 17 00:00:00 2001
@@ -5,0 +6,2 @@
+[ upstream commit 01c65002b7153b4a111c77854715d535c0b6e851 ]
+
@@ -19 +20,0 @@
-Cc: stable at dpdk.org
@@ -28 +29 @@
-index 0dac12ee3..d5a0135d7 100644
+index d408d50e3..f0632caf6 100644
@@ -31 +32 @@
-@@ -311,5 +311,6 @@ cpt_fc_ciph_set_key(void *ctx, cipher_type_t type, const uint8_t *key,
+@@ -316,5 +316,6 @@ cpt_fc_ciph_set_key(void *ctx, cipher_type_t type, uint8_t *key,



More information about the stable mailing list