Skip to content

Commit

Permalink
netlink: added check to prevent netlink attribute overflow
Browse files Browse the repository at this point in the history
If enough large input is passed to odp_actions_from_string it can
cause netlink attribute to overflow.
Check for buffer size was added to prevent entering this function
and returning appropriate error code.

Basic manual testing was performed.

Reported-by: https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=12231
Signed-off-by: Toms Atteka <cpp.code.lv@gmail.com>
Signed-off-by: Ben Pfaff <blp@ovn.org>
  • Loading branch information
TomCodeLV authored and blp committed Feb 22, 2019
1 parent e8ef351 commit 4802961
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions lib/odp-util.c
Expand Up @@ -2070,6 +2070,10 @@ parse_action_list(const char *s, const struct simap *port_names,
n += retval;
}

if (actions->size > UINT16_MAX) {
return -EFBIG;
}

return n;
}

Expand Down

0 comments on commit 4802961

Please sign in to comment.