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 5687E42833; Fri, 24 Mar 2023 17:26:22 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 33C17406B8; Fri, 24 Mar 2023 17:26:22 +0100 (CET) Received: from mga06.intel.com (mga06b.intel.com [134.134.136.31]) by mails.dpdk.org (Postfix) with ESMTP id 6D5BB4021F for ; Fri, 24 Mar 2023 17:26:20 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1679675180; x=1711211180; h=from:to:cc:subject:date:message-id:references: in-reply-to:content-transfer-encoding:mime-version; bh=9iqlnFYCVfHa8QffLiHVRtDDi8fLavp7qoYM5cAaS9Y=; b=CvJjUcUzuIHR6Ogr69T8fA7u0PdcNK5J6fR2LpWkdQ9TfmkBoiIYJ4xf dTbd+MnsDywIXWEt8sDBUB2irrudnO9NYPrA9Jhi6YT4QHFO0qaZjCIEN rBxI8EUFu4qmxq+VUbeXVKkUi+t+SwjvgSBJdlvakmU+T5i3NrvHgkSBU wLndrSbySazJ/IeWiuj+ucLh8aHlZveO99mkvauuFwuCmFRHgRIWxnj5w Bh+Mf1cIFULHY2oJNFgR0MDoFcO1IDA8V3bQMmyol5gY4kGwB5D5vGLS3 TfCwHOKYqDSX0uY6WM/Wg+LbD05WmY54ZAYifkf/yGzUkr1+ZFF+jOY40 Q==; X-IronPort-AV: E=McAfee;i="6600,9927,10659"; a="402406534" X-IronPort-AV: E=Sophos;i="5.98,288,1673942400"; d="scan'208";a="402406534" Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by orsmga104.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 24 Mar 2023 09:26:19 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10659"; a="793498071" X-IronPort-AV: E=Sophos;i="5.98,288,1673942400"; d="scan'208";a="793498071" Received: from orsmsx602.amr.corp.intel.com ([10.22.229.15]) by fmsmga002.fm.intel.com with ESMTP; 24 Mar 2023 09:26:18 -0700 Received: from orsmsx611.amr.corp.intel.com (10.22.229.24) by ORSMSX602.amr.corp.intel.com (10.22.229.15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.21; Fri, 24 Mar 2023 09:26:18 -0700 Received: from ORSEDG602.ED.cps.intel.com (10.7.248.7) by orsmsx611.amr.corp.intel.com (10.22.229.24) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.21 via Frontend Transport; Fri, 24 Mar 2023 09:26:18 -0700 Received: from NAM12-MW2-obe.outbound.protection.outlook.com (104.47.66.41) by edgegateway.intel.com (134.134.137.103) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2507.21; Fri, 24 Mar 2023 09:26:06 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=bW/brbH6Q+6r0Pv/+5uTYcK3KD1eiaoMfNM77KmFwYC8U2ykCUNElm4VUUNdr4bb5wtKXzuOndNqjUO2Bm17difh6Ynn13cqui1S73sz+IH/71oaPgTTuCaRDBPM3Rp8wOOoE45q+5+02yYxwH+jQ6jEb8HOEcLOE+j4h/cxEioK97TLh06LLploG0LDPrRZpMFJ/TUhBKpQhxDlFkfhvNDIYH0JCxvCi+tr9kCoawvZRH7ga50cNRZJpamlq0o9kg2e46Eh/ux8H8xgpuqvbdQmfvM7Jv+XGtgB0Udk8yRFndGP44YBae7HccRGKYRKyUktpvfHhQZWak1A5JwXtw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=QYzRCWmuyy71mIEiwkBIJSv99KxP1n5BjMtB3Xwq5Hg=; b=DF21gwVFrh6r2aIAS3n8nrnopAmXWvaDR5xD8GXu1kA4QsGk1CSITN+xqeFGBTdkq+x2fFUY39dJBGrvsHRNNwkvHz1ZQFtiBMy9uwfPuqbU383CJdHBKoFtNGQbwBpmGiV9p9MSiNOFRRlJXtu+nr1uobvJvU2TiIg91yH8R6tNnpXE/scyveP4uwY04tqQmu4y2EjBwbr35wnbDUCxjtSAS33Rrf2hR29mYkpGzJ3yjfzGJMtRNVyvcLV1BINvSR776AUTOYv3TEBB8Qb2s4+5YZrhNTKyIaJg3ENvNlQX7Cwv8x49KNGzPLIz+6ljsEmphj4G5QCZYR5DTn6DOQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=intel.com; dmarc=pass action=none header.from=intel.com; dkim=pass header.d=intel.com; arc=none Received: from BYAPR11MB3158.namprd11.prod.outlook.com (2603:10b6:a03:1c::29) by SJ0PR11MB5647.namprd11.prod.outlook.com (2603:10b6:a03:3af::6) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6178.38; Fri, 24 Mar 2023 16:26:05 +0000 Received: from BYAPR11MB3158.namprd11.prod.outlook.com ([fe80::2f9c:a84e:88c9:e857]) by BYAPR11MB3158.namprd11.prod.outlook.com ([fe80::2f9c:a84e:88c9:e857%4]) with mapi id 15.20.6178.039; Fri, 24 Mar 2023 16:26:05 +0000 From: "Sevincer, Abdullah" To: Chengwen Feng , "thomas@monjalon.net" , "ferruh.yigit@amd.com" , "McDaniel, Timothy" CC: "dev@dpdk.org" Subject: RE: [PATCH v2 38/44] event/dlb2: fix segment fault when parse devargs Thread-Topic: [PATCH v2 38/44] event/dlb2: fix segment fault when parse devargs Thread-Index: AQHZWw5VuECL+zN8AEuT4jwSpqQ1Ra8KJH7Q Date: Fri, 24 Mar 2023 16:26:04 +0000 Message-ID: References: <20230314124813.39521-1-fengchengwen@huawei.com> <20230320092110.37295-1-fengchengwen@huawei.com> <20230320092110.37295-39-fengchengwen@huawei.com> In-Reply-To: <20230320092110.37295-39-fengchengwen@huawei.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=intel.com; x-ms-publictraffictype: Email x-ms-traffictypediagnostic: BYAPR11MB3158:EE_|SJ0PR11MB5647:EE_ x-ms-office365-filtering-correlation-id: 684adc8c-23fc-4214-ffcb-08db2c847706 x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: mN5tIVDhiK5FW8Geg5dIrswt2sJyZ2uPS7jzyqcvBQG/1D9YeQjQwjzAX5vADLPxOwq4mAgVSNsBckoXItEwlwUyfh2Q1CRxX7J99eYpgRAdye6L/VRbeYet8WDOoGznJEOvU0zSiJkW3cZfiUiituHrpiFYuWeWAoK3PfnPaX19KsbhYkFiP0vXTswWx+80yOQDUgEXyD1eLQNdlYXpO2ilkROrj72+o9F3Kh6SVU+khKR+dVIe2VDqltpQV0i6Yn+14oPDTrRC7a7KtwMz8WjqXmaQv4gfgeEuIXt+ZhxKO6ONn2GQhU+00Ns42GvvzVNjgUONWHKpfb1zGOxK599iwRUkIN9ZuBPr4dEPGBbi+y5xqlqfSAyXsYIQk3xBzU9mqs1VPZeg8rh9wWmT7VYBLGg1aI+MvNaJLVYdfEgbIZ3BNVPxqVdpE5tMEW1ewa4HDYVhyfM7DR45mHhUgQ3OXDh+AXKAoigGCZSEIYBQX7IYo0XMbCYii/mP+yiTFIRebLmVQu/vfqGwT0oh8opZn5yZ1vRtVLqW67FGdwdPIHkFg8U+j/AQnJU0CU91R6hGY5pKZN37bUguQIPEuWBXoVB3PmfYFlCUe3Zt9UbBJaRBon0mBpMw7jNP8v1V x-forefront-antispam-report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:BYAPR11MB3158.namprd11.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230025)(376002)(39860400002)(136003)(366004)(396003)(346002)(451199018)(33656002)(38100700002)(8936002)(4326008)(8676002)(86362001)(76116006)(66946007)(64756008)(52536014)(66556008)(66446008)(41300700001)(66476007)(110136005)(71200400001)(316002)(6636002)(7696005)(478600001)(2906002)(5660300002)(82960400001)(26005)(38070700005)(55016003)(9686003)(122000001)(53546011)(6506007)(186003)(83380400001); DIR:OUT; SFP:1102; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?ygAIL6YjBE740h28d9quJCYZQL0CflvSsDHJg/H/IdYmaIk7lQx95B0YyrdM?= =?us-ascii?Q?UqRlmiM35D5RHkyrWY1lcw+RqOIOHSZUpyKRAzTjdVFkN3JA70kvujmopYh1?= =?us-ascii?Q?dqeWmEvjYZXkztvUp8H4i4F68riHW1f6vqD0QMOeh+eKM3i6EUt+JKqUB2Bq?= =?us-ascii?Q?jOwab8MPnvn5XNJA/ll4s3FDYvt2kM6/DP5+II37JXdcgnmwO5bE2pqhF7v3?= =?us-ascii?Q?+R3W5Wi9EhKfrRnC4WFgI1opNsVi7w/tGcruzeItbO753mYHKHASe5rWvlz2?= =?us-ascii?Q?snNswyg3gOJ6Mo8r2bRGhyEGtOdXprEPimGApeWkDf5BjRcdnmhfSedid7lv?= =?us-ascii?Q?MjxV5LAk0JsC5jSRwCUCbPWY9dyYjCsILV70uvUNOVmlqU/m6/lZAfVX5gJV?= =?us-ascii?Q?cAPz5KKHBRbR6qaB9UyGFiXBdnb0zFLwg4lf1ZIF5quvKiR4p+0LKOwbtD5N?= =?us-ascii?Q?yN6s/I3VMyEH0S89SE3/bWeZw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Q?q42Ku0wI+VpHVBSYQJEtkkA9xcj4cKVQ4PqcUSWHyeF4GloWWK90SOM7EbXJ?= =?us-ascii?Q?/e8r1oXY06eayksUJt0qzp+NHKW45GZhXCGsYVaHR7UgPBqDZjlSmzpPkb2F?= =?us-ascii?Q?ZS7D/ZXy6C1q3MY1DNXrS+bN5bA6+GKIKrajsy2ReSjCyaMlW6QSSLXI3ha+?= =?us-ascii?Q?OFhnAKOTjI0DhVoD87/K9j0iH6q0Ps7ZGxyixTZ3kvA7wCadq7lTsLDRwNWd?= =?us-ascii?Q?1Q=3D=3D?= Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: BYAPR11MB3158.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 684adc8c-23fc-4214-ffcb-08db2c847706 X-MS-Exchange-CrossTenant-originalarrivaltime: 24 Mar 2023 16:26:04.6684 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 46c98d88-e344-4ed4-8496-4ed7712e255d X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: S8TdJq2UfzuhFCVxk8qjvw4BfzMBRExacl7ooJtjBQABH1Sg5wx0KDCC39loo6uzzPm00FdtDvuJL2B6iIYBWkST6X7SnlsTOU1FeTaBESY= X-MS-Exchange-Transport-CrossTenantHeadersStamped: SJ0PR11MB5647 X-OriginatorOrg: intel.com 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 Acked-by: Abdullah Sevincer -----Original Message----- From: Chengwen Feng =20 Sent: Monday, March 20, 2023 2:21 AM To: thomas@monjalon.net; ferruh.yigit@amd.com; McDaniel, Timothy ; Sevincer, Abdullah Cc: dev@dpdk.org Subject: [PATCH v2 38/44] event/dlb2: fix segment fault when parse devargs The rte_kvargs_process() was used to parse KV pairs, it also supports to pa= rse 'only keys' (e.g. socket_id) type. And the callback function parameter = 'value' is NULL when parsed 'only keys'. This patch fixes segment fault when parse input args with 'only keys'. Fixes: 8d1d9070bbe9 ("event/dlb2: optimize producer port probing") Fixes: bec8901bfe9f ("event/dlb2: support ldb port specific COS") Cc: stable@dpdk.org Signed-off-by: Chengwen Feng --- drivers/event/dlb2/dlb2.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/drivers/event/dlb2/dlb2.c b/drivers/event/dlb2/dlb2.c index 60= c5cd4804..d436cf852a 100644 --- a/drivers/event/dlb2/dlb2.c +++ b/drivers/event/dlb2/dlb2.c @@ -329,6 +329,9 @@ set_numa_node(const char *key __rte_unused, const char = *value, void *opaque) int *socket_id =3D opaque; int ret; =20 + if (value =3D=3D NULL) + return -EINVAL; + ret =3D dlb2_string_to_int(socket_id, value); if (ret < 0) return ret; @@ -542,7 +545,7 @@ set_cos_bw(const char *key __rte_unused, { struct dlb2_cos_bw *cos_bw =3D opaque; =20 - if (opaque =3D=3D NULL) { + if (value =3D=3D NULL || opaque =3D=3D NULL) { DLB2_LOG_ERR("NULL pointer\n"); return -EINVAL; } -- 2.17.1