[ovs-dev] [PATCH] flow: Clear ovs_nsh_key's context data when nsh's type can't be handled

Yifeng Sun pkusunyifeng at gmail.com
Thu Oct 4 21:23:39 UTC 2018


In the default case when nsh's md_type is not recognized by nsh parser,
uninitialized data in key->context can sneak into miniflow. This
patch fixes it.

Reported-at: https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=10519
Signed-off-by: Yifeng Sun <pkusunyifeng at gmail.com>
---
 lib/flow.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/lib/flow.c b/lib/flow.c
index 79e4627407a3..47b01fce834a 100644
--- a/lib/flow.c
+++ b/lib/flow.c
@@ -576,6 +576,7 @@ parse_nsh(const void **datap, size_t *sizep, struct ovs_key_nsh *key)
             break;
         default:
             /* We don't parse other context headers yet. */
+            memset(key->context, 0, sizeof(key->context));
             break;
     }
 
-- 
2.7.4



More information about the dev mailing list