2
0
mirror of https://github.com/openvswitch/ovs synced 2025-08-31 14:25:26 +00:00

odp-util: Fix fuzz runtime error of invalid dont_send value

Oss-fuzz complains that (struct user_action_cookie)->controller->dont_send
has invalid vlue, like below:
runtime error: load of value 26, which is not a valid value for type 'bool'

From this piece of code "cookie.controller.dont_send ? 1 : 0", it looks
like that we want to tolerate values than 0 and 1.

Thus, this patch changes the types of dont_send and continuation from bool
to uint8_t in order to make oss-fuzz happy.

Reported-at: https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=11330
Signed-off-by: Yifeng Sun <pkusunyifeng@gmail.com>
Signed-off-by: Ben Pfaff <blp@ovn.org>
This commit is contained in:
Yifeng Sun
2018-12-26 16:52:23 -08:00
committed by Ben Pfaff
parent e883321791
commit abaf6dcf68
2 changed files with 4 additions and 4 deletions

View File

@@ -496,8 +496,8 @@ format_odp_userspace_action(struct ds *ds, const struct nlattr *attr,
",controller_id=%"PRIu16
",max_len=%"PRIu16,
cookie.controller.reason,
cookie.controller.dont_send ? 1 : 0,
cookie.controller.continuation ? 1 : 0,
!!cookie.controller.dont_send,
!!cookie.controller.continuation,
cookie.controller.recirc_id,
ntohll(get_32aligned_be64(
&cookie.controller.rule_cookie)),