From: bugzilla@dpdk.org
To: dev@dpdk.org
Subject: [DPDK/cryptodev Bug 2000] OpenSSL PMD SM2 overflow
Date: Fri, 28 Aug 2026 10:33:59 +0000 [thread overview]
Message-ID: <bug-2000-3@https.bugs.dpdk.org/> (raw)
https://bugs.dpdk.org/show_bug.cgi?id=2000
Bug ID: 2000
Summary: OpenSSL PMD SM2 overflow
Product: DPDK
Version: unspecified
Hardware: All
OS: All
Status: UNCONFIRMED
Severity: normal
Priority: Normal
Component: cryptodev
Assignee: dev@dpdk.org
Reporter: thomas@monjalon.net
Target Milestone: ---
Group: security
Report date: 2026-03-11
Reported by: pengpeng <pengpeng@iscas.ac.cn>
Hello DPDK maintainers, I would like to report what appears to be a real
current-head overflow in the OpenSSL PMD SM2 setup path. I rechecked current
upstream head on 2026-03-10 before writing this report. The vulnerable code is:
```c uint8_t pubkey[65]; size_t len = 0; memset(pubkey, 0, sizeof(pubkey));
pubkey[0] = 0x04; len += 1; memcpy(&pubkey[len], xform->ec.q.x.data,
xform->ec.q.x.length); len += xform->ec.q.x.length; memcpy(&pubkey[len],
xform->ec.q.y.data, xform->ec.q.y.length); len += xform->ec.q.y.length; ``` The
generic EC point type used here is: ```c struct rte_crypto_ec_point {
rte_crypto_param x; rte_crypto_param y; }; typedef struct { ...
size_t length; } rte_crypto_param; ``` So at this layer, the coordinate lengths
are generic `size_t` values. I do not see a hard current-head type-level
invariant in the generic API that forces both SM2 coordinates to be 32 bytes
before this PMD code runs. I also checked the DPDK core asym session setup
path, and it still directly dispatches to the PMD: ```c ret =
dev->dev_ops->asym_session_configure(dev, xforms, sess); ``` That is why I do
not think capability tables or helper APIs are enough to refute the bug. The
PMD itself still appends `x` and `y` into a fixed `pubkey[65]` buffer with no
local bound such as `1 + xlen + ylen <= sizeof(pubkey)`. Why I think this is a
real current-head bug: - fixed stack buffer `pubkey[65]` - unchecked copies
using caller-supplied coordinate lengths - generic create path still reaches
the PMD directly - the overflow occurs before OpenSSL parameter building
completes I am keeping the claim narrow: this is an SM2 PMD parameter-setup
bug, not a claim that the generic API contract itself is invalid. The direct
fix is to reject any coordinate pair where `1 + xform->ec.q.x.length +
xform->ec.q.y.length > sizeof(pubkey)` before the copies.
--
You are receiving this mail because:
You are the assignee for the bug.
reply other threads:[~2026-08-28 10:34 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-2000-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