|WARNING| crypto/armv8: validate xform auth key length
dpdklab at iol.unh.edu
dpdklab at iol.unh.edu
Mon Nov 2 13:20:31 CET 2026
Test-Label: ai-code-review
Test-Status: WARNING
https://dpdk.org/patch/171175
_AI Code Review_
=== Patch Review: series.patch (via Claude) ===
Review date: 2026-11-02
# DPDK Patch Review
## ERRORS
None.
## WARNINGS
**1. Missing release notes update**
The patch adds new validation behavior that will cause previously-accepted (albeit buggy) configurations to be rejected. This is a functional change that should be documented in the release notes.
**Location:** `doc/guides/rel_notes/release_26_11.rst` (or appropriate current release file)
**Suggested fix:** Add an entry under the crypto section:
```rst
* **crypto/armv8: Added authentication key validation**
The ARMv8 crypto PMD now validates authentication key length and data pointer
in ``auth_set_prerequisites()``. Configurations with key length exceeding
``SHA_BLOCK_MAX`` or NULL key data pointer will now be rejected with ``-EINVAL``.
```
---
**2. Error return code should be -EINVAL, not -1**
The function returns a generic -1, but DPDK convention is to return specific errno values. Other validation failures in the crypto subsystem use `-EINVAL` for invalid parameters.
**Location:** Line 268 in the patch (`return -1;`)
**Suggested fix:**
```c
if (xform->auth.key.data == NULL ||
xform->auth.key.length > SHA_BLOCK_MAX) {
ARMV8_CRYPTO_LOG_ERR("Invalid authentication key provided.");
return -EINVAL;
}
```
---
**3. Key length zero should also be rejected**
The patch validates that the key is not too long and that the data pointer is not NULL, but does not check for zero-length keys. A zero-length HMAC key is cryptographically meaningless and should be rejected alongside other invalid configurations.
**Location:** Line 266 in the patch (the validation condition)
**Suggested fix:**
```c
if (xform->auth.key.data == NULL ||
xform->auth.key.length == 0 ||
xform->auth.key.length > SHA_BLOCK_MAX) {
ARMV8_CRYPTO_LOG_ERR("Invalid authentication key provided.");
return -EINVAL;
}
```
---
## INFO
**Pre-existing: SHA_BLOCK_MAX definition not visible in patch**
The validation uses `SHA_BLOCK_MAX` as the upper bound. This constant is not defined or modified in the patch, so its correctness cannot be verified from the patch alone. The reviewer assumes it is correctly defined elsewhere in the driver and matches the actual hash block sizes supported by this PMD (typically 64 or 128 bytes depending on the hash algorithm).
Review-Result: WARNING
More information about the test-report
mailing list