summaryrefslogtreecommitdiff
path: root/ofproto
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:39:56 +0200
commit805e9340d561e28838fa0dd35ad3babfe1d6db6f (patch)
tree27c36601521f8e70cdcff7d7cd48dd16cc1c67a6 /ofproto
parentc67941e974da243795806e9ad478d49a2f1aa793 (diff)
downloadopenvswitch-805e9340d561e28838fa0dd35ad3babfe1d6db6f.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>
Diffstat (limited to 'ofproto')
-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 7a1bb0d18..d7544ef69 100644
--- a/ofproto/ofproto-dpif.c
+++ b/ofproto/ofproto-dpif.c
@@ -1848,6 +1848,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);
}