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 50E01A04FF for ; Tue, 22 Mar 2022 09:35:48 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 2B114410E5; Tue, 22 Mar 2022 09:35:48 +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 6BEC7410E5 for ; Tue, 22 Mar 2022 09:35:46 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1647938145; 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=D/4jOQIxpP9KZlg0+whCz7g8W+zM6WBv9/1JYIfPxqzdGScNZ7n7ZlANBrsmQJrSUxHH1E TsAkswHXr+ngconUKQyMHFRNs4NCDfEIRce8sZDH6cxiaUQnn03w2dhD3iDtMp1BnAONrR Qk/JpHtwZyopkK+4QcZu6Up31uvv25Q= Received: from mail-lf1-f69.google.com (mail-lf1-f69.google.com [209.85.167.69]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-141-IIE1_9eDMYOf9fzFkbNbuA-1; Tue, 22 Mar 2022 04:35:44 -0400 X-MC-Unique: IIE1_9eDMYOf9fzFkbNbuA-1 Received: by mail-lf1-f69.google.com with SMTP id z24-20020a056512371800b0043ea4caa07cso4457199lfr.17 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=Jt2A8uv0wSBuycBLIIdqJF9EV1h3Ipqmn1g7lXFmB0DsK0raIDrYtPdmAgg0N8FFkr mhbNESdigh5T6NSVN2Ol/5YF5uexvihLwRMIXPO6C5TULJD6v5Pg0JHcwzaKgIyEKSXd A3o0SFHlkNku2PvYlZ1n5uJcBQu0lOCOo5GwJ7Zl6eEJuic6GeWAG6Kpcl/AmGfODdvy VzumNuqL1HR1DvhJ/71p6j7XumcI2wpcFvx9N32icNkm/3CTBTqOwT1/qkhSoyPDtZ8N 7e+EGbToey2KlZCrs58lo5fYAAjLuzmXwtXH0lCyL/Kt9uzVNfgsItK0H0sVg0m4HIuR jECA== X-Gm-Message-State: AOAM533dEenSJs6Nz4xy0oIHVYs7sJ+a0/S2f9IiMxgQspMzuZIThGcS OAJwSwJssw6b3IJYbGvvItKTH36weNkexvkvluT98kNXbcNRUAoAs7qI4HUeDUnvP0AidugWAa7 HFjEfL76JH6Yxfd0R+97M4hs= X-Received: by 2002:a05:6512:1506:b0:448:2f28:91ec with SMTP id bq6-20020a056512150600b004482f2891ecmr17254638lfb.217.1647938142951; 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: stable@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: patches for DPDK stable branches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: stable-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