Skip to content

Commit 4af6da3

Browse files
committed
ofp-group: Don't assert-fail decoding bad OF1.5 group mod type or command.
When decoding a group mod, the current code validates the group type and command after the whole group mod has been decoded. The OF1.5 decoder, however, tries to use the type and command earlier, when it might still be invalid. This caused an assertion failure (via OVS_NOT_REACHED). This commit fixes the problem. ovs-vswitchd does not enable support for OpenFlow 1.5 by default. Reported-at: https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=9249 Signed-off-by: Ben Pfaff <blp@ovn.org> Reviewed-by: Yifeng Sun <pkusunyifeng@gmail.com>
1 parent 0e1367a commit 4af6da3

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

Diff for: lib/ofp-util.c

+2-2
Original file line numberDiff line numberDiff line change
@@ -8941,7 +8941,7 @@ parse_group_prop_ntr_selection_method(struct ofpbuf *payload,
89418941
"only allowed for select groups");
89428942
return OFPERR_OFPBPC_BAD_VALUE;
89438943
default:
8944-
OVS_NOT_REACHED();
8944+
return OFPERR_OFPGMFC_BAD_TYPE;
89458945
}
89468946

89478947
switch (group_cmd) {
@@ -8956,7 +8956,7 @@ parse_group_prop_ntr_selection_method(struct ofpbuf *payload,
89568956
"only allowed for add and delete group modifications");
89578957
return OFPERR_OFPBPC_BAD_VALUE;
89588958
default:
8959-
OVS_NOT_REACHED();
8959+
return OFPERR_OFPGMFC_BAD_COMMAND;
89608960
}
89618961

89628962
if (payload->size < sizeof *prop) {

0 commit comments

Comments
 (0)