From mboxrd@z Thu Jan  1 00:00:00 1970
Return-Path: <alejandro.lucero@netronome.com>
Received: from mail-ua0-f178.google.com (mail-ua0-f178.google.com
 [209.85.217.178]) by dpdk.org (Postfix) with ESMTP id 1AE322952
 for <dev@dpdk.org>; Fri, 12 May 2017 08:29:54 +0200 (CEST)
Received: by mail-ua0-f178.google.com with SMTP id g49so41511211uaa.1
 for <dev@dpdk.org>; Thu, 11 May 2017 23:29:53 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=netronome-com.20150623.gappssmtp.com; s=20150623;
 h=mime-version:in-reply-to:references:from:date:message-id:subject:to
 :cc; bh=rg8exBl5Ze40RFxABMhUrVDTuD1PN6uH9W4XyAwlC6Q=;
 b=UONFv6KViq+PzHPvWdWzn6eGwx8uEPyGTAe0imlYTx3Cnhd6UHJvKGR9OV7AOEyLUg
 DKwDQ2IDXR+TAknIEivZErHxVLy3i3kzGJiONaxqVsY1sw1hhivxpdC5cg6fDoniyxPk
 6toKVq8LofWrZo11Kkzv2eOZHZdrH/tLSZE4COxlJQivmXwcZieUWJyJNaLv5Wfi8m6t
 160zYlHl00L8sOd2+nAaS7UAa5l6a7giG1XrnFtkFjSrBnc2mhWtf7XAcVnL/Js70kPA
 PHkrevGf6Z3prXe8OtwOL17tujuY9oWQWRZg7q5ZRhBvM0tUSmHIRaXgU6Wr7dMYTZ/m
 g2iA==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20161025;
 h=x-gm-message-state:mime-version:in-reply-to:references:from:date
 :message-id:subject:to:cc;
 bh=rg8exBl5Ze40RFxABMhUrVDTuD1PN6uH9W4XyAwlC6Q=;
 b=OD8WeEm6Jw4nKiNAYf02zFWdDdwUfCU2GR0pl3dbWXMojPKw0jj7ByqbY8YyMmRx8K
 9h6k5s2zq5xHPNTe7Ae+qfv5jFBkrT7dEx6AKfP9dOckoPepyJFNCMcG7IZ8lzAXOf8Q
 eAB7CULtpGU2epAB5dQDXYa6UbrDhZEl/Sq0Uuf/bhLcWu4oQz7y2k2Sb9CUqDWVPayZ
 7eBveKHoO2mFfFC3sl3KtV4inuvjkaQf2PcAhQk2PdvbDJ5Uz4Se6PY11+N2TrSPak2B
 zy1uco3+GqgShQ7rN7lqE/08bfjmalLg9Tm3nvb82U2+kNDe2gu476oxEQcnLidFuqj8
 1Wkg==
X-Gm-Message-State: AODbwcD8vn8dbxofEN7Huk2PxonO5rntZvE5FlLcEXebaW6uSR3nKooz
 QiX4ZPhs2Rk2aiHI1PMhoDG5kTLOcJkw
X-Received: by 10.176.16.16 with SMTP id f16mr1223720uab.132.1494570593369;
 Thu, 11 May 2017 23:29:53 -0700 (PDT)
MIME-Version: 1.0
Received: by 10.103.14.69 with HTTP; Thu, 11 May 2017 23:29:52 -0700 (PDT)
In-Reply-To: <20170511093839.7c16ebd0@xeon-e3>
References: <20170511093839.7c16ebd0@xeon-e3>
From: Alejandro Lucero <alejandro.lucero@netronome.com>
Date: Fri, 12 May 2017 07:29:52 +0100
Message-ID: <CAD+H991qhqEnWrUB+Unxh9SW7SnLryL0WjxMcYt+6MC2t4p6yw@mail.gmail.com>
To: Stephen Hemminger <stephen@networkplumber.org>
Cc: dev <dev@dpdk.org>
Content-Type: text/plain; charset="UTF-8"
X-Content-Filtered-By: Mailman/MimeDel 2.1.15
Subject: Re: [dpdk-dev] New Coverity defects in VFIO
X-BeenThere: dev@dpdk.org
X-Mailman-Version: 2.1.15
Precedence: list
List-Id: DPDK patches and discussions <dev.dpdk.org>
List-Unsubscribe: <http://dpdk.org/ml/options/dev>,
 <mailto:dev-request@dpdk.org?subject=unsubscribe>
