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 91E5642946; Sat, 15 Apr 2023 03:38:25 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 694DC40A8A; Sat, 15 Apr 2023 03:38:25 +0200 (CEST) Received: from szxga03-in.huawei.com (szxga03-in.huawei.com [45.249.212.189]) by mails.dpdk.org (Postfix) with ESMTP id 2CDD740697 for ; Sat, 15 Apr 2023 03:38:22 +0200 (CEST) Received: from dggpeml500024.china.huawei.com (unknown [172.30.72.54]) by szxga03-in.huawei.com (SkyGuard) with ESMTP id 4Pywt54J7bzJrbV; Sat, 15 Apr 2023 09:37:33 +0800 (CST) Received: from [10.67.100.224] (10.67.100.224) by dggpeml500024.china.huawei.com (7.185.36.10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.23; Sat, 15 Apr 2023 09:38:20 +0800 Subject: Re: [PATCH v2 00/44] fix segment fault when parse args From: fengchengwen To: , CC: References: <20230314124813.39521-1-fengchengwen@huawei.com> <20230320092110.37295-1-fengchengwen@huawei.com> Message-ID: <957bcf61-090d-a0ed-afb1-94897993bcb2@huawei.com> Date: Sat, 15 Apr 2023 09:38:20 +0800 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:68.0) Gecko/20100101 Thunderbird/68.11.0 MIME-Version: 1.0 In-Reply-To: <20230320092110.37295-1-fengchengwen@huawei.com> Content-Type: text/plain; charset="utf-8" Content-Language: en-US Content-Transfer-Encoding: 7bit X-Originating-IP: [10.67.100.224] X-ClientProxiedBy: dggems704-chm.china.huawei.com (10.3.19.181) To dggpeml500024.china.huawei.com (7.185.36.10) X-CFilter-Loop: Reflected 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 Hi Thomas, Ferruh, This patch-set get almost 30% ack by PMD's maintainer. Could it be applied? and squeeze the patch-set is okay. Another thread talk about a change in kvargs API, we could discuss here. My opinion: 1) the below PMD has the bug, but there are also many PMD take care of only key situation. I think it mainly because the API definition is not detailed, but this hole was already fill by commit: 52ab17efdec. 2) the rte_kvargs_get API, I think we could refine it definition, because it can't identify invalid keys and only-keys (both of them return NULL), and I suggest add one extra parameter: const char *rte_kvargs_get(const struct rte_kvargs *kvlist, const char *key, bool *key_exist); Thanks. On 2023/3/20 17:20, Chengwen Feng wrote: > The rte_kvargs_process() was used to parse KV pairs, it also supports > to parse 'only keys' (e.g. socket_id) type. And the callback function > parameter 'value' is NULL when parsed 'only keys'. > > It may leads to segment fault when parse args with 'only key', this > patchset fixes rest of them. > > Chengwen Feng (44): > app/pdump: fix segment fault when parse args > ethdev: fix segment fault when parse args > net/memif: fix segment fault when parse devargs > net/pcap: fix segment fault when parse devargs > net/ring: fix segment fault when parse devargs > net/sfc: fix segment fault when parse devargs > net/af_xdp: fix segment fault when parse devargs > net/ark: fix segment fault when parse devargs > net/cnxk: fix segment fault when parse devargs > net/cxgbe: fix segment fault when parse devargs > net/dpaa2: fix segment fault when parse devargs > net/ena: fix segment fault when parse devargs > net/enic: fix segment fault when parse devargs > net/fm10k: fix segment fault when parse devargs > net/i40e: fix segment fault when parse devargs > net/iavf: fix segment fault when parse devargs > net/ice: fix segment fault when parse devargs > net/idpf: fix segment fault when parse devargs > net/ionic: fix segment fault when parse devargs > net/mana: fix segment fault when parse devargs > net/mlx4: fix segment fault when parse devargs > net/mvneta: fix segment fault when parse devargs > net/mvpp2: fix segment fault when parse devargs > net/netvsc: fix segment fault when parse devargs > net/octeontx: fix segment fault when parse devargs > net/pfe: fix segment fault when parse devargs > net/qede: fix segment fault when parse devargs > baseband/la12xx: fix segment fault when parse devargs > bus/pci: fix segment fault when parse args > common/mlx5: fix segment fault when parse devargs > crypto/cnxk: fix segment fault when parse devargs > crypto/dpaa_sec: fix segment fault when parse devargs > crypto/dpaa2_sec: fix segment fault when parse devargs > crypto/mvsam: fix segment fault when parse devargs > crypto/scheduler: fix segment fault when parse devargs > dma/dpaa2: fix segment fault when parse devargs > event/cnxk: fix segment fault when parse devargs > event/dlb2: fix segment fault when parse devargs > event/dpaa: fix segment fault when parse devargs > event/octeontx: fix segment fault when parse devargs > event/opdl: fix segment fault when parse devargs > event/sw: fix segment fault when parse devargs > mempool/cnxk: fix segment fault when parse devargs > raw/cnxk_gpio: fix segment fault when parse devargs > > --- > v2: according Ferruh's comments: > fix all 'rte_kvargs_process()' bug instances. > only judge value validation. > > app/pdump/main.c | 12 ++++++ > drivers/baseband/la12xx/bbdev_la12xx.c | 3 ++ > drivers/bus/pci/pci_params.c | 2 + > drivers/common/mlx5/mlx5_common.c | 5 +++ > drivers/crypto/cnxk/cnxk_cryptodev_devargs.c | 3 ++ > drivers/crypto/dpaa2_sec/dpaa2_sec_dpseci.c | 2 + > drivers/crypto/dpaa_sec/dpaa_sec.c | 3 ++ > drivers/crypto/mvsam/rte_mrvl_pmd.c | 6 +++ > drivers/crypto/scheduler/scheduler_pmd.c | 21 +++++++++++ > drivers/dma/dpaa2/dpaa2_qdma.c | 3 ++ > drivers/event/cnxk/cnxk_eventdev.c | 6 +++ > drivers/event/cnxk/cnxk_eventdev.h | 6 +++ > drivers/event/cnxk/cnxk_tim_evdev.c | 6 +++ > drivers/event/dlb2/dlb2.c | 5 ++- > drivers/event/dpaa/dpaa_eventdev.c | 3 ++ > drivers/event/octeontx/ssovf_evdev.c | 2 + > drivers/event/opdl/opdl_evdev.c | 9 +++++ > drivers/event/sw/sw_evdev.c | 12 ++++++ > drivers/mempool/cnxk/cnxk_mempool.c | 3 ++ > drivers/net/af_xdp/rte_eth_af_xdp.c | 12 ++++++ > drivers/net/ark/ark_ethdev.c | 3 ++ > drivers/net/cnxk/cnxk_ethdev_devargs.c | 39 ++++++++++++++++++++ > drivers/net/cnxk/cnxk_ethdev_sec.c | 12 ++++++ > drivers/net/cxgbe/cxgbe_main.c | 3 ++ > drivers/net/dpaa2/dpaa2_ethdev.c | 3 ++ > drivers/net/ena/ena_ethdev.c | 6 +++ > drivers/net/enic/enic_ethdev.c | 6 +++ > drivers/net/fm10k/fm10k_ethdev.c | 3 ++ > drivers/net/i40e/i40e_ethdev.c | 15 ++++++++ > drivers/net/iavf/iavf_ethdev.c | 6 +++ > drivers/net/ice/ice_dcf_ethdev.c | 6 +++ > drivers/net/ice/ice_ethdev.c | 6 +++ > drivers/net/idpf/idpf_ethdev.c | 6 +++ > drivers/net/ionic/ionic_dev_pci.c | 3 ++ > drivers/net/mana/mana.c | 3 ++ > drivers/net/memif/rte_eth_memif.c | 30 +++++++++++++++ > drivers/net/mlx4/mlx4.c | 3 ++ > drivers/net/mvneta/mvneta_ethdev.c | 3 ++ > drivers/net/mvpp2/mrvl_ethdev.c | 3 ++ > drivers/net/mvpp2/mrvl_qos.c | 6 ++- > drivers/net/netvsc/hn_ethdev.c | 3 ++ > drivers/net/octeontx/octeontx_ethdev.c | 3 ++ > drivers/net/pcap/pcap_ethdev.c | 18 ++++++++- > drivers/net/pfe/pfe_ethdev.c | 3 ++ > drivers/net/qede/qede_ethdev.c | 3 ++ > drivers/net/ring/rte_eth_ring.c | 6 +++ > drivers/net/sfc/sfc.c | 3 ++ > drivers/net/sfc/sfc_ev.c | 3 ++ > drivers/net/sfc/sfc_kvargs.c | 6 +++ > drivers/raw/cnxk_gpio/cnxk_gpio.c | 6 +++ > lib/ethdev/rte_class_eth.c | 6 +++ > 51 files changed, 345 insertions(+), 4 deletions(-) >