Skip to content

Commit

Permalink
dpif-netlink: Fix using uninitialized info.tc_modify_flow_deleted in …
Browse files Browse the repository at this point in the history
…out label.

Before info.tc_modify_flow_deleted is assigned a value, error
processing of other statements goes to the out label. In the
out label, the uninitialized variant is used for condition
determination, which may cause uncertain behavior.

Fixes: 65b84d4 ("dpif-netlink: avoid netlink modify flow put op failed after tc modify flow put op failed.")
Signed-off-by: Mengfan Lv <lvmengfan@huawei.com>
Signed-off-by: Yunjian Wang <wangyunjian@huawei.com>
Reviewed-by: Simon Horman <simon.horman@netronome.com>
Signed-off-by: Ilya Maximets <i.maximets@ovn.org>
  • Loading branch information
wyjwang authored and igsilya committed Apr 19, 2021
1 parent 1c2a5f1 commit 4f68040
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/dpif-netlink.c
Expand Up @@ -2047,6 +2047,7 @@ parse_flow_put(struct dpif_netlink *dpif, struct dpif_flow_put *put)
uint8_t csum_on = false;
int err;

info.tc_modify_flow_deleted = false;
if (put->flags & DPIF_FP_PROBE) {
return EOPNOTSUPP;
}
Expand Down Expand Up @@ -2092,7 +2093,6 @@ parse_flow_put(struct dpif_netlink *dpif, struct dpif_flow_put *put)
info.tunnel_csum_on = csum_on;
info.recirc_id_shared_with_tc = (dpif->user_features
& OVS_DP_F_TC_RECIRC_SHARING);
info.tc_modify_flow_deleted = false;
err = netdev_flow_put(dev, &match,
CONST_CAST(struct nlattr *, put->actions),
put->actions_len,
Expand Down

0 comments on commit 4f68040

Please sign in to comment.