|WARNING| [v1, 11/11] vdpa/sfc: fix doorbell address in notify area query

dpdklab at iol.unh.edu dpdklab at iol.unh.edu
Thu Nov 26 17:48:17 CET 2026


Test-Label: ai-code-review
Test-Status: WARNING
https://dpdk.org/patch/173223

_AI Code Review_

=== Patch Review: series.patch (via Claude) ===
Review date: 2026-11-26

**Patch 02/11 (bus/cdx: fix eventfd setup when enabling interrupts)**

Warning: the eventfd copy loop is bounded by `nb_efd`, but the buffer is sized by `nb_intr`.

```c
len = sizeof(*irq_set) + sizeof(int) * (size_t)nb_intr;
...
for (i = 0; i < nb_efd; i++)
	fd_ptr[i] = rte_intr_efds_index_get(intr_handle, i);
```

Nothing in this function checks that `nb_efd <= nb_intr`. The commit's stated goal is to stop writing past the end of the request buffer. If an interrupt handle ever has more efds than interrupts, this loop still overruns the heap allocation.

Suggested fix: reject the mismatch up front, or clamp the loop bound.

```c
if (nb_efd > nb_intr) {
	CDX_BUS_ERR("More eventfds (%d) than interrupts (%d)", nb_efd, nb_intr);
	return -1;
}
```

Info: `free(irq_set)` now runs between the `ioctl()` and the error path. Per the hunk context, that error path reports the failure, and `free()` was not guaranteed to preserve `errno` before POSIX.1-2024. If the error log or return value relies on `errno`, save it right after the `ioctl()`, or move the `free()` after the error handling.

Review-Result: WARNING


More information about the test-report mailing list