Skip to content

Commit

Permalink
ofproto: Fix using uninitialized delete_reason.
Browse files Browse the repository at this point in the history
replace_rule_finish() makes decision using uninitialized
for intrenal flow fm->delete_reason.
Reported by valgrind for test cases 886, 942 and 943.

 Conditional jump or move depends on uninitialised value(s)
    at rule_insert (ofproto-dpif.c:4134)
    by replace_rule_finish (ofproto.c:4831)
    by add_flow_finish (ofproto.c:4661)
    by modify_flows_finish (ofproto.c:4994)
    by ofproto_flow_mod_finish (ofproto.c:6821)
    by handle_flow_mod__ (ofproto.c:5323)
    by ofproto_dpif_add_internal_flow (ofproto-dpif.c:5680)
    by add_internal_miss_flow (ofproto-dpif.c:1385)
    by add_internal_flows (ofproto-dpif.c:1412)
    by construct (ofproto-dpif.c:1367)
    by ofproto_create (ofproto.c:577)
    by bridge_reconfigure (bridge.c:633)
    by bridge_run (bridge.c:2975)
    by main (ovs-vswitchd.c:120)
  Uninitialised value was created by a stack allocation
    at ofproto_dpif_add_internal_flow (ofproto-dpif.c:5658)

Signed-off-by: Ilya Maximets <[email protected]>
Signed-off-by: Ben Pfaff <[email protected]>
  • Loading branch information
igsilya authored and blp committed Jan 4, 2016
1 parent 8f1beba commit 5077bbe
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions ofproto/ofproto-dpif.c
Original file line number Diff line number Diff line change
Expand Up @@ -5676,6 +5676,7 @@ ofproto_dpif_add_internal_flow(struct ofproto_dpif *ofproto,
ofm.fm.flags = OFPUTIL_FF_HIDDEN_FIELDS | OFPUTIL_FF_NO_READONLY;
ofm.fm.ofpacts = ofpacts->data;
ofm.fm.ofpacts_len = ofpacts->size;
ofm.fm.delete_reason = OVS_OFPRR_NONE;

error = ofproto_flow_mod(&ofproto->up, &ofm);
if (error) {
Expand Down

0 comments on commit 5077bbe

Please sign in to comment.