summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPeng He <hepeng.0320@bytedance.com>2022-05-26 03:13:17 +0000
committerIlya Maximets <i.maximets@ovn.org>2022-05-30 23:41:12 +0200
commit89fe949a67e473d571a84983342da4fc1240efae (patch)
tree472dd78391f81408d9b3aa67b15e67e448c00979
parentbe852fbaf19f0ce312d84f6774b1ff4d0f98ac39 (diff)
downloadopenvswitch-89fe949a67e473d571a84983342da4fc1240efae.tar.gz
ofproto-dpif: Fix meter use-after-free.
Add a rcu_barrier before close_dpif_backer to ensure that all meters have been freed before id_pool_destory meter's id-pool. Signed-off-by: Peng He <hepeng.0320@bytedance.com> Tested-by: David Marchand <david.marchand@redhat.com> Reviewed-by: David Marchand <david.marchand@redhat.com> Acked-by: Eelco Chaudron <echaudro@redhat.com> Acked-by: Aaron Conole <aconole@redhat.com> Signed-off-by: Ilya Maximets <i.maximets@ovn.org>
-rw-r--r--ofproto/ofproto-dpif.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/ofproto/ofproto-dpif.c b/ofproto/ofproto-dpif.c
index f426ffdc5..0bf5eeb40 100644
--- a/ofproto/ofproto-dpif.c
+++ b/ofproto/ofproto-dpif.c
@@ -1804,6 +1804,8 @@ destruct(struct ofproto *ofproto_, bool del)
seq_destroy(ofproto->ams_seq);
+ /* Wait for all the meter destroy work to finish. */
+ ovsrcu_barrier();
close_dpif_backer(ofproto->backer, del);
}