From 99c9ba8ec013b89138440b85ffc061bb90377114 Mon Sep 17 00:00:00 2001 From: Yifeng Sun Date: Fri, 1 Feb 2019 15:56:04 -0800 Subject: 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 Signed-off-by: Ben Pfaff --- lib/odp-util.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/lib/odp-util.c b/lib/odp-util.c index d83159c4f..fca28f937 100644 --- a/lib/odp-util.c +++ b/lib/odp-util.c @@ -2330,6 +2330,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++; -- cgit v1.2.1