[ovs-git] [openvswitch/ovs] 31629b: ovs-ofctl: Fix segfault due to bad meter n_bands.

Flaviof noreply at github.com
Wed Mar 31 23:43:23 UTC 2021


  Branch: refs/heads/master
  Home:   https://github.com/openvswitch/ovs
  Commit: 31629b5383c3ce2d3ca63377deade28498bb8a1b
      https://github.com/openvswitch/ovs/commit/31629b5383c3ce2d3ca63377deade28498bb8a1b
  Author: Flavio Fernandes <flavio at flaviof.com>
  Date:   2021-04-01 (Thu, 01 Apr 2021)

  Changed paths:
    M tests/dpif-netdev.at
    M utilities/ovs-ofctl.c

  Log Message:
  -----------
  ovs-ofctl: Fix segfault due to bad meter n_bands.

Meter commands internally use ofctl_meter_mod__() and
ofctl_meter_request__() functions, which have an optional parameter
called str.  When str is NULL, these 2 functions initialize a struct
with meter bands set as NULL. It also needs to set meter n_bands to 0.

Once del-meters change in test dpif-netdev.at is added, the valgrind
report on test '992: dpif-netdev - meters' shows this issue:

   Conditional jump or move depends on uninitialised value(s)
      at 0x473534: ofputil_put_bands (ofp-meter.c:207)
      by 0x473534: ofputil_encode_meter_mod (ofp-meter.c:557)
      by 0x40FBA2: ofctl_meter_mod__ (ovs-ofctl.c:4038)
      by 0x417BD3: ovs_cmdl_run_command__ (command-line.c:247)
      by 0x4078BA: main (ovs-ofctl.c:179)
    Uninitialised value was created by a stack allocation
      at 0x409350: ofctl_del_meters (ovs-ofctl.c:4088)

Fixes: 3200ed5805 ("ovs-ofctl: Add meter support.")
Signed-off-by: Flavio Fernandes <flavio at flaviof.com>
Acked-by: Aaron Conole <aconole at redhat.com>
Signed-off-by: Ilya Maximets <i.maximets at ovn.org>




More information about the git mailing list