List-Archive: <http://dpdk.org/ml/archives/dev/>
List-Post: <mailto:dev@dpdk.org>
List-Help: <mailto:dev-request@dpdk.org?subject=help>
List-Subscribe: <http://dpdk.org/ml/listinfo/dev>,
 <mailto:dev-request@dpdk.org?subject=subscribe>
X-List-Received-Date: Fri, 12 May 2017 06:29:54 -0000

On Thu, May 11, 2017 at 5:38 PM, Stephen Hemminger <
stephen@networkplumber.org> wrote:

> Looks like obvious C array bounds issues...
>
>
Right.

I will send a patch today.

Thanks


> Begin forwarded message:
>
> Date: Thu, 11 May 2017 06:32:38 -0700
> From: scan-admin@coverity.com
> To: stephen@networkplumber.org
> Subject: New Defects reported by Coverity Scan for DPDK Data Plane
> Development Kit
>
>
> Hi,
>
> Please find the latest report on new defect(s) introduced to DPDK Data
> Plane Development Kit found with Coverity Scan.
>
> 4 new defect(s) introduced to DPDK Data Plane Development Kit found with
> Coverity Scan.
> 4 defect(s), reported by Coverity Scan earlier, were marked fixed in the
> recent build analyzed by Coverity Scan.
>
> New defect(s) Reported-by: Coverity Scan
> Showing 4 of 4 defect(s)
>
>
> ** CID 144558:  Parse warnings  (PARSE_ERROR)
> /tmp/auto-config-h.sh.116891.c: 3 in ()
>
>
> ____________________________________________________________
> ____________________________________________
> *** CID 144558:  Parse warnings  (PARSE_ERROR)
> /tmp/auto-config-h.sh.116891.c: 3 in ()
> 1     #include <linux/pkt_cls.h>
> 2
> >>>     CID 144558:  Parse warnings  (PARSE_ERROR)
> >>>     identifier "TCA_FLOWER_KEY_VLAN_PRIO" is undefined
>
> ** CID 144557:  Memory - corruptions  (OVERRUN)
> /lib/librte_eal/linuxapp/eal/eal_vfio.c: 207 in vfio_group_device_put()
>
>
> ____________________________________________________________
> ____________________________________________
> *** CID 144557:  Memory - corruptions  (OVERRUN)
> /lib/librte_eal/linuxapp/eal/eal_vfio.c: 207 in vfio_group_device_put()
> 201             int i;
> 202
> 203             i = get_vfio_group_idx(vfio_group_fd);
> 204             if (i < 0 || i > VFIO_MAX_GROUPS)
> 205                     RTE_LOG(ERR, EAL, "  wrong vfio_group index
> (%d)\n", i);
> 206             else
> >>>     CID 144557:  Memory - corruptions  (OVERRUN)
> >>>     Overrunning array "vfio_cfg.vfio_groups" of 64 12-byte elements at
> element index 64 (byte offset 768) using index "i" (which evaluates to 64).
> 207                     vfio_cfg.vfio_groups[i].devices--;
> 208     }
> 209
> 210     static int
> 211     vfio_group_device_count(int vfio_group_fd)
> 212     {
>
> ** CID 144556:  Memory - illegal accesses  (OVERRUN)
> /lib/librte_eal/linuxapp/eal/eal_vfio.c: 221 in vfio_group_device_count()
>
>
> ____________________________________________________________
> ____________________________________________
> *** CID 144556:  Memory - illegal accesses  (OVERRUN)
> /lib/librte_eal/linuxapp/eal/eal_vfio.c: 221 in vfio_group_device_count()
> 215             i = get_vfio_group_idx(vfio_group_fd);
> 216             if (i < 0 || i > VFIO_MAX_GROUPS) {
> 217                     RTE_LOG(ERR, EAL, "  wrong vfio_group index
> (%d)\n", i);
> 218                     return -1;
> 219             }
> 220
> >>>     CID 144556:  Memory - illegal accesses  (OVERRUN)
> >>>     Overrunning array "vfio_cfg.vfio_groups" of 64 12-byte elements at
> element index 64 (byte offset 768) using index "i" (which evaluates to 64).
> 221             return vfio_cfg.vfio_groups[i].devices;
> 222     }
> 223
> 224     int
> 225     clear_group(int vfio_group_fd)
> 226     {
>
> ** CID 144555:  Memory - corruptions  (OVERRUN)
> /lib/librte_eal/linuxapp/eal/eal_vfio.c: 195 in vfio_group_device_get()
>
>
> ____________________________________________________________
> ____________________________________________
> *** CID 144555:  Memory - corruptions  (OVERRUN)
> /lib/librte_eal/linuxapp/eal/eal_vfio.c: 195 in vfio_group_device_get()
> 189             int i;
> 190
> 191             i = get_vfio_group_idx(vfio_group_fd);
> 192             if (i < 0 || i > VFIO_MAX_GROUPS)
> 193                     RTE_LOG(ERR, EAL, "  wrong vfio_group index
> (%d)\n", i);
> 194             else
> >>>     CID 144555:  Memory - corruptions  (OVERRUN)
> >>>     Overrunning array "vfio_cfg.vfio_groups" of 64 12-byte elements at
> element index 64 (byte offset 768) using index "i" (which evaluates to 64).
> 195                     vfio_cfg.vfio_groups[i].devices++;
> 196     }
> 197
> 198     static void
> 199     vfio_group_device_put(int vfio_group_fd)
> 200     {
>
>
> ____________________________________________________________
> ____________________________________________
> To view the defects in Coverity Scan visit, https://u2389337.ct.sendgrid.
> net/wf/click?upn=08onrYu34A-2BWcWUl-2F-2BfV0V05UPxvVjWch-
> 2Bd2MGckcRatAu7kfwx-2FEYQLnaewVIzHeicA-2BXVfT6hZ5-
> 2BlQUbOEuO498PDBpm2du3zbqLAIkSYNH-2F4pgPd0yf8CgX5U0jRj_5xu02FVv-
> 2BCbxTLHpBsC0RXI5u3ZIuvswXolnGx3HI6n1gq9Xsuj8K50wQIlWov7yyQR
> BN8re6yFBwOsnahFZyjQW3aqTA5h9rz-2BI7CfexKV5NFlSm1lW-2Fiif3a6-2Fu7-
> 2Fs613T3n94FacSVILpwmgH4KcYzHtMPdTwJy1kCK02zCViEtNsq-
> 2FCKPHCFx1r4p5UV6Psx61JLzOXw56M2GSEUOPo8sP2PR2MWjeCdy5rfIyU-3D
>
> To manage Coverity Scan email notifications for "
> stephen@networkplumber.org", click https://u2389337.ct.sendgrid.
> net/wf/click?upn=08onrYu34A-2BWcWUl-2F-2BfV0V05UPxvVjWch-
> 2Bd2MGckcRbVDbis712qZDP-2FA8y06Nq4sKfrkUL5oDv8dgJj5BU3
> IfRYzaFCVGnOstQOuK3KKCEYrqlxJ2-2FPVogkBzkcq1Dg-2FyXbbLWT-2BUFivnCf-
> 2Ffy5pynld3GGM7zvzbDuODpBlYA-3D_5xu02FVv-2BCbxTLHpBsC0RXI5u3ZIuvswXolnG
> x3HI6n1gq9Xsuj8K50wQIlWov7yyQRBN8re6yFBwOsnahFZygYSNuU7rrSKQ
> tPVcIi21MDpz6KZwG8nS4KmgXtet9991WL1lHRPs9GRo4zwJ-2Bnb-2FTnQYqob6zFOkhFpJ-
> 2FjhXOQt2JMEhg-2FflJvekTxexy1BKKt-2FaadTS9JcUmvbkxxm73IxfO8iGv39
> u0aDGpPB0r8-3D
>
>