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 2D21DA00C4; Thu, 5 May 2022 10:40:37 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 0144940C35; Thu, 5 May 2022 10:40:37 +0200 (CEST) Received: from mail-il1-f181.google.com (mail-il1-f181.google.com [209.85.166.181]) by mails.dpdk.org (Postfix) with ESMTP id 8907F40042 for ; Thu, 5 May 2022 10:40:35 +0200 (CEST) Received: by mail-il1-f181.google.com with SMTP id b5so2428113ile.0 for ; Thu, 05 May 2022 01:40:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=hiKiroNTZkTQOS0EQzBg7lmErlpt6Zytu8/gE9RETAI=; b=RPtLUkuyjN3LT51JkyZEjk+1B8N4KgUlz1NfhODuGI9YDR4+iZco4l4ttWgs/WSRcC H7oOqEbC4uJd4aEn1+VQ+6mIPMFBDnOx/b+ZWOksgCSqkjhqt4bOwR3VuHmyfJGjb4Ul pPDNL0yPITiw4N/iMxs8PUyOAF3utiL5JXo/eXm4iqxBpWhnVBehR66PROA35OHeWa49 7zkS7MHzQIB/8WDHj1zbHZyYsPaqcEPX/O6391ggJyyBsoJ0DhzVHKNHGt2qMeEnysH7 riRrLmLsA7jpJj9UNrvkMcDyJahfNIKZSP0rug6VsTWKTymgxUh3pFb17yCP2LmNxpem pYOw== 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=hiKiroNTZkTQOS0EQzBg7lmErlpt6Zytu8/gE9RETAI=; b=ANUIeRPWcUEm7eFXLIAVqdu/M8LMCsbQjwpVVwxttpUZToYt6bP9IBBaNuY9PgUMc3 iHv7BsnCyHdrETHd28qih3+N3rtNGkHaAgHtqqnVlISzfWgzDS9JZCwOO8eELxfVB2AS VdDx6xwqSc1c22ZRVMKRLibo7/EMXOHbE5rOSyTCx8iCx2iPPnJVfDwCxcO+4OkOuZag ubeAf48yWuVlaP3tjIhEPB66GJC8JT5FkmLXUHn7QQ0rr8QyBEGJN5G0RQhfSP1vB8V6 hepk3FJ2RTOpdWPQ0XglxKgNd3V3cIbtGAKOMk6Atm4vmNekoVrSMq2BvtN0GBsFbStV TOPQ== X-Gm-Message-State: AOAM530EixPQrDQJKsnphv/RsPa8vqgYvz45gdBLz0RAM+L0P7UbkCGI 7Rq6n+O/8ltrHaffLUIhylw5O4VhWC53ULBpVz0FeMQ3U8pUyM7s X-Google-Smtp-Source: ABdhPJyAqslf2FR5eFL2uffBtFa/Ps/LK9HHAwbIh8IBmjGQ4EN9nqvbIEucPviVLU3dgSlbJzSfasBcjiuJNn0/XLI= X-Received: by 2002:a05:6e02:1584:b0:2b9:7a3d:8937 with SMTP id m4-20020a056e02158400b002b97a3d8937mr11048035ilu.192.1651740034907; Thu, 05 May 2022 01:40:34 -0700 (PDT) MIME-Version: 1.0 References: <20220424162326.1680962-1-gmuthukrishn@marvell.com> In-Reply-To: <20220424162326.1680962-1-gmuthukrishn@marvell.com> From: Jerin Jacob Date: Thu, 5 May 2022 14:10:08 +0530 Message-ID: Subject: Re: [PATCH] net/cnxk: fix out of bounds access in cmd array To: Gowrishankar Muthukrishnan , Thomas Monjalon Cc: dpdk-dev , Jerin Jacob , Nithin Dabilpuram , Kiran Kumar K , Sunil Kumar Kori , Satha Rao 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 On Sun, Apr 24, 2022 at 9:53 PM Gowrishankar Muthukrishnan wrote: > > Fix out of bounds access in cmd array which was reported in coverity > scan. > > Coverity issue: 375245, 375246, 375260, 375263, 375264, 375271, 375278, > 375279, 375273, 375274, 375275, 375276, 375280, 375281, > 375283, 375286 > Fixes: c5b97e98837 ("net/cnxk: add cn10k template Tx functions to build") > Fixes: dd8c20eee47 ("net/cnxk: add cn9k template Tx functions to build") > > Signed-off-by: Gowrishankar Muthukrishnan Acked-by: Jerin Jacob Applied to dpdk-next-net-mrvl/for-next-net. Thanks > --- > drivers/net/cnxk/cn10k_tx.h | 32 ++++++++++++++++---------------- > drivers/net/cnxk/cn9k_tx.h | 32 ++++++++++++++++---------------- > 2 files changed, 32 insertions(+), 32 deletions(-) > > diff --git a/drivers/net/cnxk/cn10k_tx.h b/drivers/net/cnxk/cn10k_tx.h > index 5d4003c5d4..85eba90334 100644 > --- a/drivers/net/cnxk/cn10k_tx.h > +++ b/drivers/net/cnxk/cn10k_tx.h > @@ -2728,18 +2728,18 @@ cn10k_nix_xmit_pkts_vector(void *tx_queue, uint64_t *ws, > > /* [T_SEC_F] [TSP] [TSO] [NOFF] [VLAN] [OL3OL4CSUM] [L3L4CSUM] */ > #define NIX_TX_FASTPATH_MODES_0_15 \ > - T(no_offload, 4, NIX_TX_OFFLOAD_NONE) \ > - T(l3l4csum, 4, L3L4CSUM_F) \ > - T(ol3ol4csum, 4, OL3OL4CSUM_F) \ > - T(ol3ol4csum_l3l4csum, 4, OL3OL4CSUM_F | L3L4CSUM_F) \ > + T(no_offload, 6, NIX_TX_OFFLOAD_NONE) \ > + T(l3l4csum, 6, L3L4CSUM_F) \ > + T(ol3ol4csum, 6, OL3OL4CSUM_F) \ > + T(ol3ol4csum_l3l4csum, 6, OL3OL4CSUM_F | L3L4CSUM_F) \ > T(vlan, 6, VLAN_F) \ > T(vlan_l3l4csum, 6, VLAN_F | L3L4CSUM_F) \ > T(vlan_ol3ol4csum, 6, VLAN_F | OL3OL4CSUM_F) \ > T(vlan_ol3ol4csum_l3l4csum, 6, VLAN_F | OL3OL4CSUM_F | L3L4CSUM_F) \ > - T(noff, 4, NOFF_F) \ > - T(noff_l3l4csum, 4, NOFF_F | L3L4CSUM_F) \ > - T(noff_ol3ol4csum, 4, NOFF_F | OL3OL4CSUM_F) \ > - T(noff_ol3ol4csum_l3l4csum, 4, NOFF_F | OL3OL4CSUM_F | L3L4CSUM_F) \ > + T(noff, 6, NOFF_F) \ > + T(noff_l3l4csum, 6, NOFF_F | L3L4CSUM_F) \ > + T(noff_ol3ol4csum, 6, NOFF_F | OL3OL4CSUM_F) \ > + T(noff_ol3ol4csum_l3l4csum, 6, NOFF_F | OL3OL4CSUM_F | L3L4CSUM_F) \ > T(noff_vlan, 6, NOFF_F | VLAN_F) \ > T(noff_vlan_l3l4csum, 6, NOFF_F | VLAN_F | L3L4CSUM_F) \ > T(noff_vlan_ol3ol4csum, 6, NOFF_F | VLAN_F | OL3OL4CSUM_F) \ > @@ -2813,19 +2813,19 @@ cn10k_nix_xmit_pkts_vector(void *tx_queue, uint64_t *ws, > TSP_F | TSO_F | NOFF_F | VLAN_F | OL3OL4CSUM_F | L3L4CSUM_F) > > #define NIX_TX_FASTPATH_MODES_64_79 \ > - T(sec, 4, T_SEC_F) \ > - T(sec_l3l4csum, 4, T_SEC_F | L3L4CSUM_F) \ > - T(sec_ol3ol4csum, 4, T_SEC_F | OL3OL4CSUM_F) \ > - T(sec_ol3ol4csum_l3l4csum, 4, T_SEC_F | OL3OL4CSUM_F | L3L4CSUM_F) \ > + T(sec, 6, T_SEC_F) \ > + T(sec_l3l4csum, 6, T_SEC_F | L3L4CSUM_F) \ > + T(sec_ol3ol4csum, 6, T_SEC_F | OL3OL4CSUM_F) \ > + T(sec_ol3ol4csum_l3l4csum, 6, T_SEC_F | OL3OL4CSUM_F | L3L4CSUM_F) \ > T(sec_vlan, 6, T_SEC_F | VLAN_F) \ > T(sec_vlan_l3l4csum, 6, T_SEC_F | VLAN_F | L3L4CSUM_F) \ > T(sec_vlan_ol3ol4csum, 6, T_SEC_F | VLAN_F | OL3OL4CSUM_F) \ > T(sec_vlan_ol3ol4csum_l3l4csum, 6, \ > T_SEC_F | VLAN_F | OL3OL4CSUM_F | L3L4CSUM_F) \ > - T(sec_noff, 4, T_SEC_F | NOFF_F) \ > - T(sec_noff_l3l4csum, 4, T_SEC_F | NOFF_F | L3L4CSUM_F) \ > - T(sec_noff_ol3ol4csum, 4, T_SEC_F | NOFF_F | OL3OL4CSUM_F) \ > - T(sec_noff_ol3ol4csum_l3l4csum, 4, \ > + T(sec_noff, 6, T_SEC_F | NOFF_F) \ > + T(sec_noff_l3l4csum, 6, T_SEC_F | NOFF_F | L3L4CSUM_F) \ > + T(sec_noff_ol3ol4csum, 6, T_SEC_F | NOFF_F | OL3OL4CSUM_F) \ > + T(sec_noff_ol3ol4csum_l3l4csum, 6, \ > T_SEC_F | NOFF_F | OL3OL4CSUM_F | L3L4CSUM_F) \ > T(sec_noff_vlan, 6, T_SEC_F | NOFF_F | VLAN_F) \ > T(sec_noff_vlan_l3l4csum, 6, T_SEC_F | NOFF_F | VLAN_F | L3L4CSUM_F) \ > diff --git a/drivers/net/cnxk/cn9k_tx.h b/drivers/net/cnxk/cn9k_tx.h > index a0611a67c9..6ce81f5c96 100644 > --- a/drivers/net/cnxk/cn9k_tx.h > +++ b/drivers/net/cnxk/cn9k_tx.h > @@ -1903,18 +1903,18 @@ cn9k_nix_xmit_pkts_vector(void *tx_queue, struct rte_mbuf **tx_pkts, > > /* [T_SEC_F] [TSP] [TSO] [NOFF] [VLAN] [OL3OL4CSUM] [L3L4CSUM] */ > #define NIX_TX_FASTPATH_MODES_0_15 \ > - T(no_offload, 4, NIX_TX_OFFLOAD_NONE) \ > - T(l3l4csum, 4, L3L4CSUM_F) \ > - T(ol3ol4csum, 4, OL3OL4CSUM_F) \ > - T(ol3ol4csum_l3l4csum, 4, OL3OL4CSUM_F | L3L4CSUM_F) \ > + T(no_offload, 6, NIX_TX_OFFLOAD_NONE) \ > + T(l3l4csum, 6, L3L4CSUM_F) \ > + T(ol3ol4csum, 6, OL3OL4CSUM_F) \ > + T(ol3ol4csum_l3l4csum, 6, OL3OL4CSUM_F | L3L4CSUM_F) \ > T(vlan, 6, VLAN_F) \ > T(vlan_l3l4csum, 6, VLAN_F | L3L4CSUM_F) \ > T(vlan_ol3ol4csum, 6, VLAN_F | OL3OL4CSUM_F) \ > T(vlan_ol3ol4csum_l3l4csum, 6, VLAN_F | OL3OL4CSUM_F | L3L4CSUM_F) \ > - T(noff, 4, NOFF_F) \ > - T(noff_l3l4csum, 4, NOFF_F | L3L4CSUM_F) \ > - T(noff_ol3ol4csum, 4, NOFF_F | OL3OL4CSUM_F) \ > - T(noff_ol3ol4csum_l3l4csum, 4, NOFF_F | OL3OL4CSUM_F | L3L4CSUM_F) \ > + T(noff, 6, NOFF_F) \ > + T(noff_l3l4csum, 6, NOFF_F | L3L4CSUM_F) \ > + T(noff_ol3ol4csum, 6, NOFF_F | OL3OL4CSUM_F) \ > + T(noff_ol3ol4csum_l3l4csum, 6, NOFF_F | OL3OL4CSUM_F | L3L4CSUM_F) \ > T(noff_vlan, 6, NOFF_F | VLAN_F) \ > T(noff_vlan_l3l4csum, 6, NOFF_F | VLAN_F | L3L4CSUM_F) \ > T(noff_vlan_ol3ol4csum, 6, NOFF_F | VLAN_F | OL3OL4CSUM_F) \ > @@ -1988,19 +1988,19 @@ cn9k_nix_xmit_pkts_vector(void *tx_queue, struct rte_mbuf **tx_pkts, > TSP_F | TSO_F | NOFF_F | VLAN_F | OL3OL4CSUM_F | L3L4CSUM_F) > > #define NIX_TX_FASTPATH_MODES_64_79 \ > - T(sec, 4, T_SEC_F) \ > - T(sec_l3l4csum, 4, T_SEC_F | L3L4CSUM_F) \ > - T(sec_ol3ol4csum, 4, T_SEC_F | OL3OL4CSUM_F) \ > - T(sec_ol3ol4csum_l3l4csum, 4, T_SEC_F | OL3OL4CSUM_F | L3L4CSUM_F) \ > + T(sec, 6, T_SEC_F) \ > + T(sec_l3l4csum, 6, T_SEC_F | L3L4CSUM_F) \ > + T(sec_ol3ol4csum, 6, T_SEC_F | OL3OL4CSUM_F) \ > + T(sec_ol3ol4csum_l3l4csum, 6, T_SEC_F | OL3OL4CSUM_F | L3L4CSUM_F) \ > T(sec_vlan, 6, T_SEC_F | VLAN_F) \ > T(sec_vlan_l3l4csum, 6, T_SEC_F | VLAN_F | L3L4CSUM_F) \ > T(sec_vlan_ol3ol4csum, 6, T_SEC_F | VLAN_F | OL3OL4CSUM_F) \ > T(sec_vlan_ol3ol4csum_l3l4csum, 6, \ > T_SEC_F | VLAN_F | OL3OL4CSUM_F | L3L4CSUM_F) \ > - T(sec_noff, 4, T_SEC_F | NOFF_F) \ > - T(sec_noff_l3l4csum, 4, T_SEC_F | NOFF_F | L3L4CSUM_F) \ > - T(sec_noff_ol3ol4csum, 4, T_SEC_F | NOFF_F | OL3OL4CSUM_F) \ > - T(sec_noff_ol3ol4csum_l3l4csum, 4, \ > + T(sec_noff, 6, T_SEC_F | NOFF_F) \ > + T(sec_noff_l3l4csum, 6, T_SEC_F | NOFF_F | L3L4CSUM_F) \ > + T(sec_noff_ol3ol4csum, 6, T_SEC_F | NOFF_F | OL3OL4CSUM_F) \ > + T(sec_noff_ol3ol4csum_l3l4csum, 6, \ > T_SEC_F | NOFF_F | OL3OL4CSUM_F | L3L4CSUM_F) \ > T(sec_noff_vlan, 6, T_SEC_F | NOFF_F | VLAN_F) \ > T(sec_noff_vlan_l3l4csum, 6, T_SEC_F | NOFF_F | VLAN_F | L3L4CSUM_F) \ > -- > 2.25.1 >