|WARNING| net/memif: fix use after free on listener socket close
dpdklab at iol.unh.edu
dpdklab at iol.unh.edu
Wed Nov 4 18:18:49 CET 2026
Test-Label: ai-code-review
Test-Status: WARNING
https://dpdk.org/patch/172641
_AI Code Review_
=== Patch Review: series.patch (via Claude) ===
Review date: 2026-11-04
# DPDK Patch Review
## Analysis
This patch addresses a use-after-free issue in the memif driver by switching from `rte_intr_callback_unregister()` to `rte_intr_callback_unregister_sync()`. I have verified that the code change correctly prevents the race condition described in the commit message.
### Correctness
The patch correctly identifies and fixes a use-after-free scenario:
- **Original code**: If `memif_listener_handler()` is executing when `rte_intr_callback_unregister()` is called, the function returns `-EAGAIN` but the code continues to close and free the interrupt handle via `rte_intr_fd_close()` and `rte_intr_instance_free()`. This creates a window where the handler can access freed resources.
- **Fixed code**: `rte_intr_callback_unregister_sync()` blocks until the handler completes, ensuring the handle is not freed while still in use.
The fix is appropriate and follows the pattern used elsewhere in DPDK for safe interrupt handler cleanup.
### Code Style
The patch follows DPDK coding style:
- Indentation is correct
- Line length is within limits (<=100 characters)
- Function call formatting is consistent with surrounding code
- The change maintains the existing code structure
### Documentation and Testing
The patch includes:
- A clear commit message explaining the bug and the fix
- A `Fixes:` tag referencing the commit that introduced the issue
- No documentation changes needed (internal implementation fix)
- No API changes that would require release notes
**Note**: The patch does not include `Cc: stable at dpdk.org`, which should be added since this is a bug fix for a use-after-free issue that affects stable releases.
## Findings
### WARNINGS
**Missing Cc: stable at dpdk.org tag**
This patch fixes a use-after-free bug and should be backported to stable releases. The commit message should include:
```
Cc: stable at dpdk.org
```
Review-Result: WARNING
More information about the test-report
mailing list