DPDK patches and discussions
 help / color / mirror / Atom feed
From: David Marchand <david.marchand@redhat.com>
To: David Marchand <david.marchand@redhat.com>
Cc: dev@dpdk.org, thomas@monjalon.net,
	Renyong Wan <wanry@yunsilicon.com>,  Na Na <nana@yunsilicon.com>,
	Rong Qian <qianr@yunsilicon.com>,
	 Xiaoxiong Zhang <zhangxx@yunsilicon.com>,
	Dongwei Xu <xudw@yunsilicon.com>
Subject: Re: [PATCH] net/xsc: fix use after free in some RXQ cleanup
Date: Tue, 9 Sep 2025 16:45:17 +0200	[thread overview]
Message-ID: <CAJFAV8yLSJAEsKCfkvUJZKUskQ0jQiB-S-9ymHRDHPKsXf07yA@mail.gmail.com> (raw)
In-Reply-To: <20250909070427.2711048-1-david.marchand@redhat.com>

On Tue, 9 Sept 2025 at 09:05, David Marchand <david.marchand@redhat.com> wrote:
>
> Debian 12 gcc complains about a use after free in this cleanup section.
>
> [7/11] Compiling C object drivers/libtmp_rte_net_xsc.a.p/net_xsc_xsc_rx.c.o
> In function 'xsc_rss_qp_create',
>     inlined from 'xsc_rxq_rss_obj_new' at ../drivers/net/xsc/xsc_rx.c:565:8:
> ../drivers/net/xsc/xsc_rx.c:501:9: warning: pointer 'req' may be used after
>         'free' [-Wuse-after-free]
>   501 |         free(req);
>       |         ^~~~~~~~~
> ../drivers/net/xsc/xsc_rx.c:501:9: note: call to 'free' here
>
> Indeed, req may be free'd twice, as an error in the cleanup loop may
> jump back to the set_qp_fail label.
>
> Instead, skip the erroneous rxq and don't touch errno since all the code
> jumping to set_qp_fail already sets it.
>
> Fixes: 3991c890fb4c ("net/xsc: optimize RSS queue creation")
>
> Signed-off-by: David Marchand <david.marchand@redhat.com>
> Acked-by: Renyong Wan <wanry@yunsilicon.com>

Applied, thanks.


-- 
David Marchand


      parent reply	other threads:[~2025-09-09 14:45 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-09-09  7:04 David Marchand
2025-09-09  8:08 ` Renyong Wan
2025-09-09  9:22   ` Thomas Monjalon
2025-09-09 13:04     ` Renyong Wan
2025-09-09 14:45 ` David Marchand [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CAJFAV8yLSJAEsKCfkvUJZKUskQ0jQiB-S-9ymHRDHPKsXf07yA@mail.gmail.com \
    --to=david.marchand@redhat.com \
    --cc=dev@dpdk.org \
    --cc=nana@yunsilicon.com \
    --cc=qianr@yunsilicon.com \
    --cc=thomas@monjalon.net \
    --cc=wanry@yunsilicon.com \
    --cc=xudw@yunsilicon.com \
    --cc=zhangxx@yunsilicon.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).