[ovs-dev] [PATCH] ofp-group: Don't assert-fail decoding bad OF1.5 group mod type or command.

Ben Pfaff blp at ovn.org
Sat Jul 7 00:51:26 UTC 2018


Thanks, applied to master and backported as far as branch-2.4.

On Fri, Jul 06, 2018 at 04:24:35PM -0700, Yifeng Sun wrote:
> Looks good to me. Thanks.
> 
> Reviewed-by: Yifeng Sun <pkusunyifeng at gmail.com>
> 
> On Thu, Jul 5, 2018 at 3:28 PM, Ben Pfaff <blp at ovn.org> wrote:
> 
> > 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 at ovn.org>
> > ---
> >  lib/ofp-group.c | 4 ++--
> >  1 file changed, 2 insertions(+), 2 deletions(-)
> >
> > diff --git a/lib/ofp-group.c b/lib/ofp-group.c
> > index 697208f0e9f6..f6e5242f5244 100644
> > --- a/lib/ofp-group.c
> > +++ b/lib/ofp-group.c
> > @@ -1547,7 +1547,7 @@ parse_group_prop_ntr_selection_method(struct ofpbuf
> > *payload,
> >                      "only allowed for select groups");
> >          return OFPERR_OFPBPC_BAD_VALUE;
> >      default:
> > -        OVS_NOT_REACHED();
> > +        return OFPERR_OFPGMFC_BAD_TYPE;
> >      }
> >
> >      switch (group_cmd) {
> > @@ -1562,7 +1562,7 @@ parse_group_prop_ntr_selection_method(struct ofpbuf
> > *payload,
> >                      "only allowed for add and delete group
> > modifications");
> >          return OFPERR_OFPBPC_BAD_VALUE;
> >      default:
> > -        OVS_NOT_REACHED();
> > +        return OFPERR_OFPGMFC_BAD_COMMAND;
> >      }
> >
> >      if (payload->size < sizeof *prop) {
> > --
> > 2.16.1
> >
> > _______________________________________________
> > dev mailing list
> > dev at openvswitch.org
> > https://mail.openvswitch.org/mailman/listinfo/ovs-dev
> >


More information about the dev mailing list