Segfault in rcu
Andre Muezerie
andremue at linux.microsoft.com
Mon Mar 3 22:37:22 CET 2025
On Sat, Mar 01, 2025 at 10:35:48PM +0300, Dmitry Kozlyuk wrote:
> 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()?
That makes sense. Thanks Dmitry.
More information about the dev
mailing list