DPDK patches and discussions
 help / color / mirror / Atom feed
* [dpdk-dev] [PATCH] net/sfc: fix double free on encap. transfer flow rule path
@ 2020-11-16 19:23 Ivan Malov
  2020-11-17  7:39 ` Andrew Rybchenko
  0 siblings, 1 reply; 3+ messages in thread
From: Ivan Malov @ 2020-11-16 19:23 UTC (permalink / raw)
  To: dev; +Cc: Andrew Rybchenko, Andy Moreton

Don't free the outer match spec by its pointer in the parsing context
if it has already been tracked by an entry in the outer rule registry.

Fixes: dadff137931c ("net/sfc: support encap flow items in transfer rules")

Signed-off-by: Ivan Malov <ivan.malov@oktetlabs.ru>
---
 drivers/net/sfc/sfc_mae.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/drivers/net/sfc/sfc_mae.c b/drivers/net/sfc/sfc_mae.c
index c78a376a8..4ddfef556 100644
--- a/drivers/net/sfc/sfc_mae.c
+++ b/drivers/net/sfc/sfc_mae.c
@@ -1607,6 +1607,9 @@ sfc_mae_rule_process_outer(struct sfc_adapter *sa,
 		}
 	}
 
+	/* The spec has now been tracked by the outer rule entry. */
+	ctx->match_spec_outer = NULL;
+
 	/*
 	 * Depending on whether we reuse an existing outer rule or create a
 	 * new one (see above), outer rule ID is either a valid value or
@@ -1717,7 +1720,8 @@ sfc_mae_rule_encap_parse_fini(struct sfc_adapter *sa,
 	if (ctx->encap_type == EFX_TUNNEL_PROTOCOL_NONE)
 		return;
 
-	efx_mae_match_spec_fini(sa->nic, ctx->match_spec_outer);
+	if (ctx->match_spec_outer != NULL)
+		efx_mae_match_spec_fini(sa->nic, ctx->match_spec_outer);
 }
 
 int
-- 
2.20.1


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [dpdk-dev] [PATCH] net/sfc: fix double free on encap. transfer flow rule path
  2020-11-16 19:23 [dpdk-dev] [PATCH] net/sfc: fix double free on encap. transfer flow rule path Ivan Malov
@ 2020-11-17  7:39 ` Andrew Rybchenko
  2020-11-17 13:34   ` Ferruh Yigit
  0 siblings, 1 reply; 3+ messages in thread
From: Andrew Rybchenko @ 2020-11-17  7:39 UTC (permalink / raw)
  To: Ivan Malov, dev; +Cc: Andy Moreton

On 11/16/20 10:23 PM, Ivan Malov wrote:
> Don't free the outer match spec by its pointer in the parsing context
> if it has already been tracked by an entry in the outer rule registry.
> 
> Fixes: dadff137931c ("net/sfc: support encap flow items in transfer rules")
> 
> Signed-off-by: Ivan Malov <ivan.malov@oktetlabs.ru>

Acked-by: Andrew Rybchenko <andrew.rybchenko@oktetlabs.ru>

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [dpdk-dev] [PATCH] net/sfc: fix double free on encap. transfer flow rule path
  2020-11-17  7:39 ` Andrew Rybchenko
@ 2020-11-17 13:34   ` Ferruh Yigit
  0 siblings, 0 replies; 3+ messages in thread
From: Ferruh Yigit @ 2020-11-17 13:34 UTC (permalink / raw)
  To: Andrew Rybchenko, Ivan Malov, dev; +Cc: Andy Moreton

On 11/17/2020 7:39 AM, Andrew Rybchenko wrote:
> On 11/16/20 10:23 PM, Ivan Malov wrote:
>> Don't free the outer match spec by its pointer in the parsing context
>> if it has already been tracked by an entry in the outer rule registry.
>>
>> Fixes: dadff137931c ("net/sfc: support encap flow items in transfer rules")
>>
>> Signed-off-by: Ivan Malov <ivan.malov@oktetlabs.ru>
> 
> Acked-by: Andrew Rybchenko <andrew.rybchenko@oktetlabs.ru>
> 

Applied to dpdk-next-net/main, thanks.

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2020-11-17 13:35 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-11-16 19:23 [dpdk-dev] [PATCH] net/sfc: fix double free on encap. transfer flow rule path Ivan Malov
2020-11-17  7:39 ` Andrew Rybchenko
2020-11-17 13:34   ` Ferruh Yigit

DPDK patches and discussions

This inbox may be cloned and mirrored by anyone:

	git clone --mirror https://inbox.dpdk.org/dev/0 dev/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 dev dev/ https://inbox.dpdk.org/dev \
		dev@dpdk.org
	public-inbox-index dev

Example config snippet for mirrors.
Newsgroup available over NNTP:
	nntp://inbox.dpdk.org/inbox.dpdk.dev


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git