diff options
author | Yi-Hung Wei <yihung.wei@gmail.com> | 2018-05-03 09:49:50 -0700 |
---|---|---|
committer | Ben Pfaff <blp@ovn.org> | 2018-05-03 22:37:34 -0700 |
commit | 254878c18874f6cb43a7601427d0cc30834ab64a (patch) | |
tree | 12005607449643ab117cb89132afe8db27822a61 /ofproto | |
parent | f624bf23b62a991070a3e452776d40486d6e240e (diff) | |
download | openvswitch-254878c18874f6cb43a7601427d0cc30834ab64a.tar.gz |
ofproto-dpif-xlate: Fix segmentation fault caused by tun_table
Currently, the revalidator thread may hit segmentation fault when geneve
TLV map is updated. It is because we may store the old TLV map (struct
tun_table) in the frozen state for recirculation, and we may access the
already freed old tun_table in xlate_actions().
This patch update the logic of getting tun_table so that we will use
the latest tun_table instead of the frozen one.
VMWare-BZ: #2106987
Signed-off-by: Yi-Hung Wei <yihung.wei@gmail.com>
Signed-off-by: Ben Pfaff <blp@ovn.org>
Diffstat (limited to 'ofproto')
-rw-r--r-- | ofproto/ofproto-dpif-xlate.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/ofproto/ofproto-dpif-xlate.c b/ofproto/ofproto-dpif-xlate.c index 94e3ddb13..5641724a7 100644 --- a/ofproto/ofproto-dpif-xlate.c +++ b/ofproto/ofproto-dpif-xlate.c @@ -7138,10 +7138,14 @@ xlate_actions(struct xlate_in *xin, struct xlate_out *xout) ctx.error = XLATE_INVALID_TUNNEL_METADATA; goto exit; } - } else if (!flow->tunnel.metadata.tab) { + } else if (!flow->tunnel.metadata.tab || xin->frozen_state) { /* If the original flow did not come in on a tunnel, then it won't have * FLOW_TNL_F_UDPIF set. However, we still need to have a metadata * table in case we generate tunnel actions. */ + /* If the translation is from a frozen state, we use the latest + * TLV map to avoid segmentation fault in case the old TLV map is + * replaced by a new one. + * XXX: It is better to abort translation if the table is changed. */ flow->tunnel.metadata.tab = ofproto_get_tun_tab( &ctx.xbridge->ofproto->up); } |