Skip to content

Commit

Permalink
ofp-util: Check length of buckets in ofputil_pull_ofp15_group_mod().
Browse files Browse the repository at this point in the history
This code blindly read forward for the number of bytes specified by the
message without checking that it was in range.

This bug is part of OpenFlow 1.5 support.  Open vSwitch does not enable
OpenFlow 1.5 support by default.

Reported-by: Bhargava Shastry <bshastry@sec.t-labs.tu-berlin.de>
Signed-off-by: Ben Pfaff <blp@ovn.org>
Acked-by: Yi-Hung Wei <yihung.wei@gmail.com>
  • Loading branch information
blp committed Jul 7, 2017
1 parent fdbf476 commit 9cdb3e7
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions lib/ofp-util.c
Expand Up @@ -8813,6 +8813,9 @@ ofputil_pull_ofp15_group_mod(struct ofpbuf *msg, enum ofp_version ofp_version,
}

bucket_list_len = ntohs(ogm->bucket_array_len);
if (bucket_list_len > msg->size) {
return OFPERR_OFPBRC_BAD_LEN;
}
error = ofputil_pull_ofp15_buckets(msg, bucket_list_len, ofp_version,
gm->type, &gm->buckets);
if (error) {
Expand Down

0 comments on commit 9cdb3e7

Please sign in to comment.