vcl: fix iperf3 server crash issue when it runs over vpp host stack. 30/36130/10
authorLiangxing Wang <liangxing.wang@arm.com>
Fri, 13 May 2022 04:24:19 +0000 (04:24 +0000)
committerFlorin Coras <florin.coras@gmail.com>
Fri, 10 Jun 2022 18:11:58 +0000 (18:11 +0000)
commit2211277f3af5a6f50fedb3c6ccf65d4e96b1192a
treeee7c34f7ea5f952c7f1bdf97246f91ac5b44b078
parent0d5f1a6c5449092ef4503e57e1e68d0032bc67ef
vcl: fix iperf3 server crash issue when it runs over vpp host stack.

Issue:

Let iperf3 server run via ldp and vcl on top of vpp's host stack. If
iperf3 client connects this iperf3 server with tcp MSS setting option,
iperf3 server will always crash.

Root cause:

When MSS option is specified by iperf3 client, iperf3 server will
recreate the listening socket firstly, then call setsockopt() to set MSS
immediately. Iperf3 code can be referred here:
https://github.com/esnet/iperf/blob/58332f8154e2140e40a6e0ea060a418138291718/src/iperf_tcp.c#L186.
However, in vcl layer vpp_evt_q of this recreated session is not
allocated yet. So iperf3 server crashes with vpp_evt_q null pointer access.

Fix:

Add session vpp_evt_q null pointer check in vcl_session_transport_attr().
Add a vcl test case for this MSS option scenario.

Type: fix
Signed-off-by: Liangxing Wang <liangxing.wang@arm.com>
Change-Id: I2863bd0cffbe6e60108ab333f97c00530c006ba7
src/vcl/vppcom.c
test/test_vcl.py