Skip to content

Commit

Permalink
ofp-actions: Fix buffer overread in decode_LEARN_specs().
Browse files Browse the repository at this point in the history
The length check was wrong for immediate arguments to "learn" actions.

Reported-at: https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=9047
Signed-off-by: Ben Pfaff <blp@ovn.org>
Acked-by: Justin Pettit <jpettit@ovn.org>
  • Loading branch information
blp committed Jul 5, 2018
1 parent d46c43b commit ba8a319
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/ofp-actions.c
Expand Up @@ -3736,7 +3736,7 @@ learn_min_len(uint16_t header)
min_len += sizeof(ovs_be32); /* src_field */
min_len += sizeof(ovs_be16); /* src_ofs */
} else {
min_len += DIV_ROUND_UP(n_bits, 16);
min_len += 2 * DIV_ROUND_UP(n_bits, 16);
}
if (dst_type == NX_LEARN_DST_MATCH ||
dst_type == NX_LEARN_DST_LOAD) {
Expand Down

0 comments on commit ba8a319

Please sign in to comment.