[ovs-dev] [PATCH] ofproto: Fix crash on flow monitor request with tun_metadata.

Ben Pfaff blp at ovn.org
Thu Jan 5 00:04:59 UTC 2017


On Tue, Dec 27, 2016 at 07:39:52PM -0800, Daniele Di Proietto wrote:
> nx_put_match() needs a non-NULL tunnel metadata table, otherwise it will
> crash if a flow matches on tunnel metadata.
> 
> This wasn't handled in ofputil_append_flow_update(), causing a crash
> when the controller sent a flow monitor request.
> 
> To fix the problem, this commit changes ofputil_append_flow_update() to
> behave like ofputil_append_flow_stats_reply().
> Since ofputil_append_flow_update() now needs to temporarily modify the
> match, this commits also embeds 'struct match' into 'struct
> ofputil_flow_update', to be safer.  This is more similar to
> 'struct ofputil_flow_stats'.
> 
> A regression test is added and a comment is updated in ovs-ofctl.c
> 
>  #0  0x000055699bd82fa0 in memcpy_from_metadata (dst=0x7ffc770930d0, src=0x7ffc77093698, loc=0x18) at ../lib/tun-metadata.c:451
>  #1  0x000055699bd83c2e in metadata_loc_from_match_read (map=0x0, match=0x7ffc77093410, idx=0, mask=0x7ffc77093658, is_masked=0x7ffc77093287) at ../lib/tun-metadata.c:848
>  #2  0x000055699bd83d9b in tun_metadata_to_nx_match (b=0x55699d3f0300, oxm=0, match=0x7ffc77093410) at ../lib/tun-metadata.c:871
>  #3  0x000055699bce523d in nx_put_raw (b=0x55699d3f0300, oxm=0, match=0x7ffc77093410, cookie=0, cookie_mask=0) at ../lib/nx-match.c:1052
>  #4  0x000055699bce5580 in nx_put_match (b=0x55699d3f0300, match=0x7ffc77093410, cookie=0, cookie_mask=0) at ../lib/nx-match.c:1116
>  #5  0x000055699bd3926f in ofputil_append_flow_update (update=0x7ffc770940b0, replies=0x7ffc77094e00) at ../lib/ofp-util.c:6805
>  #6  0x000055699bc4b5a9 in ofproto_compose_flow_refresh_update (rule=0x55699d405b40, flags=(NXFMF_INITIAL | NXFMF_ACTIONS), msgs=0x7ffc77094e00) at ../ofproto/ofproto.c:5915
>  #7  0x000055699bc4b5f6 in ofmonitor_compose_refresh_updates (rules=0x7ffc77094e10, msgs=0x7ffc77094e00) at ../ofproto/ofproto.c:5929
>  #8  0x000055699bc4bafc in handle_flow_monitor_request (ofconn=0x55699d404090, oh=0x55699d404220) at ../ofproto/ofproto.c:6082
>  #9  0x000055699bc4f46d in handle_openflow__ (ofconn=0x55699d404090, msg=0x55699d404910) at ../ofproto/ofproto.c:7912
>  #10 0x000055699bc4f5df in handle_openflow (ofconn=0x55699d404090, ofp_msg=0x55699d404910) at ../ofproto/ofproto.c:8002
>  #11 0x000055699bc88154 in ofconn_run (ofconn=0x55699d404090, handle_openflow=0x55699bc4f5bc <handle_openflow>) at ../ofproto/connmgr.c:1427
>  #12 0x000055699bc85934 in connmgr_run (mgr=0x55699d3adb90, handle_openflow=0x55699bc4f5bc <handle_openflow>) at ../ofproto/connmgr.c:363
>  #13 0x000055699bc422c9 in ofproto_run (p=0x55699d3c85e0) at ../ofproto/ofproto.c:1798
>  #14 0x000055699bc31ec6 in bridge_run__ () at ../vswitchd/bridge.c:2881
>  #15 0x000055699bc320a6 in bridge_run () at ../vswitchd/bridge.c:2938
>  #16 0x000055699bc3784e in main (argc=10, argv=0x7ffc770952c8) at ../vswitchd/ovs-vswitchd.c:111
> 
> Fixes: 8d8ab6c2d574 ("tun-metadata: Manage tunnel TLV mapping table on a
> per-bridge basis.")
> 
> Signed-off-by: Daniele Di Proietto <diproiettod at vmware.com>

Thank you!

Acked-by: Ben Pfaff <blp at ovn.org>


More information about the dev mailing list