From: Bruce Richardson <bruce.richardson@intel.com>
To: Dawid Wesierski <dawid.wesierski@intel.com>
Cc: <dev@dpdk.org>, <vladimir.medvedkin@intel.com>,
<anatoly.burakov@intel.com>, <marek.kasiewicz@intel.com>
Subject: Re: [PATCH 1/3] net/iavf: fix invalid free of queue TC map
Date: Mon, 19 Oct 2026 17:47:16 +0100 [thread overview]
Message-ID: <atZJlMewvnJu781L@bricha3-mobl1.ger.corp.intel.com> (raw)
In-Reply-To: <20261014122419.631288-2-dawid.wesierski@intel.com>
On Wed, Oct 14, 2026 at 12:24:16PM +0000, Dawid Wesierski wrote:
> iavf_hierarchy_commit() allocates the queue TC map with calloc(), and
> it frees the previous map with free(old_qtc_map) after a successful
> commit. A later change added rte_free(vf->qtc_map) in front of that
> free(), because it was written for a tree that still leaked the map.
>
> After the first commit, rte_free() gets a pointer from the libc
> heap, and free() then releases the same pointer a second time.
> rte_free() reads a malloc_elem header in the bytes in front of the
> pointer. It usually logs "Invalid memory" and returns, but the result
> depends on the contents of the libc heap.
>
> Remove the rte_free() call. free(old_qtc_map) releases the old map.
>
> Fixes: f6e33f09f766 ("net/iavf: disable runtime queue setup when rate limiting")
>
> Signed-off-by: Dawid Wesierski <dawid.wesierski@intel.com>
> ---
Acked-by: Bruce Richardson <bruce.richardson@intel.com>
> drivers/net/intel/iavf/iavf_tm.c | 1 -
> 1 file changed, 1 deletion(-)
>
> diff --git a/drivers/net/intel/iavf/iavf_tm.c b/drivers/net/intel/iavf/iavf_tm.c
> index fc84bf7e6b..603da09bb5 100644
> --- a/drivers/net/intel/iavf/iavf_tm.c
> +++ b/drivers/net/intel/iavf/iavf_tm.c
> @@ -913,7 +913,6 @@ static int iavf_hierarchy_commit(struct rte_eth_dev *dev,
> goto fail_clear;
>
> /* replace the previously committed mapping, if any */
> - rte_free(vf->qtc_map);
> vf->qtc_map = qtc_map;
> free(old_qtc_map);
> if (adapter->stopped == 1)
> --
> 2.43.0
>
next prev parent reply other threads:[~2026-10-19 16:47 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-10-14 12:24 [PATCH 0/3] net/iavf: fix TM hierarchy commit and TM ops without QoS Dawid Wesierski
2026-10-14 12:24 ` [PATCH 1/3] net/iavf: fix invalid free of queue TC map Dawid Wesierski
2026-10-19 16:47 ` Bruce Richardson [this message]
2026-10-19 17:06 ` Bruce Richardson
2026-10-20 15:22 ` Dawid Wesierski
2026-10-14 12:24 ` [PATCH 2/3] net/iavf: fix bandwidth config of unshaped queues Dawid Wesierski
2026-10-20 9:33 ` Bruce Richardson
2026-10-20 15:22 ` Dawid Wesierski
2026-10-14 12:24 ` [PATCH 3/3] net/iavf: fix crash in TM ops without QoS capability Dawid Wesierski
2026-10-20 9:50 ` Bruce Richardson
2026-10-20 15:22 ` [PATCH v2 0/3] net/iavf: fix TM hierarchy commit and TM ops without QoS Dawid Wesierski
2026-10-20 15:22 ` [PATCH v2 1/3] net/iavf: fix invalid free of queue TC map Dawid Wesierski
2026-10-20 15:22 ` [PATCH v2 2/3] net/iavf: fix bandwidth config of unshaped queues Dawid Wesierski
2026-10-20 15:22 ` [PATCH v2 3/3] net/iavf: fix crash in TM ops without QoS capability Dawid Wesierski
2026-10-20 16:56 ` [PATCH v2 0/3] net/iavf: fix TM hierarchy commit and TM ops without QoS Bruce Richardson
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=atZJlMewvnJu781L@bricha3-mobl1.ger.corp.intel.com \
--to=bruce.richardson@intel.com \
--cc=anatoly.burakov@intel.com \
--cc=dawid.wesierski@intel.com \
--cc=dev@dpdk.org \
--cc=marek.kasiewicz@intel.com \
--cc=vladimir.medvedkin@intel.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