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 7235FA04FF; Tue, 22 Mar 2022 09:35:50 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 4EE53427F0; Tue, 22 Mar 2022 09:35:50 +0100 (CET) Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by mails.dpdk.org (Postfix) with ESMTP id 7C444427EF for ; Tue, 22 Mar 2022 09:35:48 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1647938148; 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: in-reply-to:in-reply-to:references:references; bh=ItCxAZIKbLDZMY/PkQKCKTrWZAmSZLK2CQ2Xv87XhbI=; b=ADCT/J0As4uAvAiwnKy4/kk6vSIATx5wveaPpIP60rM60MXg380HtSiXC9tU0rdPckbjfQ HCMV2aYfHTmB6bu7JCL2al7rA+n/ijE3a6ZhZZqr8oW0lrSy7VwQiQAxlrgzWfvSYKBv4J pysFp5RP4Ex6aKwDL7pNy8cw/xdxRi8= Received: from mail-lj1-f197.google.com (mail-lj1-f197.google.com [209.85.208.197]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-141-yErgqqm7P--dTLx-V7LFgA-1; Tue, 22 Mar 2022 04:35:44 -0400 X-MC-Unique: yErgqqm7P--dTLx-V7LFgA-1 Received: by mail-lj1-f197.google.com with SMTP id a23-20020a05651c031700b00247fd91c2b5so7194236ljp.21 for ; Tue, 22 Mar 2022 01:35:44 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=ItCxAZIKbLDZMY/PkQKCKTrWZAmSZLK2CQ2Xv87XhbI=; b=jHoEqfElH1nI5ho71Se1PkZl24cSvoe6yaAvW0fVH1jAKB6fSXL8j8qs8PoNgXDB6A VDBSL54czbBwg0HTuoxrnIdYfltYp81Bp6Y4F/exrdS6QYlbfF6MRSVLfS8904XyIjfa OHm+4/19DebgzKz8US2dcENVf7I0CGfN2RXBBU4srBjQyNO0Zd/B2oPGqcmCXz5y7WHn ujHTbD/b0HsxDXi+s0cu2k3T98OLiQSt6AQdAzYuY1QlENLAZn07Ua6Eq4zwqr14hOCR H0n62ZxiAGDFUGmU7EAJnsfesc/rfUj7JZaqIdLSdfiBwFZoqngvZ/Si4WcTMWypx745 tUOQ== X-Gm-Message-State: AOAM530Kl1xU1jFlWXrySgZmajeHtz9Xay+wizc7vBziborNwfQ/nzgB e1hs9dAH9y0WyYQbqoisDyObtI6HCkHB+Y30LlXs9lYlDN7gUECx8nsxN7B8NhQpk0smNELDMvW VOW6ST5bYFLKsZxw1MU4= X-Received: by 2002:a05:6512:1506:b0:448:2f28:91ec with SMTP id bq6-20020a056512150600b004482f2891ecmr17254641lfb.217.1647938142959; Tue, 22 Mar 2022 01:35:42 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxeh7SXaM3uzj0hq982pcAVEETJGrI0amu72MY0Il1/+n8awqgExMKdvMkV6deM4FnAvz9XUDy0p4h1EJl8vQg= X-Received: by 2002:a05:6512:1506:b0:448:2f28:91ec with SMTP id bq6-20020a056512150600b004482f2891ecmr17254622lfb.217.1647938142678; Tue, 22 Mar 2022 01:35:42 -0700 (PDT) MIME-Version: 1.0 References: <20220322031937.252037-1-mkp@redhat.com> In-Reply-To: <20220322031937.252037-1-mkp@redhat.com> From: David Marchand Date: Tue, 22 Mar 2022 09:35:31 +0100 Message-ID: Subject: Re: [PATCH] net/i40e: Populate error in flow_parse_fdir_pattern To: Mike Pattrick Cc: Beilei Xing , murphyx.yang@intel.com, dev , dpdk stable Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=dmarchan@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset="UTF-8" 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 Hello Mike, On Tue, Mar 22, 2022 at 4:20 AM Mike Pattrick wrote: > > 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 Nit: the convention in DPDK is to have a block with the Fixes: and Cc: lines together first, then the rest of the tags in a second block. Fixes: 4a072ad43442 ("net/i40e: fix flow director config after flow validate") Cc: stable@dpdk.org Signed-off-by: Mike Pattrick > --- > 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 > Reviewed-by: David Marchand -- David Marchand