|SUCCESS| [v1,2/2] net/zxdh: avoid leaking flow entry on validation
dpdklab at iol.unh.edu
dpdklab at iol.unh.edu
Sat Nov 28 05:43:25 CET 2026
Test-Label: ai-code-review
Test-Status: SUCCESS
https://dpdk.org/patch/173300
_AI Code Review_
=== Patch Review: series.patch (via Claude) ===
Review date: 2026-11-28
**Patch 1/2: net/zxdh: bound resource table reply length before copying**
Info: the recv_buf bound depends on header-offset constants not visible in this diff.
```c
if (tbl_reps->len > max_len || tbl_reps->len > ZXDH_RSC_TBL_CONTENT_LEN_MAX) {
```
The copy starts at `recv_buf + ZXDH_REPS_HEADER_OFFSET + sizeof(struct zxdh_tbl_msg_reps_header)`, but `recv_buf` is `ZXDH_RSC_TBL_CONTENT_LEN_MAX + 8` bytes. Comparing against `ZXDH_RSC_TBL_CONTENT_LEN_MAX` is safe only if those two header terms add up to 8 bytes or less. Deriving the limit from the buffer itself makes it self-evidently correct and robust to future header changes:
```c
size_t off = ZXDH_REPS_HEADER_OFFSET + sizeof(struct zxdh_tbl_msg_reps_header);
if (tbl_reps->len > max_len || tbl_reps->len > sizeof(recv_buf) - off)
```
Info: the function mixes two error-code conventions. It returns `ZXDH_BAR_MSG_ERR_*` codes elsewhere but `-EINVAL` for the new length check. Both current callers only test `!= ZXDH_BAR_MSG_OK`, so behaviour is correct. A `ZXDH_BAR_MSG_ERR_*` code would keep the convention consistent.
Review-Result: CLEAN
More information about the test-report
mailing list