From: Chaoyong He <chaoyong.he@corigine.com>
To: Stephen Hemminger <stephen@networkplumber.org>,
"dev@dpdk.org" <dev@dpdk.org>
Subject: RE: [PATCH] net/nfp: fix duplicate call to rte_free
Date: Thu, 10 Oct 2024 02:11:44 +0000 [thread overview]
Message-ID: <SJ0PR13MB55458352AA1AA0614B5E8D9B9E782@SJ0PR13MB5545.namprd13.prod.outlook.com> (raw)
In-Reply-To: <20240927215753.606098-1-stephen@networkplumber.org>
> -----Original Message-----
> From: Stephen Hemminger <stephen@networkplumber.org>
> Sent: Saturday, September 28, 2024 5:58 AM
> To: dev@dpdk.org
> Cc: Stephen Hemminger <stephen@networkplumber.org>; Chaoyong He
> <chaoyong.he@corigine.com>; Niklas Söderlund
> <niklas.soderlund@corigine.com>
> Subject: [PATCH] net/nfp: fix duplicate call to rte_free
>
> Calling rte_free twice on same object will corrupt the heap.
> Warning is:
> In function 'nfp_pre_tun_table_check_del', inlined from 'nfp_flow_destroy'
> at ../drivers/net/nfp/flower/nfp_flower_flow.c:5143:9:
> ../drivers/net/nfp/flower/nfp_flower_flow.c:3830:9: error: pointer 'entry'
> used after 'rte_free' [-Werror=use-after-free]
> 3830 | rte_free(entry);
> | ^~~~~~~~~~~~~~~
> ../drivers/net/nfp/flower/nfp_flower_flow.c:3825:9: note: call to 'rte_free'
> here
> 3825 | rte_free(entry);
> | ^~~~~~~~~~~~~~~
>
> Fixes: d3c33bdf1f18 ("net/nfp: prepare for IPv4 UDP tunnel decap flow
> action")
> Cc: chaoyong.he@corigine.com
> Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
> ---
> drivers/net/nfp/flower/nfp_flower_flow.c | 1 -
> 1 file changed, 1 deletion(-)
>
> diff --git a/drivers/net/nfp/flower/nfp_flower_flow.c
> b/drivers/net/nfp/flower/nfp_flower_flow.c
> index 0078455658..64a0062c8b 100644
> --- a/drivers/net/nfp/flower/nfp_flower_flow.c
> +++ b/drivers/net/nfp/flower/nfp_flower_flow.c
> @@ -3822,7 +3822,6 @@ nfp_pre_tun_table_check_del(struct
> nfp_flower_representor *repr,
> goto free_entry;
> }
>
> - rte_free(entry);
> rte_free(find_entry);
> priv->pre_tun_cnt--;
>
> --
> 2.45.2
Thanks for helping fix this bug.
Acked-by: Chaoyong He <chaoyong.he@corigine.com>
prev parent reply other threads:[~2024-10-10 2:11 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-09-27 21:57 Stephen Hemminger
2024-10-10 2:11 ` Chaoyong He [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=SJ0PR13MB55458352AA1AA0614B5E8D9B9E782@SJ0PR13MB5545.namprd13.prod.outlook.com \
--to=chaoyong.he@corigine.com \
--cc=dev@dpdk.org \
--cc=stephen@networkplumber.org \
/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).