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 4D83545EF0; Thu, 19 Dec 2024 23:38:51 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id DCBD140265; Thu, 19 Dec 2024 23:38:50 +0100 (CET) Received: from mail-pf1-f180.google.com (mail-pf1-f180.google.com [209.85.210.180]) by mails.dpdk.org (Postfix) with ESMTP id F21264025F for ; Thu, 19 Dec 2024 23:38:48 +0100 (CET) Received: by mail-pf1-f180.google.com with SMTP id d2e1a72fcca58-725ef0397aeso1095095b3a.2 for ; Thu, 19 Dec 2024 14:38:48 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=networkplumber-org.20230601.gappssmtp.com; s=20230601; t=1734647928; x=1735252728; darn=dpdk.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:subject:cc:to:from:date:from:to:cc:subject:date :message-id:reply-to; bh=4m0etvthXg8Woh8zQYcUD6a0t1IFe2kOFUlh+aqnP6M=; b=k8ANsgO3C+D9tmGNNwOZ3rAimv9WH59JZ2k1b5oHPfVwTzs8AV5I3iRgtLrdkqzf7J gygf5cIfiNgrtMUWWsJiYyZjwwKdxyYp5clXpnLkxE57XfVOx0NzRhRGdes3wN1JG+UP LqbrscvX8RInZAbbyV6QeIMWbaOdz+XK8PvZWx9fCcyY+4CBDssZEu8Bio3u2lw2HrTm 0s4/oCeRV1eASPtQ3PkBt+zTpMwMTzap+4sIwgUUapIsylYLKua5UV9eOmDlgQ/4Ff2Y fGtWdhx+73HZxnDvcSzgzJ/bx18r2+J4ZO5ax6+vdDKPymJEubN27+kVsdeYBwfa2dZp fjVA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1734647928; x=1735252728; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:subject:cc:to:from:date:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=4m0etvthXg8Woh8zQYcUD6a0t1IFe2kOFUlh+aqnP6M=; b=j2dGyqdGQ3gQ4hPkbEdlbiDLnFcURk0xiDr0ffzdPfL7QMgelsekPOLmjGt1noJ/JF WBu7CPEBuZ6PWqggLm98IXZDfHuPiFVuVQn2xaVeks38BqjaYnWuLXIsMUVozHVRcwOI ebw98eE79jV9FAJGz8aXcuOojPdbdB6nfLQzbvOMetLp94ncRxwQML2IxjTehcEuqVcc vQGs0wdGmflOW4VuAD6/Ob3p3M268TsUgqeX9qBAndDf+jOOVHHONT+RRemHEDLhl1+y B07GMdPdsupXVV/HnyONto+2UjzxLesH5tY2At2zIoXw5tmd7KVibGBxSHaebns1gOP4 eWGg== X-Forwarded-Encrypted: i=1; AJvYcCWAoQjPv4DtQ5MA5xrRvEWhF1MhMsXW0wm6VD+LA3txh05Xmokdz/9oBjZ4LsGuB6TGytY=@dpdk.org X-Gm-Message-State: AOJu0YxhqJKmHE/jp7VQHMaz/AjjmfYlGwopyGACSZn6LY25GUcN5Vwh pQHDapkMSjzz5b16fLFtxl5cdtv/fKNUl8EEAqHgkKD/463TZNPRAbji0Bkc/OU= X-Gm-Gg: ASbGncthIxBSJmcMTrTo2wl7ZzGnnN9TZSZrHytHTZNt5GF/dvT++8TavXN31LGdaxa MTTdhgSO7PNYYBfI3txVOfg2SsvG0m9oqrWr4SrM8rxp7M80KaBn3AaFb/4YYJnfB9QLwPc4qNC TRa6BG0YSFVWUxQ1H4IPOoAymHFO3F89fuOnqBVNdOD7GXyAC+A7OHKOhrfVjeuM/30GGQq15Wq i8HoBnPXXfELS4X/Qen144tWTFoboVDBg+Wim9k9lrWk4Z47Qxpx+98paekOrj+aWJZ0QVvjjN/ AcOxzlK42Api/P2HNEvMXicAmTVFHYmz5g== X-Google-Smtp-Source: AGHT+IEKoTTQiUd5E4vTC1CPONIlcAi5DhKVxgEjI+ojoi0qicKxpxqJALrJsjQIC0O5QsoZpVz7ew== X-Received: by 2002:a05:6a21:3a44:b0:1e0:ca95:3cb3 with SMTP id adf61e73a8af0-1e5e083e416mr1266527637.37.1734647927789; Thu, 19 Dec 2024 14:38:47 -0800 (PST) Received: from hermes.local (204-195-96-226.wavecable.com. [204.195.96.226]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-72aad8dba6asm1828817b3a.130.2024.12.19.14.38.47 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 19 Dec 2024 14:38:47 -0800 (PST) Date: Thu, 19 Dec 2024 14:38:45 -0800 From: Stephen Hemminger To: Junlong Wang Cc: ferruh.yigit@amd.com, dev@dpdk.org, wang.yong19@zte.com.cn Subject: Re: [PATCH v4] net/zxdh: Provided zxdh basic init Message-ID: <20241219143845.3a93755f@hermes.local> In-Reply-To: <20240910120020.4031035-1-wang.junlong1@zte.com.cn> References: <20240910120020.4031035-1-wang.junlong1@zte.com.cn> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable 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 Tue, 10 Sep 2024 20:00:20 +0800 Junlong Wang wrote: > provided zxdh initialization of zxdh PMD driver. > include msg channel, np init and etc. >=20 > Signed-off-by: Junlong Wang > --- > V4: Resolve compilation issues > V3: Resolve compilation issues > V2: Resolve compilation issues and modify doc(zxdh.ini zdh.rst) > V1: Provide zxdh basic init and open source NPSDK lib > --- Overall this looks good, one test checklist item for me was to build with Gcc 14 and analyzer option. This finds bugs but can generate false positives. The output is quite verbose. It complains about this which may or may not be a real problem. If memcpy() is used instead of rte_memcpy() then the problem goes away. The issue is that inlined version rte_memcpy() will reference past the argu= ments as an internal optimization for small values. [1564/3222] Compiling C object drivers/libtmp_rte_net_zxdh.a.p/net_zxdh_zxd= h_common.c.o In file included from ../lib/mempool/rte_mempool.h:50, from ../lib/mbuf/rte_mbuf.h:38, from ../lib/net/rte_ether.h:20, from ../lib/ethdev/rte_eth_ctrl.h:10, from ../lib/ethdev/rte_ethdev.h:1472, from ../lib/ethdev/ethdev_driver.h:21, from ../drivers/net/zxdh/zxdh_common.c:8: In function =E2=80=98rte_mov15_or_less=E2=80=99, inlined from =E2=80=98rte_memcpy_generic=E2=80=99 at ../lib/eal/x86/inc= lude/rte_memcpy.h:395:10, inlined from =E2=80=98rte_memcpy=E2=80=99 at ../lib/eal/x86/include/rte= _memcpy.h:757:10, inlined from =E2=80=98zxdh_get_res_info=E2=80=99 at ../drivers/net/zxdh= /zxdh_common.c:231:2: ../lib/eal/x86/include/rte_memcpy.h:82:55: warning: stack-based buffer over= flow [CWE-121] [-Wanalyzer-out-of-bounds] 82 | ((struct rte_uint64_alias *)dst)->val =3D | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^ 83 | ((const struct rte_uint64_alias *)src)->val; | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ =E2=80=98zxdh_panelid_get=E2=80=99: events 1-3 | |../drivers/net/zxdh/zxdh_common.c:250:1: | 239 | uint8_t reps =3D 0; | | ~~~~ | | | | | (2) capacity: 1 byte |...... | 250 | zxdh_panelid_get(struct rte_eth_dev *dev, uint8_t *panelid) | | ^~~~~~~~~~~~~~~~ | | | | | (1) entry to =E2=80=98zxdh_panelid_get=E2=80=99 |...... | 255 | int32_t ret =3D zxdh_get_res_panel_id(¶m, panelid); | | ~ | | | | | (3) inlined call to =E2=80=98zxdh_get_re= s_panel_id=E2=80=99 from =E2=80=98zxdh_panelid_get=E2=80=99 | +--> =E2=80=98zxdh_get_res_panel_id=E2=80=99: event 4 | | 242 | if (zxdh_get_res_info(in, ZXDH_TBL_FIELD_PNLID,= &reps, &reps_len) !=3D ZXDH_BAR_MSG_OK) | | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~= ~~~~~~~~~~~~~~~~~~ | | | | | (4) calling =E2=80=98zxdh_get_res_info=E2= =80=99 from =E2=80=98zxdh_panelid_get=E2=80=99 | =E2=80=98zxdh_get_res_info=E2=80=99: events 5-12 | | 186 | zxdh_get_res_info(struct zxdh_res_para *dev, uint8_t fi= eld, uint8_t *res, uint16_t *len) | | ^~~~~~~~~~~~~~~~~ | | | | | (5) entry to =E2=80=98zxdh_get_res_info=E2=80=99 |...... | 192 | if (!res || !dev) | | ~ | | | | | (6) following =E2=80=98false=E2=80=99 branch= ... |...... | 195 | struct zxdh_tbl_msg_header tbl_msg =3D { | | ~~~~~~~ | | | | | (7) ...to here |...... | 217 | if (ret !=3D ZXDH_BAR_MSG_OK) { | | ~ | | | | | (8) following =E2=80=98false=E2=80=99 branch= (when =E2=80=98ret =3D=3D 0=E2=80=99)... |...... | 225 | if (tbl_reps->check !=3D ZXDH_TBL_MSG_PRO_SUCCE= SS) { | | ~~~~~~~~~~~~~~~~ | | | | | | | (9) ...to here | | (10) following =E2=80=98false=E2=80=99 branc= h... |...... | 230 | *len =3D tbl_reps->len; | | ~~~~~~~~~~~~~ | | | | | (11) ...to here | 231 | rte_memcpy(res, (recv_buf + ZXDH_REPS_HEADER_OF= FSET + | | ~ | | | | | (12) inlined call to =E2=80=98rte_memcpy=E2=80= =99 from =E2=80=98zxdh_get_res_info=E2=80=99 | +--> =E2=80=98rte_memcpy=E2=80=99: events 13-14 | |../lib/eal/x86/include/rte_memcpy.h:754:12: | 754 | if (!(((uintptr_t)dst | (uintptr_t)src) = & ALIGNMENT_MASK)) | | ^ | | | | | (13) following =E2=80=98false=E2=80= =99 branch... |...... | 757 | return rte_memcpy_generic(dst, s= rc, n); | | ~ | | | | | (14) inlined call to =E2= =80=98rte_memcpy_generic=E2=80=99 from =E2=80=98rte_memcpy=E2=80=99 | +--> =E2=80=98rte_memcpy_generic=E2=80=99: events 15-17 | | 394 | if (n < 16) { | | ^ | | | | | (15) ...to here | | (16) following =E2=80=98true= =E2=80=99 branch... | 395 | return rte_mov15_or_less(= dst, src, n); | | ~ | | | | | (17) inlined call = to =E2=80=98rte_mov15_or_less=E2=80=99 from =E2=80=98rte_memcpy_generic=E2= =80=99 | +--> =E2=80=98rte_mov15_or_less=E2=80=99: events 1= 8-21 | | 81 | if (n & 8) { | | ^ | | | | | (18) ...to here | | (19) following =E2=80= =98true=E2=80=99 branch... | 82 | ((struct rte_uint6= 4_alias *)dst)->val =3D | | ~~~~~~~~~~~~~~~~~~= ~~~~~~~~~~~~~~~~~~~~~ | | = | | | = (21) out-of-bounds write from byte 1 till byte 7 but = =E2=80=98reps=E2=80=99 ends at byte 1 | 83 | ((const st= ruct rte_uint64_alias *)src)->val; | | ~~~~~~~~~~= ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | | = | | | = (20) ...to here | ../lib/eal/x86/include/rte_memcpy.h:82:55: note: write of 7 bytes to beyond= the end of =E2=80=98reps=E2=80=99 82 | ((struct rte_uint64_alias *)dst)->val =3D | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^ 83 | ((const struct rte_uint64_alias *)src)->val; | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ =E2=94=8C=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80= =E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2= =94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94= =80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80= =E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2= =94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94= =80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80= =E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2= =94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=90 =E2=94=82 write of =E2=80=98uint64_t=E2=80=99 (8 bytes= ) =E2=94=82 =E2=94=94=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80= =E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2= =94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94= =80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80= =E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2= =94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94= =80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80= =E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2= =94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=98 =E2=94=82 =E2=94=82 =E2=94=82 =E2=94=82 v v =E2=94=8C=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80= =E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2= =94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94= =80=E2=94=90=E2=94=8C=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80= =E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2= =94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94= =80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80= =E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2= =94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=90 =E2=94=82=E2=80=98reps=E2=80=99 (type: =E2=80=98uint8_t=E2=80=99)=E2=94= =82=E2=94=82 after valid range =E2=94=82 =E2=94=94=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80= =E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2= =94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94= =80=E2=94=98=E2=94=94=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80= =E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2= =94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94= =80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80= =E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2= =94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=98 =E2=94=9C=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80= =E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=AC=E2=94=80=E2=94=80=E2=94=80=E2= =94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94= =80=E2=94=A4=E2=94=9C=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80= =E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2= =94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=AC=E2=94= =80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80= =E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2= =94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=A4 =E2=94=82 =E2=94=82 =E2=95=AD=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94= =80=E2=94=80=E2=94=B4=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80= =E2=94=80=E2=95=AE =E2=95=AD=E2=94=80=E2=94=80=E2=94=80=E2=94= =80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=B4= =E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2= =94=80=E2=94=80=E2=95=AE =E2=94=82capacity: 1 byte=E2=94=82 =E2=94=82=E2=9A=A0=EF= =B8=8F overflow of 7 bytes=E2=94=82 =E2=95=B0=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94= =80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80= =E2=94=80=E2=95=AF =E2=95=B0=E2=94=80=E2=94=80=E2=94=80=E2=94= =80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80= =E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2= =94=80=E2=94=80=E2=95=AF In function =E2=80=98rte_mov15_or_less=E2=80=99, inlined from =E2=80=98rte_memcpy_aligned=E2=80=99 at ../lib/eal/x86/inc= lude/rte_memcpy.h:706:10, inlined from =E2=80=98rte_memcpy=E2=80=99 at ../lib/eal/x86/include/rte= _memcpy.h:755:10, inlined from =E2=80=98zxdh_get_res_info=E2=80=99 at ../drivers/net/zxdh= /zxdh_common.c:231:2: ../lib/eal/x86/include/rte_memcpy.h:82:55: warning: stack-based buffer over= flow [CWE-121] [-Wanalyzer-out-of-bounds] 82 | ((struct rte_uint64_alias *)dst)->val =3D | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^ 83 | ((const struct rte_uint64_alias *)src)->val; | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ =E2=80=98zxdh_hashidx_get=E2=80=99: events 1-3 | |../drivers/net/zxdh/zxdh_common.c:273:1: | 262 | uint8_t reps =3D 0; | | ~~~~ | | | | | (2) capacity: 1 byte |...... | 273 | zxdh_hashidx_get(struct rte_eth_dev *dev, uint8_t *hash_idx) | | ^~~~~~~~~~~~~~~~ | | | | | (1) entry to =E2=80=98zxdh_hashidx_get=E2=80=99 |...... | 278 | int32_t ret =3D zxdh_get_res_hash_id(¶m, hash_idx); | | ~ | | | | | (3) inlined call to =E2=80=98zxdh_get_re= s_hash_id=E2=80=99 from =E2=80=98zxdh_hashidx_get=E2=80=99 | +--> =E2=80=98zxdh_get_res_hash_id=E2=80=99: event 4 | | 265 | if (zxdh_get_res_info(in, ZXDH_TBL_FIELD_HASHID= , &reps, &reps_len) !=3D ZXDH_BAR_MSG_OK) | | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~= ~~~~~~~~~~~~~~~~~~~ | | | | | (4) calling =E2=80=98zxdh_get_res_info=E2= =80=99 from =E2=80=98zxdh_hashidx_get=E2=80=99 | =E2=80=98zxdh_get_res_info=E2=80=99: events 5-12 | | 186 | zxdh_get_res_info(struct zxdh_res_para *dev, uint8_t fi= eld, uint8_t *res, uint16_t *len) | | ^~~~~~~~~~~~~~~~~ | | | | | (5) entry to =E2=80=98zxdh_get_res_info=E2=80=99 |...... | 192 | if (!res || !dev) | | ~ | | | | | (6) following =E2=80=98false=E2=80=99 branch= ... |...... | 195 | struct zxdh_tbl_msg_header tbl_msg =3D { | | ~~~~~~~ | | | | | (7) ...to here |...... | 217 | if (ret !=3D ZXDH_BAR_MSG_OK) { | | ~ | | | | | (8) following =E2=80=98false=E2=80=99 branch= (when =E2=80=98ret =3D=3D 0=E2=80=99)... |...... | 225 | if (tbl_reps->check !=3D ZXDH_TBL_MSG_PRO_SUCCE= SS) { | | ~~~~~~~~~~~~~~~~ | | | | | | | (9) ...to here | | (10) following =E2=80=98false=E2=80=99 branc= h... |...... | 230 | *len =3D tbl_reps->len; | | ~~~~~~~~~~~~~ | | | | | (11) ...to here | 231 | rte_memcpy(res, (recv_buf + ZXDH_REPS_HEADER_OF= FSET + | | ~ | | | | | (12) inlined call to =E2=80=98rte_memcpy=E2=80= =99 from =E2=80=98zxdh_get_res_info=E2=80=99 | +--> =E2=80=98rte_memcpy=E2=80=99: events 13-14 | |../lib/eal/x86/include/rte_memcpy.h:754:12: | 754 | if (!(((uintptr_t)dst | (uintptr_t)src) = & ALIGNMENT_MASK)) | | ^ | | | | | (13) following =E2=80=98true=E2=80=99= branch... | 755 | return rte_memcpy_aligned(dst, s= rc, n); | | ~ | | | | | (14) inlined call to =E2= =80=98rte_memcpy_aligned=E2=80=99 from =E2=80=98rte_memcpy=E2=80=99 | +--> =E2=80=98rte_memcpy_aligned=E2=80=99: events 15-17 | | 705 | if (n < 16) { | | ^ | | | | | (15) ...to here | | (16) following =E2=80=98true= =E2=80=99 branch... | 706 | return rte_mov15_or_less(= dst, src, n); | | ~ | | | | | (17) inlined call = to =E2=80=98rte_mov15_or_less=E2=80=99 from =E2=80=98rte_memcpy_aligned=E2= =80=99 | +--> =E2=80=98rte_mov15_or_less=E2=80=99: events 1= 8-21 | | 81 | if (n & 8) { | | ^ | | | | | (18) ...to here | | (19) following =E2=80= =98true=E2=80=99 branch... | 82 | ((struct rte_uint6= 4_alias *)dst)->val =3D | | ~~~~~~~~~~~~~~~~~~= ~~~~~~~~~~~~~~~~~~~~~ | | = | | | = (21) out-of-bounds write from byte 1 till byte 7 but = =E2=80=98reps=E2=80=99 ends at byte 1 | 83 | ((const st= ruct rte_uint64_alias *)src)->val; | | ~~~~~~~~~~= ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | | = | | | = (20) ...to here | ../lib/eal/x86/include/rte_memcpy.h:82:55: note: write of 7 bytes to beyond= the end of =E2=80=98reps=E2=80=99 82 | ((struct rte_uint64_alias *)dst)->val =3D | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^ 83 | ((const struct rte_uint64_alias *)src)->val; | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ =E2=94=8C=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80= =E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2= =94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94= =80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80= =E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2= =94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94= =80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80= =E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2= =94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=90 =E2=94=82 write of =E2=80=98uint64_t=E2=80=99 (8 bytes= ) =E2=94=82 =E2=94=94=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80= =E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2= =94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94= =80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80= =E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2= =94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94= =80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80= =E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2= =94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=98 =E2=94=82 =E2=94=82 =E2=94=82 =E2=94=82 v v =E2=94=8C=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80= =E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2= =94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94= =80=E2=94=90=E2=94=8C=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80= =E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2= =94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94= =80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80= =E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2= =94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=90 =E2=94=82=E2=80=98reps=E2=80=99 (type: =E2=80=98uint8_t=E2=80=99)=E2=94= =82=E2=94=82 after valid range =E2=94=82 =E2=94=94=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80= =E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2= =94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94= =80=E2=94=98=E2=94=94=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80= =E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2= =94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94= =80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80= =E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2= =94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=98 =E2=94=9C=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80= =E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=AC=E2=94=80=E2=94=80=E2=94=80=E2= =94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94= =80=E2=94=A4=E2=94=9C=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80= =E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2= =94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=AC=E2=94= =80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80= =E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2= =94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=A4 =E2=94=82 =E2=94=82 =E2=95=AD=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94= =80=E2=94=80=E2=94=B4=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80= =E2=94=80=E2=95=AE =E2=95=AD=E2=94=80=E2=94=80=E2=94=80=E2=94= =80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=B4= =E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2= =94=80=E2=94=80=E2=95=AE =E2=94=82capacity: 1 byte=E2=94=82 =E2=94=82=E2=9A=A0=EF= =B8=8F overflow of 7 bytes=E2=94=82 =E2=95=B0=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94= =80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80= =E2=94=80=E2=95=AF =E2=95=B0=E2=94=80=E2=94=80=E2=94=80=E2=94= =80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80= =E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2= =94=80=E2=94=80=E2=95=AF ../lib/eal/x86/include/rte_memcpy.h:82:55: warning: stack-based buffer over= flow [CWE-121] [-Wanalyzer-out-of-bounds] =E2=80=98zxdh_panelid_get=E2=80=99: events 1-3 | |../drivers/net/zxdh/zxdh_common.c:250:1: | 239 | uint8_t reps =3D 0; | | ~~~~ | | | | | (2) capacity: 1 byte |...... | 250 | zxdh_panelid_get(struct rte_eth_dev *dev, uint8_t *panelid) | | ^~~~~~~~~~~~~~~~ | | | | | (1) entry to =E2=80=98zxdh_panelid_get=E2=80=99 |...... | 255 | int32_t ret =3D zxdh_get_res_panel_id(¶m, panelid); | | ~ | | | | | (3) inlined call to =E2=80=98zxdh_get_re= s_panel_id=E2=80=99 from =E2=80=98zxdh_panelid_get=E2=80=99 | +--> =E2=80=98zxdh_get_res_panel_id=E2=80=99: event 4 | | 242 | if (zxdh_get_res_info(in, ZXDH_TBL_FIELD_PNLID,= &reps, &reps_len) !=3D ZXDH_BAR_MSG_OK) | | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~= ~~~~~~~~~~~~~~~~~~ | | | | | (4) calling =E2=80=98zxdh_get_res_info=E2= =80=99 from =E2=80=98zxdh_panelid_get=E2=80=99 | =E2=80=98zxdh_get_res_info=E2=80=99: events 5-12 | | 186 | zxdh_get_res_info(struct zxdh_res_para *dev, uint8_t fi= eld, uint8_t *res, uint16_t *len) | | ^~~~~~~~~~~~~~~~~ | | | | | (5) entry to =E2=80=98zxdh_get_res_info=E2=80=99 |...... | 192 | if (!res || !dev) | | ~ | | | | | (6) following =E2=80=98false=E2=80=99 branch= ... |...... | 195 | struct zxdh_tbl_msg_header tbl_msg =3D { | | ~~~~~~~ | | | | | (7) ...to here |...... | 217 | if (ret !=3D ZXDH_BAR_MSG_OK) { | | ~ | | | | | (8) following =E2=80=98false=E2=80=99 branch= (when =E2=80=98ret =3D=3D 0=E2=80=99)... |...... | 225 | if (tbl_reps->check !=3D ZXDH_TBL_MSG_PRO_SUCCE= SS) { | | ~~~~~~~~~~~~~~~~ | | | | | | | (9) ...to here | | (10) following =E2=80=98false=E2=80=99 branc= h... |...... | 230 | *len =3D tbl_reps->len; | | ~~~~~~~~~~~~~ | | | | | (11) ...to here | 231 | rte_memcpy(res, (recv_buf + ZXDH_REPS_HEADER_OF= FSET + | | ~ | | | | | (12) inlined call to =E2=80=98rte_memcpy=E2=80= =99 from =E2=80=98zxdh_get_res_info=E2=80=99 | +--> =E2=80=98rte_memcpy=E2=80=99: events 13-14 | |../lib/eal/x86/include/rte_memcpy.h:754:12: | 754 | if (!(((uintptr_t)dst | (uintptr_t)src) = & ALIGNMENT_MASK)) | | ^ | | | | | (13) following =E2=80=98true=E2=80=99= branch... | 755 | return rte_memcpy_aligned(dst, s= rc, n); | | ~ | | | | | (14) inlined call to =E2= =80=98rte_memcpy_aligned=E2=80=99 from =E2=80=98rte_memcpy=E2=80=99 | +--> =E2=80=98rte_memcpy_aligned=E2=80=99: events 15-17 | | 705 | if (n < 16) { | | ^ | | | | | (15) ...to here | | (16) following =E2=80=98true= =E2=80=99 branch... | 706 | return rte_mov15_or_less(= dst, src, n); | | ~ | | | | | (17) inlined call = to =E2=80=98rte_mov15_or_less=E2=80=99 from =E2=80=98rte_memcpy_aligned=E2= =80=99 | +--> =E2=80=98rte_mov15_or_less=E2=80=99: events 1= 8-21 | | 81 | if (n & 8) { | | ^ | | | | | (18) ...to here | | (19) following =E2=80= =98true=E2=80=99 branch... | 82 | ((struct rte_uint6= 4_alias *)dst)->val =3D | | ~~~~~~~~~~~~~~~~~~= ~~~~~~~~~~~~~~~~~~~~~ | | = | | | = (21) out-of-bounds write from byte 1 till byte 7 but = =E2=80=98reps=E2=80=99 ends at byte 1 | 83 | ((const st= ruct rte_uint64_alias *)src)->val; | | ~~~~~~~~~~= ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | | = | | | = (20) ...to here | ../lib/eal/x86/include/rte_memcpy.h:82:55: note: write of 7 bytes to beyond= the end of =E2=80=98reps=E2=80=99 82 | ((struct rte_uint64_alias *)dst)->val =3D | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^ 83 | ((const struct rte_uint64_alias *)src)->val; | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ =E2=94=8C=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80= =E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2= =94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94= =80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80= =E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2= =94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94= =80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80= =E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2= =94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=90 =E2=94=82 write of =E2=80=98uint64_t=E2=80=99 (8 bytes= ) =E2=94=82 =E2=94=94=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80= =E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2= =94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94= =80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80= =E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2= =94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94= =80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80= =E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2= =94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=98 =E2=94=82 =E2=94=82 =E2=94=82 =E2=94=82 v v =E2=94=8C=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80= =E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2= =94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94= =80=E2=94=90=E2=94=8C=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80= =E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2= =94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94= =80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80= =E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2= =94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=90 =E2=94=82=E2=80=98reps=E2=80=99 (type: =E2=80=98uint8_t=E2=80=99)=E2=94= =82=E2=94=82 after valid range =E2=94=82 =E2=94=94=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80= =E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2= =94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94= =80=E2=94=98=E2=94=94=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80= =E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2= =94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94= =80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80= =E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2= =94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=98 =E2=94=9C=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80= =E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=AC=E2=94=80=E2=94=80=E2=94=80=E2= =94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94= =80=E2=94=A4=E2=94=9C=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80= =E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2= =94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=AC=E2=94= =80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80= =E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2= =94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=A4 =E2=94=82 =E2=94=82 =E2=95=AD=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94= =80=E2=94=80=E2=94=B4=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80= =E2=94=80=E2=95=AE =E2=95=AD=E2=94=80=E2=94=80=E2=94=80=E2=94= =80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=B4= =E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2= =94=80=E2=94=80=E2=95=AE =E2=94=82capacity: 1 byte=E2=94=82 =E2=94=82=E2=9A=A0=EF= =B8=8F overflow of 7 bytes=E2=94=82 =E2=95=B0=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94= =80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80= =E2=94=80=E2=95=AF =E2=95=B0=E2=94=80=E2=94=80=E2=94=80=E2=94= =80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80= =E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2= =94=80=E2=94=80=E2=95=AF In function =E2=80=98rte_mov15_or_less=E2=80=99, inlined from =E2=80=98rte_memcpy_generic=E2=80=99 at ../lib/eal/x86/inc= lude/rte_memcpy.h:395:10, inlined from =E2=80=98rte_memcpy=E2=80=99 at ../lib/eal/x86/include/rte= _memcpy.h:757:10, inlined from =E2=80=98zxdh_get_res_info=E2=80=99 at ../drivers/net/zxdh= /zxdh_common.c:231:2: ../lib/eal/x86/include/rte_memcpy.h:82:55: warning: stack-based buffer over= flow [CWE-121] [-Wanalyzer-out-of-bounds] 82 | ((struct rte_uint64_alias *)dst)->val =3D | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^ 83 | ((const struct rte_uint64_alias *)src)->val; | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ =E2=80=98zxdh_hashidx_get=E2=80=99: events 1-3 | |../drivers/net/zxdh/zxdh_common.c:273:1: | 262 | uint8_t reps =3D 0; | | ~~~~ | | | | | (2) capacity: 1 byte |...... | 273 | zxdh_hashidx_get(struct rte_eth_dev *dev, uint8_t *hash_idx) | | ^~~~~~~~~~~~~~~~ | | | | | (1) entry to =E2=80=98zxdh_hashidx_get=E2=80=99 |...... | 278 | int32_t ret =3D zxdh_get_res_hash_id(¶m, hash_idx); | | ~ | | | | | (3) inlined call to =E2=80=98zxdh_get_re= s_hash_id=E2=80=99 from =E2=80=98zxdh_hashidx_get=E2=80=99 | +--> =E2=80=98zxdh_get_res_hash_id=E2=80=99: event 4 | | 265 | if (zxdh_get_res_info(in, ZXDH_TBL_FIELD_HASHID= , &reps, &reps_len) !=3D ZXDH_BAR_MSG_OK) | | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~= ~~~~~~~~~~~~~~~~~~~ | | | | | (4) calling =E2=80=98zxdh_get_res_info=E2= =80=99 from =E2=80=98zxdh_hashidx_get=E2=80=99 | =E2=80=98zxdh_get_res_info=E2=80=99: events 5-12 | | 186 | zxdh_get_res_info(struct zxdh_res_para *dev, uint8_t fi= eld, uint8_t *res, uint16_t *len) | | ^~~~~~~~~~~~~~~~~ | | | | | (5) entry to =E2=80=98zxdh_get_res_info=E2=80=99 |...... | 192 | if (!res || !dev) | | ~ | | | | | (6) following =E2=80=98false=E2=80=99 branch= ... |...... | 195 | struct zxdh_tbl_msg_header tbl_msg =3D { | | ~~~~~~~ | | | | | (7) ...to here |...... | 217 | if (ret !=3D ZXDH_BAR_MSG_OK) { | | ~ | | | | | (8) following =E2=80=98false=E2=80=99 branch= (when =E2=80=98ret =3D=3D 0=E2=80=99)... |...... | 225 | if (tbl_reps->check !=3D ZXDH_TBL_MSG_PRO_SUCCE= SS) { | | ~~~~~~~~~~~~~~~~ | | | | | | | (9) ...to here | | (10) following =E2=80=98false=E2=80=99 branc= h... |...... | 230 | *len =3D tbl_reps->len; | | ~~~~~~~~~~~~~ | | | | | (11) ...to here | 231 | rte_memcpy(res, (recv_buf + ZXDH_REPS_HEADER_OF= FSET + | | ~ | | | | | (12) inlined call to =E2=80=98rte_memcpy=E2=80= =99 from =E2=80=98zxdh_get_res_info=E2=80=99 | +--> =E2=80=98rte_memcpy=E2=80=99: events 13-14 | |../lib/eal/x86/include/rte_memcpy.h:754:12: | 754 | if (!(((uintptr_t)dst | (uintptr_t)src) = & ALIGNMENT_MASK)) | | ^ | | | | | (13) following =E2=80=98false=E2=80= =99 branch... |...... | 757 | return rte_memcpy_generic(dst, s= rc, n); | | ~ | | | | | (14) inlined call to =E2= =80=98rte_memcpy_generic=E2=80=99 from =E2=80=98rte_memcpy=E2=80=99 | +--> =E2=80=98rte_memcpy_generic=E2=80=99: events 15-17 | | 394 | if (n < 16) { | | ^ | | | | | (15) ...to here | | (16) following =E2=80=98true= =E2=80=99 branch... | 395 | return rte_mov15_or_less(= dst, src, n); | | ~ | | | | | (17) inlined call = to =E2=80=98rte_mov15_or_less=E2=80=99 from =E2=80=98rte_memcpy_generic=E2= =80=99 | +--> =E2=80=98rte_mov15_or_less=E2=80=99: events 1= 8-21 | | 81 | if (n & 8) { | | ^ | | | | | (18) ...to here | | (19) following =E2=80= =98true=E2=80=99 branch... | 82 | ((struct rte_uint6= 4_alias *)dst)->val =3D | | ~~~~~~~~~~~~~~~~~~= ~~~~~~~~~~~~~~~~~~~~~ | | = | | | = (21) out-of-bounds write from byte 1 till byte 7 but = =E2=80=98reps=E2=80=99 ends at byte 1 | 83 | ((const st= ruct rte_uint64_alias *)src)->val; | | ~~~~~~~~~~= ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | | = | | | = (20) ...to here | ../lib/eal/x86/include/rte_memcpy.h:82:55: note: write of 7 bytes to beyond= the end of =E2=80=98reps=E2=80=99 82 | ((struct rte_uint64_alias *)dst)->val =3D | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^ 83 | ((const struct rte_uint64_alias *)src)->val; | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ =E2=94=8C=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80= =E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2= =94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94= =80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80= =E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2= =94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94= =80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80= =E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2= =94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=90 =E2=94=82 write of =E2=80=98uint64_t=E2=80=99 (8 bytes= ) =E2=94=82 =E2=94=94=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80= =E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2= =94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94= =80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80= =E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2= =94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94= =80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80= =E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2= =94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=98 =E2=94=82 =E2=94=82 =E2=94=82 =E2=94=82 v v =E2=94=8C=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80= =E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2= =94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94= =80=E2=94=90=E2=94=8C=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80= =E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2= =94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94= =80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80= =E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2= =94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=90 =E2=94=82=E2=80=98reps=E2=80=99 (type: =E2=80=98uint8_t=E2=80=99)=E2=94= =82=E2=94=82 after valid range =E2=94=82 =E2=94=94=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80= =E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2= =94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94= =80=E2=94=98=E2=94=94=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80= =E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2= =94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94= =80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80= =E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2= =94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=98 =E2=94=9C=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80= =E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=AC=E2=94=80=E2=94=80=E2=94=80=E2= =94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94= =80=E2=94=A4=E2=94=9C=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80= =E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2= =94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=AC=E2=94= =80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80= =E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2= =94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=A4 =E2=94=82 =E2=94=82 =E2=95=AD=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94= =80=E2=94=80=E2=94=B4=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80= =E2=94=80=E2=95=AE =E2=95=AD=E2=94=80=E2=94=80=E2=94=80=E2=94= =80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=B4= =E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2= =94=80=E2=94=80=E2=95=AE =E2=94=82capacity: 1 byte=E2=94=82 =E2=94=82=E2=9A=A0=EF= =B8=8F overflow of 7 bytes=E2=94=82 =E2=95=B0=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94= =80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80= =E2=94=80=E2=95=AF =E2=95=B0=E2=94=80=E2=94=80=E2=94=80=E2=94= =80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80= =E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2= =94=80=E2=94=80=E2=95=AF