DPDK patches and discussions
 help / color / mirror / Atom feed
From: Stephen Hemminger <stephen@networkplumber.org>
To: dev@dpdk.org
Cc: Stephen Hemminger <stephen@networkplumber.org>,
	Kai Ji <kai.ji@intel.com>
Subject: [RFC 2/5] crypto/qat: use secure memset
Date: Wed, 13 Nov 2024 10:56:01 -0800	[thread overview]
Message-ID: <20241113185720.28706-3-stephen@networkplumber.org> (raw)
In-Reply-To: <20241113185720.28706-1-stephen@networkplumber.org>

Regular memset maybe removed by compiler if done before a free
function. Use the C11 memset_s instead to ensure security
parameters are cleared.

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
---
 drivers/crypto/qat/qat_asym.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/crypto/qat/qat_asym.c b/drivers/crypto/qat/qat_asym.c
index f5b56b2f71..a2b87ddbfd 100644
--- a/drivers/crypto/qat/qat_asym.c
+++ b/drivers/crypto/qat/qat_asym.c
@@ -103,7 +103,7 @@ static const struct rte_driver cryptodev_qat_asym_driver = {
 
 #define PARAM_CLR(what) \
 	do { \
-		memset(what.data, 0, what.length); \
+		memset_s(what.data, 0, what.length); \
 		rte_free(what.data);	\
 	} while (0)
 
-- 
2.45.2


  parent reply	other threads:[~2024-11-13 18:57 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-11-13 18:55 [RFC 0/5] Fix memset usage Stephen Hemminger
2024-11-13 18:56 ` [RFC 1/5] crypto/qat: fix memset of SHA3 state Stephen Hemminger
2024-11-13 18:56 ` Stephen Hemminger [this message]
2024-11-13 18:56 ` [RFC 3/5] bus/uacce: remove memset before free Stephen Hemminger
2024-11-14  0:55   ` fengchengwen
2024-11-13 18:56 ` [RFC 4/5] compress/octeontx: remove memset before rte_free Stephen Hemminger
2024-11-13 18:56 ` [RFC 5/5] test: remove unneeded memset Stephen Hemminger
2024-11-14  8:56 ` [RFC 0/5] Fix memset usage Bruce Richardson

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=20241113185720.28706-3-stephen@networkplumber.org \
    --to=stephen@networkplumber.org \
    --cc=dev@dpdk.org \
    --cc=kai.ji@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;
as well as URLs for NNTP newsgroup(s).