From: Rasesh Mody Date: Tue, 19 Sep 2017 01:30:07 +0000 (-0700) Subject: net/qede/base: prevent stop vport assert by malicious VF X-Git-Tag: spdx-start~1915 X-Git-Url: http://git.droids-corp.org/?a=commitdiff_plain;h=c1454460c406fe0a45ab22fb72806caa02ec7967;p=dpdk.git net/qede/base: prevent stop vport assert by malicious VF PF checks upon stop-vport from VF whether it's legal, but if it's not it would STILL send the request to FW, which might cause it to assert. Signed-off-by: Rasesh Mody --- diff --git a/drivers/net/qede/base/ecore_sriov.c b/drivers/net/qede/base/ecore_sriov.c index a70ca30bf6..792cf7507d 100644 --- a/drivers/net/qede/base/ecore_sriov.c +++ b/drivers/net/qede/base/ecore_sriov.c @@ -2121,6 +2121,8 @@ static void ecore_iov_vf_mbx_stop_vport(struct ecore_hwfn *p_hwfn, "VF [%02x] - considered malicious;" " Unable to stop RX/TX queuess\n", vf->abs_vf_id); + status = PFVF_STATUS_MALICIOUS; + goto out; } rc = ecore_sp_vport_stop(p_hwfn, vf->opaque_fid, vf->vport_id); @@ -2134,6 +2136,7 @@ static void ecore_iov_vf_mbx_stop_vport(struct ecore_hwfn *p_hwfn, vf->configured_features = 0; OSAL_MEMSET(&vf->shadow_config, 0, sizeof(vf->shadow_config)); +out: ecore_iov_prepare_resp(p_hwfn, p_ptt, vf, CHANNEL_TLV_VPORT_TEARDOWN, sizeof(struct pfvf_def_resp_tlv), status); }