From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id C34B9A04FF; Tue, 22 Mar 2022 04:20:22 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id A1FB6427EE; Tue, 22 Mar 2022 04:20:22 +0100 (CET) Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by mails.dpdk.org (Postfix) with ESMTP id 4DEA1427EE for ; Tue, 22 Mar 2022 04:20:21 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1647919220; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=DCFmmG2d7Q32bJOm5ZBF1K8/mAIGQI8U8VDLB3GSfKY=; b=NEp1Ks4EpvjgA5uI2ESqJshtGz4oG/mQawKhwgDm6u5KI+MKstKb/Cv65+wZmsQYwrR+Fi 5DMIzUjxCVpYNK5kYk9TaKR1GtslUMFFczBMaTGUHNm84KYRHSzYY6q9UWOr7RMiz31KpM diB790rTPAivJb3FtUzsKfiENJdoQf8= Received: from mimecast-mx02.redhat.com (mx3-rdu2.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-554-wpdGAW4cMp-EtFoRFgXAVA-1; Mon, 21 Mar 2022 23:20:15 -0400 X-MC-Unique: wpdGAW4cMp-EtFoRFgXAVA-1 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.rdu2.redhat.com [10.11.54.2]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 2B20328EC108; Tue, 22 Mar 2022 03:20:15 +0000 (UTC) Received: from mpattric.remote.csb (unknown [10.22.17.21]) by smtp.corp.redhat.com (Postfix) with ESMTP id B9A3140C1241; Tue, 22 Mar 2022 03:20:14 +0000 (UTC) From: Mike Pattrick To: beilei.xing@intel.com, murphyx.yang@intel.com Cc: dev@dpdk.org, Mike Pattrick , stable@dpdk.org Subject: [PATCH] net/i40e: Populate error in flow_parse_fdir_pattern Date: Mon, 21 Mar 2022 23:19:37 -0400 Message-Id: <20220322031937.252037-1-mkp@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.11.54.2 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=mkp@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset="US-ASCII" X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Errors from i40e_flow_parse_fdir_pattern() can bubble up to rte_flow_create. If rte_flow_error is not initialized a caller may dereference error->message. This may be uninitialized memory, leading to a segemntation fault. Signed-off-by: Mike Pattrick Fixes: 4a072ad43442 ("net/i40e: fix flow director config after flow validate") Cc: stable@dpdk.org --- drivers/net/i40e/i40e_flow.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/drivers/net/i40e/i40e_flow.c b/drivers/net/i40e/i40e_flow.c index e0cf996200..4f3808cb5f 100644 --- a/drivers/net/i40e/i40e_flow.c +++ b/drivers/net/i40e/i40e_flow.c @@ -3142,8 +3142,11 @@ i40e_flow_parse_fdir_pattern(struct rte_eth_dev *dev, /* Check if the input set is valid */ if (i40e_validate_input_set(pctype, RTE_ETH_FILTER_FDIR, input_set) != 0) { - PMD_DRV_LOG(ERR, "Invalid input set"); - return -EINVAL; + rte_flow_error_set(error, EINVAL, + RTE_FLOW_ERROR_TYPE_ITEM, + item, + "Invalid input set"); + return -rte_errno; } filter->input.flow_ext.input_set = input_set; -- 2.27.0