DPDK patches and discussions
 help / color / mirror / Atom feed
From: bugzilla@dpdk.org
To: dev@dpdk.org
Subject: [DPDK/cryptodev Bug 1773] Crypto devices should be using constant time memcmp
Date: Tue, 19 Aug 2025 01:33:28 +0000	[thread overview]
Message-ID: <bug-1773-3@https.bugs.dpdk.org/> (raw)

[-- Attachment #1: Type: text/plain, Size: 2540 bytes --]

https://bugs.dpdk.org/show_bug.cgi?id=1773

            Bug ID: 1773
           Summary: Crypto devices should be using constant time memcmp
           Product: DPDK
           Version: 25.07
          Hardware: All
                OS: All
            Status: UNCONFIRMED
          Severity: normal
          Priority: Normal
         Component: cryptodev
          Assignee: dev@dpdk.org
          Reporter: stephen@networkplumber.org
  Target Milestone: ---

To be resistant to timing attacks all cryptodev operations should be using a
version of memcmp that takes constant time.

There is no such function in std libc maybe make a new one?

Examples in current code base:


~/.../main/drivers/crypto $ git grep memcmp
armv8/rte_armv8_pmd.c:          if (memcmp(adst, op->sym->auth.digest.data,
ccp/ccp_crypto.c:               if (memcmp(dst, op->sym->auth.digest.data,
ccp/ccp_crypto.c:               if (memcmp(addr + offset, digest_data,
cnxk/cnxk_ae.h:         if (memcmp(rsa->sign.data, rsa->message.data,
cnxk/cnxk_se.h: if (memcmp(mac, gen_mac, mac_len))
ipsec_mb/pmd_aesni_gcm.c:               if (memcmp(tag, digest,
session->req_digest_length) != 0)
ipsec_mb/pmd_aesni_gcm.c:       return memcmp(digest, tmpdigest,
s->req_digest_length) == 0 ? 0
ipsec_mb/pmd_aesni_mb.c:        if (memcmp(job->auth_tag_output, crc,
RTE_ETHER_CRC_LEN) != 0)
ipsec_mb/pmd_aesni_mb.c:        if (memcmp(job->auth_tag_output, digest, len)
!= 0)
ipsec_mb/pmd_aesni_mb.c:                        if (memcmp(vec->digest[i].va,
dgst[i], len) != 0)
ipsec_mb/pmd_snow3g.c:                  if (memcmp(dst,
ops[i]->sym->auth.digest.data,
ipsec_mb/pmd_zuc.c:                     if (memcmp(dst[i],
ops[i]->sym->auth.digest.data,
mlx5/mlx5_crypto_dek.c: return memcmp(key, dek->data, xkey_len);
nitrox/nitrox_sym_reqmgr.c:     if (!memcmp(ctx->salt, addr,
AES_GCM_SALT_SIZE))
octeontx/otx_cryptodev_ops.c:           if (memcmp(rsa->sign.data,
rsa->message.data,
openssl/rte_openssl_pmd.c:              if (CRYPTO_memcmp(dst,
op->sym->auth.digest.data,
openssl/rte_openssl_pmd.c:              if (CRYPTO_memcmp(tmp,
op->rsa.message.data,
openssl/rte_openssl_pmd.c:              if ((ret <= 0) || (CRYPTO_memcmp(tmp,
op->rsa.message.data,
scheduler/rte_cryptodev_scheduler.c:            return
!memcmp(&sec_cap1->docsis, &sec_cap2->docsis,
uadk/uadk_crypto_pmd.c:                 if (memcmp(dst,
op->sym->auth.digest.data,

-- 
You are receiving this mail because:
You are the assignee for the bug.

[-- Attachment #2: Type: text/html, Size: 4511 bytes --]

                 reply	other threads:[~2025-08-19  1:33 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=bug-1773-3@https.bugs.dpdk.org/ \
    --to=bugzilla@dpdk.org \
    --cc=dev@dpdk.org \
    /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).