Segfault in rcu
Dmitry Kozlyuk
dmitry.kozliuk at gmail.com
Sat Mar 1 20:35:48 CET 2025
Hi Andre,
> @@ -386,7 +386,7 @@ rte_rcu_qsbr_dq_reclaim(struct rte_rcu_qsbr_dq *dq, unsigned int n,
>
> cnt = 0;
>
> - char data[dq->esize];
> + char *data = alloca(dq->esize);
> /* Check reader threads quiescent state and reclaim resources */
> while (cnt < n &&
> rte_ring_dequeue_bulk_elem_start(dq->r, &data,
In the last line, "&data" was equivalent to "data" when "data" was an array.
This is no longer true when "data" is a pointer.
Removing "&" fixes the issue.
Maybe coccinelle can check for similar mistakes caused by mechanical
replacement of VLA to alloca()?
More information about the dev
mailing list