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 B071E459C6; Wed, 18 Sep 2024 09:50:22 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 82BD74029B; Wed, 18 Sep 2024 09:50:21 +0200 (CEST) Received: from lf-2-35.ptr.blmpb.com (lf-2-35.ptr.blmpb.com [101.36.218.35]) by mails.dpdk.org (Postfix) with ESMTP id 989A44028F for ; Wed, 18 Sep 2024 09:50:13 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; s=feishu2403070942; d=yunsilicon.com; t=1726645806; h=from:subject: mime-version:from:date:message-id:subject:to:cc:reply-to:content-type: mime-version:in-reply-to:message-id; bh=kMSv1EkiLMNAoCbmLulXi8SV6tuNQqurVZWt+yQINc0=; b=Sk93ayJPFDbs0Q7951jFlVDkG90fDyTqhk5eTtDjdVutZXvtVa+ejyiNY7M6+WgplrLk56 odRX0HiHFJzuQh3d/A/jrjXMAc8vfW+bxJbYKN7b5h1EGcKvezVh0A4cRBZg06mX9hzTZW I39gA6Bj6ZFmKqgDsr9rJ06raDG/BKaJ963Vv8c247pyDl8xdak+sTk3zMYPHQHAbr+SMi updp6QTlM40gHzEhfV/FhNNFev93sVOgopkz2CEmWE7TF+12KDky3Ip2yoV7sCW/iM7oao BMkcuw/7m1xDK7r7r5p6reB9dhTabvR/PBgsWSLEUd+XIpAUVpNZrgYGGkLbkA== Received: from [127.0.0.1] ([222.64.242.227]) by smtp.feishu.cn with ESMTPS; Wed, 18 Sep 2024 15:50:04 +0800 Content-Transfer-Encoding: quoted-printable From: "WanRenyong" Mime-Version: 1.0 In-Reply-To: Date: Wed, 18 Sep 2024 15:50:04 +0800 X-Original-From: WanRenyong References: <20240918060936.1231758-4-wanry@yunsilicon.com> Content-Type: text/plain; charset=UTF-8 X-Lms-Return-Path: Cc: , Message-Id: <422e5a24-c7c1-4cf1-b40b-e49ef93c5a2c@yunsilicon.com> User-Agent: Mozilla Thunderbird To: "David Marchand" Subject: Re: [PATCH v3 03/19] net/xsc: add PCI device probe and remove 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 2024/9/18 15:28, David Marchand wrote: > On Wed, Sep 18, 2024 at 8:10=E2=80=AFAM WanRenyong = wrote: >> +static const struct rte_pci_id xsc_ethdev_pci_id_map[] =3D { >> + { RTE_PCI_DEVICE(XSC_PCI_VENDOR_ID, XSC_PCI_DEV_ID_MS) }, > You need to null terminate this array with something like: > { .vendor_id =3D 0, /* sentinel */ }, > > Otherwise the bus pci code may read a next symbol or data present in > the .data section. > > ASan caught this issue when running the unit tests: > > =3D=3D70261=3D=3DERROR: AddressSanitizer: global-buffer-overflow on addre= ss > 0x7f8e46bf45f0 at pc 0x7f8e56be523b bp 0x7ffe2ef88ca0 sp > 0x7ffe2ef88c98 > READ of size 2 at 0x7f8e46bf45f0 thread T0 > #0 0x7f8e56be523a in rte_pci_match > /home/runner/work/dpdk/dpdk/build/../drivers/bus/pci/pci_common.c:178:47 > #1 0x7f8e56be523a in rte_pci_probe_one_driver > /home/runner/work/dpdk/dpdk/build/../drivers/bus/pci/pci_common.c:223:7 > #2 0x7f8e56be523a in pci_probe_all_drivers > /home/runner/work/dpdk/dpdk/build/../drivers/bus/pci/pci_common.c:391:8 > #3 0x7f8e56be3297 in pci_probe > /home/runner/work/dpdk/dpdk/build/../drivers/bus/pci/pci_common.c:418:9 > #4 0x7f8e56fe9ea8 in rte_bus_probe > /home/runner/work/dpdk/dpdk/build/../lib/eal/common/eal_common_bus.c:78:9 > #5 0x7f8e570580d1 in rte_eal_init > /home/runner/work/dpdk/dpdk/build/../lib/eal/linux/eal.c:1288:6 > #6 0x5573a597d65d in main > /home/runner/work/dpdk/dpdk/build/../app/test/test.c:145:9 > #7 0x7f8e55829d8f in __libc_start_call_main > csu/../sysdeps/nptl/libc_start_call_main.h:58:16 > #8 0x7f8e55829e3f in __libc_start_main csu/../csu/libc-start.c:392:3 > #9 0x5573a58bf114 in _start > (/home/runner/work/dpdk/dpdk/build/app/dpdk-test+0x1e9114) (BuildId: > 8d4741d712c15395a67005124e1f908d96acf7ff) > > > 172 int > 173 rte_pci_match(const struct rte_pci_driver *pci_drv, > 174 const struct rte_pci_device *pci_dev) > 175 { > 176 const struct rte_pci_id *id_table; > 177 > 178 for (id_table =3D pci_drv->id_table; id_table->vendor_id !=3D > 0; > 179 id_table++) { > > Thanks for review, will fix it in the next version. --=20 Thanks, WanRenyong