summaryrefslogtreecommitdiff
path: root/ofproto/ofproto-dpif-upcall.h
diff options
context:
space:
mode:
authorBen Pfaff <blp@nicira.com>2014-02-25 08:01:01 -0800
committerBen Pfaff <blp@nicira.com>2014-02-25 08:01:01 -0800
commit3f142f59f2859ef5c2bc124405ab4d683d3f416b (patch)
tree32680d014f5d54c74081a6752283583e96987503 /ofproto/ofproto-dpif-upcall.h
parent5d5ffe9cb3a21b87a86b7f681922471241c7ef73 (diff)
downloadopenvswitch-3f142f59f2859ef5c2bc124405ab4d683d3f416b.tar.gz
ofproto-dpif: Complete all packet translations before freeing an ofproto.
The following scenario can occur: 1. Handler thread grabs a pointer to an ofproto in handle_upcalls(). 2. Main thread removes ofproto and destroys it in destruct(). 3. Handler thread uses pointer to ofproto and accesses freed memory. BOOM! Each individual step above happens under the xlate_rwlock, but the ofproto pointer is retained from step 1 to step 3, hence the problem. This commit fixes the problem by ensuring that after an ofproto is removed but before it is destroyed, all packet translations get pushed all the way through the upcall handler pipeline. (No new packet translations can get a pointer to the removed ofproto.) Bug #1200351. Signed-off-by: Ben Pfaff <blp@nicira.com> Acked-by: Alex Wang <alexw@nicira.com>
Diffstat (limited to 'ofproto/ofproto-dpif-upcall.h')
-rw-r--r--ofproto/ofproto-dpif-upcall.h3
1 files changed, 2 insertions, 1 deletions
diff --git a/ofproto/ofproto-dpif-upcall.h b/ofproto/ofproto-dpif-upcall.h
index d73ae4c9a..9eeee5b90 100644
--- a/ofproto/ofproto-dpif-upcall.h
+++ b/ofproto/ofproto-dpif-upcall.h
@@ -1,4 +1,4 @@
-/* Copyright (c) 2013 Nicira, Inc.
+/* Copyright (c) 2013, 2014 Nicira, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -29,6 +29,7 @@ struct simap;
struct udpif *udpif_create(struct dpif_backer *, struct dpif *);
void udpif_set_threads(struct udpif *, size_t n_handlers,
size_t n_revalidators);
+void udpif_synchronize(struct udpif *);
void udpif_destroy(struct udpif *);
void udpif_revalidate(struct udpif *);
void udpif_get_memory_usage(struct udpif *, struct simap *usage);