openvswitch: use after free in __ovs_ct_free_action()
Subsystems (4)
PATCH 1/1 openvswitch: use after free in __ovs_ct_free_action()
We free "ct_info->ct" and then use it on the next line when we pass it to nf_ct_destroy_timeout(). This patch swaps the order to avoid the use after free.
Fixes 06bd2bdf19d2 ("openvswitch: Add timeout support to ct action")
Signed-off-by Dan Carpenter <[email protected]>
--- net/openvswitch/conntrack.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
net/openvswitch/conntrack.c +1 -1
@@ -1804,9 +1804,9 @@ static void __ovs_ct_free_action(struct ovs_conntrack_info *ct_info)if (ct_info->helper)nf_conntrack_helper_put (ct_info->helper);if (ct_info->ct) { -nf_ct_tmpl_free (ct_info->ct);if (ct_info->timeout[0 ])nf_ct_destroy_timeout (ct_info->ct); +nf_ct_tmpl_free (ct_info->ct); } }
Signature · 1 line
2.17.1
Quoted 8 lines · Dan Carpenter
We free "
ct_info->ct" and then use it on the next line when we pass it tonf_ct_destroy_timeout(). This patch swaps the order to avoid the use after free.Fixes 06bd2bdf19d2 ("openvswitch: Add timeout support to ct action")Signed-off-by Dan Carpenter <[email protected]>---
Thanks for the fix.
Acked-by Yi-Hung Wei <[email protected]>
From: Dan Carpenter <[email protected]>
Date: Tue, 2 Apr 2019 09:53:14 +0300
Quoted 6 lines
We free "
ct_info->ct" and then use it on the next line when we pass it tonf_ct_destroy_timeout(). This patch swaps the order to avoid the use after free.Fixes 06bd2bdf19d2 ("openvswitch: Add timeout support to ct action")Signed-off-by Dan Carpenter <[email protected]>
Applied, thanks.