From: "Burakov, Anatoly" <anatoly.burakov@intel.com>
To: "Mandal, Anurag" <anurag.mandal@intel.com>,
"dev@dpdk.org" <dev@dpdk.org>
Cc: "Richardson, Bruce" <bruce.richardson@intel.com>
Subject: Re: [PATCH v1 5/7] net/iavf: fix hash flow metadata leaks
Date: Fri, 16 Oct 2026 13:00:19 +0200 [thread overview]
Message-ID: <554c8393-4a9e-4185-90dd-73fe22b7afc6@intel.com> (raw)
In-Reply-To: <AT6PR11MB044526DC14053DED4A12805BFAE49B2@AT6PR11MB044526.namprd11.prod.outlook.com>
On 10/16/2026 5:12 AM, Mandal, Anurag wrote:
>
>> -----Original Message-----
>> From: Anatoly Burakov <anatoly.burakov@intel.com>
>> Sent: 14 October 2026 20:49
>> To: dev@dpdk.org
>> Subject: [PATCH v1 5/7] net/iavf: fix hash flow metadata leaks
>>
>> Hash flow parsing allocates RSS metadata, but validation has no callback to
>> release it. Creation also leaks the metadata if rule allocation or the request to
>> add the RSS rule fails.
>>
>> Add a validation callback to release the parsed metadata, and free it on both
>> creation failure paths. Parsing already checks the RSS inputs; validation does
>> not add or remove a rule.
>>
>> Fixes: 7be10c3004be ("net/iavf: add RSS configuration for VF")
>> Fixes: 215a247b5f33 ("net/iavf: refactor hash flow")
>> Cc: stable@dpdk.org
>>
>> Signed-off-by: Anatoly Burakov <anatoly.burakov@intel.com>
>> ---
>> drivers/net/intel/iavf/iavf_hash.c | 15 +++++++++++++++
>> 1 file changed, 15 insertions(+)
>>
>> diff --git a/drivers/net/intel/iavf/iavf_hash.c
>> b/drivers/net/intel/iavf/iavf_hash.c
>> index cef30cd08e1..6787a380f8e 100644
>> --- a/drivers/net/intel/iavf/iavf_hash.c
>> +++ b/drivers/net/intel/iavf/iavf_hash.c
>> @@ -80,6 +80,9 @@ iavf_hash_destroy(struct iavf_adapter *ad, struct
>> rte_flow *flow, static void iavf_hash_uninit_parser(struct iavf_adapter *ad);
>> static int
>> +iavf_hash_validation(struct iavf_adapter *ad, struct rte_flow *flow,
>> + void *meta, struct rte_flow_error *error); static int
>> iavf_hash_parse_pattern_action(struct iavf_adapter *ad,
>> struct iavf_pattern_match_item *array,
>> uint32_t array_len,
>> @@ -680,6 +683,7 @@ static struct iavf_flow_engine iavf_hash_engine = {
>> .create = iavf_hash_create,
>> .destroy = iavf_hash_destroy,
>> .uninit = iavf_hash_uninit_parser,
>> + .validation = iavf_hash_validation,
>> .name = "hash",
>> .type = IAVF_FLOW_ENGINE_HASH,
>> .rule_size = sizeof(struct virtchnl_rss_cfg), @@ -1579,6 +1583,15 @@
>> iavf_hash_parse_pattern_action(struct iavf_adapter *ad,
>> return ret;
>> }
>>
>> +static int
>> +iavf_hash_validation(__rte_unused struct iavf_adapter *ad,
>> + __rte_unused struct rte_flow *flow, void *meta,
>> + __rte_unused struct rte_flow_error *error) {
>> + rte_free(meta);
>> + return 0;
>> +}
>> +
>> static int
>> iavf_hash_create(__rte_unused struct iavf_adapter *ad,
>> __rte_unused struct rte_flow *flow, void *meta, @@ -1594,6
>> +1607,7 @@ iavf_hash_create(__rte_unused struct iavf_adapter *ad,
>> rte_flow_error_set(error, EINVAL,
>> RTE_FLOW_ERROR_TYPE_HANDLE, NULL,
>> "No memory for rss rule");
>> + rte_free(meta);
>> return -ENOMEM;
>> }
>>
>> @@ -1609,6 +1623,7 @@ iavf_hash_create(__rte_unused struct iavf_adapter
>> *ad,
>> RTE_FLOW_ERROR_TYPE_HANDLE, NULL,
>> "Failed to add rss rule.");
>> rte_free(rss_cfg);
>> + rte_free(meta);
>> return -rte_errno;
>> }
>>
>> --
>> 2.52.0
>
> Hi Anatoly,
>
> I had submitted similar fix in this patch earlier.
> https://patches.dpdk.org/project/dpdk/patch/20261010121255.528329-1-anurag.mandal@intel.com/
>
> Thanks,
> Anurag M
Thanks, I didn't see it before! Your patch fixes some things mine
doesn't, and vice versa, so what I'll do (if you don't mind!) is I'll
respin my patchset and include your patch with my additions.
--
Thanks,
Anatoly
next prev parent reply other threads:[~2026-10-16 11:01 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-10-14 15:18 [PATCH v1 0/7] IAVF Fixes Anatoly Burakov
2026-10-14 15:18 ` [PATCH v1 1/7] net/iavf: fix memory leak in flow teardown Anatoly Burakov
2026-10-14 15:18 ` [PATCH v1 2/7] net/iavf: fix null engine for egress security flows Anatoly Burakov
2026-10-14 15:18 ` [PATCH v1 3/7] net/iavf: fix generic flow error-path leaks Anatoly Burakov
2026-10-14 15:18 ` [PATCH v1 4/7] net/iavf: fix flow subscription metadata leaks Anatoly Burakov
2026-10-14 15:18 ` [PATCH v1 5/7] net/iavf: fix hash flow " Anatoly Burakov
2026-10-16 3:12 ` Mandal, Anurag
2026-10-16 11:00 ` Burakov, Anatoly [this message]
2026-10-14 15:18 ` [PATCH v1 6/7] net/iavf: fix IPsec " Anatoly Burakov
2026-10-14 15:18 ` [PATCH v1 7/7] net/iavf: do not store ethdev pointer Anatoly Burakov
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=554c8393-4a9e-4185-90dd-73fe22b7afc6@intel.com \
--to=anatoly.burakov@intel.com \
--cc=anurag.mandal@intel.com \
--cc=bruce.richardson@intel.com \
--cc=dev@dpdk.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