diff options
author | Yifeng Sun <pkusunyifeng@gmail.com> | 2019-02-01 15:56:04 -0800 |
---|---|---|
committer | Ben Pfaff <blp@ovn.org> | 2019-02-04 12:44:53 -0800 |
commit | e14786fade181032aa83c339ba859887733756a5 (patch) | |
tree | 4061798de5add3860eb64f1685f8544b96b6457e | |
parent | af0840c34fbb6fb43359803c30aafa1aec14d708 (diff) | |
download | openvswitch-e14786fade181032aa83c339ba859887733756a5.tar.gz |
odp-util: Stop parse odp actions if nlattr is overflow
`encap = nl_msg_start_nested(key, OVS_KEY_ATTR_ENCAP)` ensures that
key->size >= (encap + NLA_HDRLEN), so the `if` statement is safe.
Reported-at: https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=11306
Signed-off-by: Yifeng Sun <pkusunyifeng@gmail.com>
Signed-off-by: Ben Pfaff <blp@ovn.org>
-rw-r--r-- | lib/odp-util.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/lib/odp-util.c b/lib/odp-util.c index c71b0e4df..0b893aca4 100644 --- a/lib/odp-util.c +++ b/lib/odp-util.c @@ -3764,6 +3764,10 @@ parse_odp_key_mask_attr(const char *s, const struct simap *port_names, if (retval < 0) { return retval; } + + if (nl_attr_oversized(key->size - encap - NLA_HDRLEN)) { + return -E2BIG; + } s += retval; } s++; |