diff options
author | Anju Thomas <anju.thomas@ericsson.com> | 2018-05-07 22:58:06 +0530 |
---|---|---|
committer | Ben Pfaff <blp@ovn.org> | 2018-05-10 16:40:52 -0700 |
commit | d0485f488f68e4a40e9aa7df4ebca853d7264441 (patch) | |
tree | 2d95902b818c19f38ab02959e13fedd3c7970a65 /ofproto/bundles.h | |
parent | fb8635c53853729e64d4f0d9c9e515e11da0ca0e (diff) | |
download | openvswitch-d0485f488f68e4a40e9aa7df4ebca853d7264441.tar.gz |
ofproto: Fix crash processing malformed Bundle Add message.
When an OpenFlow Bundle Add message is received, a bundle entry is
created and the OpenFlow message embedded in the bundle add message is
processed. If any error is encountered while processing the embedded
message, the bundle entry is freed. The bundle entry free function
assumes that the entry has been populated with a properly formatted
OpenFlow message and performs some message specific cleanup actions .
This assumption does not hold true in the error case and OVS crashes
when performing the cleanup.
The fix is in case of errors, simply free the bundle entry without
attempting to perform any embedded message cleanup
Signed-off-by: Anju Thomas <anju.thomas@ericsson.com>
Signed-off-by: Ben Pfaff <blp@ovn.org>
Diffstat (limited to 'ofproto/bundles.h')
-rw-r--r-- | ofproto/bundles.h | 13 |
1 files changed, 0 insertions, 13 deletions
diff --git a/ofproto/bundles.h b/ofproto/bundles.h index 806e853d6..1164fddd8 100644 --- a/ofproto/bundles.h +++ b/ofproto/bundles.h @@ -58,8 +58,6 @@ struct ofp_bundle { struct ovs_list msg_list; /* List of 'struct bundle_message's */ }; -static inline struct ofp_bundle_entry *ofp_bundle_entry_alloc( - enum ofptype type, const struct ofp_header *oh); static inline void ofp_bundle_entry_free(struct ofp_bundle_entry *); enum ofperr ofp_bundle_open(struct ofconn *, uint32_t id, uint16_t flags, @@ -72,17 +70,6 @@ enum ofperr ofp_bundle_add_message(struct ofconn *, uint32_t id, void ofp_bundle_remove__(struct ofconn *, struct ofp_bundle *); -static inline struct ofp_bundle_entry * -ofp_bundle_entry_alloc(enum ofptype type, const struct ofp_header *oh) -{ - struct ofp_bundle_entry *entry = xmalloc(sizeof *entry); - - entry->type = type; - entry->msg = xmemdup(oh, ntohs(oh->length)); - - return entry; -} - static inline void ofp_bundle_entry_free(struct ofp_bundle_entry *entry) { |