From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from NAM03-DM3-obe.outbound.protection.outlook.com (mail-dm3nam03on0047.outbound.protection.outlook.com [104.47.41.47]) by dpdk.org (Postfix) with ESMTP id DBB651B65C for ; Tue, 7 Nov 2017 09:35:49 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=CAVIUMNETWORKS.onmicrosoft.com; s=selector1-cavium-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=0nZIl/MC/JSUbJpVZXUPNc9f4fqmTjAHjRDphIZ4dt0=; b=Ks4EMzlaoLzkX3IhTaVmbLzky4dKwhnCLF+UdeNRLHotiHu4r+0i0hfq6v42xdKs84TOIOP2PTNpHywd3IXMnzmAYiayQKyv+RfiJJpPFCYuRNkT1Di/V/sly0Tvgf6/DRMOOd9dM0uE98GkV+G7Lm2NkTG4PDD/fZTzM9MvnuA= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=Rasesh.Mody@cavium.com; Received: from cavium.com (198.186.0.2) by CY4PR0701MB3827.namprd07.prod.outlook.com (2603:10b6:910:94::33) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.197.13; Tue, 7 Nov 2017 08:35:48 +0000 From: Rasesh Mody To: dev@dpdk.org Cc: Rasesh Mody , ferruh.yigit@intel.com, Dept-EngDPDKDev@cavium.com Date: Tue, 7 Nov 2017 00:34:25 -0800 Message-Id: <1510043665-8160-9-git-send-email-rasesh.mody@cavium.com> X-Mailer: git-send-email 1.7.10.3 In-Reply-To: <1510043665-8160-1-git-send-email-rasesh.mody@cavium.com> References: <1510043665-8160-1-git-send-email-rasesh.mody@cavium.com> MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [198.186.0.2] X-ClientProxiedBy: YQXPR0101CA0004.CANPRD01.PROD.OUTLOOK.COM (2603:10b6:c00:15::17) To CY4PR0701MB3827.namprd07.prod.outlook.com (2603:10b6:910:94::33) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: dab2e603-3d18-4fcf-5d6b-08d525ba8c3a X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(22001)(4534020)(4602075)(4627115)(201703031133081)(201702281549075)(2017052603199); SRVR:CY4PR0701MB3827; X-Microsoft-Exchange-Diagnostics: 1; CY4PR0701MB3827; 3:RfhM+9Fl3gd7SC90WWAwm+1K9I97jOYOhPzq3tOOSCUv1YeGQz+PFkHyJjdFLENduR0jl0hPs7A+WwBOpmyZY65Cb9l9wN4efUjiCUazAdtaal1vNV2n7kTlJ48dxogiO/9Sv+S5yT56mlMDHZ0he9LA3zwsivOgpKQm65QB4ptf7f5Qal1LDMQnk2LkA0JVsAiYYHFegh9LcJeboRdRnqc9xs4bfpDnlLg2dZ4OYDYoFOGP5rUVV7CxS5Xgd5WY; 25:6AtUS39yS+nON5oXWyq/05sTbmZlwDZGu/gLfcQ7LNez2KKl6ewIh6jx1joR811aMEBcil6u8FedDwQMTivIa2Y7HY+a5d5ayMm48642Xoxix6HIOCYKJym7ScvSdzK/MGp53ARZdwx81fMyGTeIUab5cE49KloXCuzoX7QhhsHb68vKN7ugtZUsugwRRgrtPuTydYtZbuc8Rbb+TRi/MwQhSwDhBww2W0YZip+7LgtHUfJ9JiTV+h4yFwfFqDEoP7P0r2iLnUy/5c8y8ILWJnOpdV1j0FOIRSQYnS2ash1a4WhgX+wGlnXYSpG+kpRdFF31q1D8hCjvRWHE2emK4w==; 31:bX86aReT/nqaDvkJVvVF/ozPKaO4MakKNWM4/0rirlNnBNs1SLh86LjJSTDzgmsO3rcsAlTnlySL5Lg5bQpzO1WXpAzH8V9Tl4uSuPuH/JxTIMZtvV6GQVmo+aj8NjuvnkqdyJG0EMeOz3omfUHY/1GKZpFxJtNTJAfmV/ZXr896pBsDPePlLPa93MTDA9w7oAdZmrsobY3MKFsGsX+ZOXgDd4fF5V73oVd+sUOjN9E= X-MS-TrafficTypeDiagnostic: CY4PR0701MB3827: X-Microsoft-Exchange-Diagnostics: 1; CY4PR0701MB3827; 20:VAaqdJ1M3q716xLtE855r6Jr4Q10iOIFHwRuuzJ5WBBXIB0cBjqdlyyTTnKXYXDwQI8FRg2OzMfK6EFTvkniwuX7uX94s5QQQAtZF5nMMwVHSAwFY/v3gYP3em6HXc13nLZO1BDw/QQY5qPdt+sbWAB864gevBUpd9eJNX9bpP2nTjrFqMlOZ6hcQpPcHSj+Xc1v7Poirc2oXKbvJtlBVSn9kpnAUVyBc19h4uwTd8p/5W083HV8WutToALpHXWDKVwUD2VF1gPBKBm5728td6IUx/PUbL1UB7KLjf6zQ/qRc6mSdN7JxJnrS9Qw6TfUhm2N+76EW/qXYfOIbssokL/qVcnj2Lef+4Q/aIucRlhCJECRN4rwj4meTdfaiMnopKS+RKtyU332UMcJ4nPYDTfo1sGYUNDSNLNjmlPYuKBu1xbpSRnTu1FCpj/oc4rECnV7h1IXm3Hk/EfitsqNccrWbPvlq/NZS7DB9vdRNDfoedN8T05yFfVfbcUwsj92; 4:Eq9s3gjq0l2WFwUgCH4RxwrrC69C+Z+A1QdOX2F+T1VUS/DWaifTCGCA+scFAAJGxCnHKf6WlliDJ4TgvISYHWq5QAADt60zlhVxfKot7r3mHxRSAr+GmQj57Y7tnYACaAtWL2FR8yjdNK9iPQwCoVEBVq+OAfL/5B4EntipwtGwSRrOAfUgAb+f37/UoiGaBYLTsKRI6KGT7t2NBDvbxqoErxpcxeOvBgjiDHOiaPbRLWkyqkqaYXx2tDO8IvaMrnbdjIcEULEGW67vObwPYg== X-Exchange-Antispam-Report-Test: UriScan:; X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(100000700101)(100105000095)(100000701101)(100105300095)(100000702101)(100105100095)(6040450)(2401047)(8121501046)(5005006)(3002001)(10201501046)(93006095)(93001095)(100000703101)(100105400095)(3231021)(6041248)(20161123562025)(20161123564025)(20161123558100)(20161123560025)(201703131423075)(201702281528075)(201703061421075)(201703061406153)(20161123555025)(6072148)(201708071742011)(100000704101)(100105200095)(100000705101)(100105500095); SRVR:CY4PR0701MB3827; BCL:0; PCL:0; RULEID:(100000800101)(100110000095)(100000801101)(100110300095)(100000802101)(100110100095)(100000803101)(100110400095)(100000804101)(100110200095)(100000805101)(100110500095); SRVR:CY4PR0701MB3827; X-Forefront-PRVS: 0484063412 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(6009001)(376002)(346002)(189002)(199003)(2351001)(47776003)(50226002)(6916009)(36756003)(76176999)(53936002)(8936002)(68736007)(55016002)(2950100002)(4326008)(48376002)(50466002)(50986999)(5003940100001)(66066001)(97736004)(8676002)(86362001)(316002)(16586007)(81156014)(81166006)(2361001)(478600001)(33646002)(72206003)(6666003)(305945005)(21086003)(106356001)(7736002)(69596002)(107886003)(189998001)(4720700003)(25786009)(2906002)(5660300001)(6116002)(105586002)(16526018)(3846002)(101416001); DIR:OUT; SFP:1101; SCL:1; SRVR:CY4PR0701MB3827; H:cavium.com; FPR:; SPF:None; PTR:InfoNoRecords; MX:1; A:1; LANG:en; Received-SPF: None (protection.outlook.com: cavium.com does not designate permitted sender hosts) X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; CY4PR0701MB3827; 23:lRhZFhzQe264mYFqKRRM/Vekqs4A4fuNKBYjt8b?= =?us-ascii?Q?bNlBI/yS9UJaAic949m5ZdH+jJuECSDkYrXbHO+ZRC71Z/G3zd1lsW72OG2u?= =?us-ascii?Q?TwiLwF6AaxRZE1KL6BO0oNsKsQCxSXdrPeEC8K5YWVUvAqMo2WjQoULijjAb?= =?us-ascii?Q?RDDRbuJABH7bb9k8/N4JL+ENYM9spvMBXZb7hVC7aQ+5iWoHpg/amNQhQxkh?= =?us-ascii?Q?EYBJ6K2DmC44N+GWXiI3+Ju/YekPMOtzoBhubQ6BmQ1ZuvvWLk5CWkpEo5ei?= =?us-ascii?Q?Ifxx9qR1OPE5eczlmfKDe/LiPzn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?= =?us-ascii?Q?cvgBVvfzUwGnDHr8=3D?= X-Microsoft-Exchange-Diagnostics: 1; CY4PR0701MB3827; 6:ofwR+6OgqBS2z0JeBrSnpZvDY2AeaAdt40cflybyipxk58SkoAjj91N/99u2bxx4cNFLnK5/mFGJBoqNiYulsoVIw9MjivV2E6W1e/MxJOicZnZwnhnc1IW4fbo3WHl1wu4yaF7ortYfBNP+AotPhmGH9oVgmyZ4uQ7HsN9i0QYhBgZrWlcQAu/3Dqhy9UEUBnnBhB9GzfTX1Xk/IRa3XgYvhsChZA9n8iaSRJAb1XdpQFzdMsFy93VgCA+hvuwne/e+UiHfr74E/xvNCXkI7Q7ZbCA4A19h7vMg72xTQBUP8HYfZXsdh33RUPXOUfZ3QEZprhlkotYI8mY7FODmvgwhCQMKeX82Dd5Prx2hFIg=; 5:xEICXiJqooQ5poweDVXlRtIW025jRg/PCzxxoXMfIZJC9lv0WHp6Qocp5vyouM81+Fxqiyqx0jZ8B+OsRgpwmD54o7zjOX76mC0+8XtH3+NIUsjUSfSiKBfCc8/XwL59n0uNedIquRB+Bka5s2SfwuUtWv8DrOVIIolyWum8erY=; 24:ArvN++UdmOV6f7Is3gXNHPtc9RHQWpuT3v1AFAqLTOe5jltMgPAzgBwsgzSzJVLhxZcLb/SymV+KTB0utyFKlOWX/R7xOcuELFpB43+SJS4=; 7:BnYmJBQT4yjTz44PLONgI/EF5xLIQwwOVSeCYq96K7vNu040/kTFqKwDhGKFqCZeVwPz8s/VWqfzKFcx/S1vE542EE/Ss8srt5/2/hIb0gIQbsSORb2kN+S5rofwZTYpTvWBd1oOMd0q1WxzKljpxzxb3vAzJLc83+H/6eskyPRFHZiaukYJbjFqxGDyldiQvZj9ZBmtYVt3SjkKgFsAk01LM6VmlInJhb0UQ7ILcAMl+iApGRAcw55Tp7QugYnW SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: cavium.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 07 Nov 2017 08:35:48.0979 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: dab2e603-3d18-4fcf-5d6b-08d525ba8c3a X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 711e4ccf-2e9b-4bcf-a551-4094005b6194 X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY4PR0701MB3827 Subject: [dpdk-dev] [PATCH 8/8] net/qede: fix null pointer dereferences X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 07 Nov 2017 08:35:50 -0000 Fix null pointer dereferences in qede_vxlan_enable() and qede_conf_udp_dst_port() Coverity issue: 195010, 195012, 198439 Fixes: e0947ed912f7 ("net/qede: add support for VXLAN UDP port config over VF") Fixes: 739a5b2f2b49 ("net/qede/base: use passed ptt handler") Signed-off-by: Rasesh Mody --- drivers/net/qede/qede_ethdev.c | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/drivers/net/qede/qede_ethdev.c b/drivers/net/qede/qede_ethdev.c index 7a589a2..8832145 100644 --- a/drivers/net/qede/qede_ethdev.c +++ b/drivers/net/qede/qede_ethdev.c @@ -631,7 +631,13 @@ static void qede_set_ucast_cmn_params(struct ecore_filter_ucast *ucast) for_each_hwfn(edev, i) { p_hwfn = &edev->hwfns[i]; - p_ptt = IS_PF(edev) ? ecore_ptt_acquire(p_hwfn) : NULL; + if (IS_PF(edev)) { + p_ptt = ecore_ptt_acquire(p_hwfn); + if (!p_ptt) + return -EAGAIN; + } else { + p_ptt = NULL; + } rc = ecore_sp_pf_update_tunn_cfg(p_hwfn, p_ptt, &tunn, ECORE_SPQ_MODE_CB, NULL); if (rc != ECORE_SUCCESS) { @@ -2258,7 +2264,13 @@ static int qede_set_mtu(struct rte_eth_dev *dev, uint16_t mtu) tunn.vxlan_port.port = udp_port; for_each_hwfn(edev, i) { p_hwfn = &edev->hwfns[i]; - p_ptt = IS_PF(edev) ? ecore_ptt_acquire(p_hwfn) : NULL; + if (IS_PF(edev)) { + p_ptt = ecore_ptt_acquire(p_hwfn); + if (!p_ptt) + return -EAGAIN; + } else { + p_ptt = NULL; + } rc = ecore_sp_pf_update_tunn_cfg(p_hwfn, p_ptt, &tunn, ECORE_SPQ_MODE_CB, NULL); if (rc != ECORE_SUCCESS) { -- 1.7.10.3