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 499FF42800; Tue, 21 Mar 2023 23:20:29 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 3C5DC40A7F; Tue, 21 Mar 2023 23:20:29 +0100 (CET) Received: from DM6FTOPR00CU001.outbound.protection.outlook.com (mail-cusazon11020014.outbound.protection.outlook.com [52.101.61.14]) by mails.dpdk.org (Postfix) with ESMTP id 8B70E40A7A for ; Tue, 21 Mar 2023 23:20:27 +0100 (CET) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=GfZpFPqqFO4+FoctCEhI/q6arbQ5TkLmL3ez6yXDROY8vQbUKlwEf8SnDPrVjOoB5wQJwc5ZfO+z6NTAgsmh2Nmh/5fuVrNtodIx+5Q67VmRXBmFXifI4OwielmE16g4bLEOxa308CfcxOvCXRpImopDOsJqPcC52avUw+QLSvKbZuvorRHsk7VI8OkJzhLmtCalPlcX7vMwO2NMBI5JV59B1zIvapmftRHIU3DHQYlGHUJKHmcJgSFbxZGsJtnVW5DjcKpmyF/AXusTk63uVfwFQEBXgs4tc1yEGFvDT1U0jXop7ufPs8aXchXqOvd5oE+8XkLjs2P9uRSFo0DrfQ== 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=ruqh2VHzEuwelu3AVmbzB6jq1famtRFy75rU3tDWzQg=; b=FW/LppVSc9WaFlX5Jatnh5GWqgA531t5ckMTA2czQVaMeFjsHAkhIRQNGgg4QGA8Dvz6pIg5cBJSligvQbNEADHl9jeTv5tnMpzmA87Sap1i1EbEA37xYAUDITrO990lB9ZdZCKaqL+iGZV7QmVpq8t4bkLfA3UNzYxknuEzfYIH2FW5VOozWS0NJN7Tqy/4yYMEUTsWYAnRWYkuFJHnqtQ7wlrjQxehb/CMhS/709gI6uhta0MZVOco5ngVNEHCQicv85qqqagQ6iiaYMyI/CS5S0COlTqiO7zg3rA0wYVwk6+plzex2Yj5L7Bq4xlxFNNmqkkd1z+m5AyHuuCslw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=microsoft.com; dmarc=pass action=none header.from=microsoft.com; dkim=pass header.d=microsoft.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=ruqh2VHzEuwelu3AVmbzB6jq1famtRFy75rU3tDWzQg=; b=d69Pn0Tg2FfsHmNHZyGUHSUqMN078MckfKtTld4UCkbPsy9Qz2vrL/qewXOmDMrK3AFqUSADXb25QyPJQiODCTisJfpdhSHASXsIwQJrwH1Js14q6nOCXGnxXsvXQXHu+eKZ7vLc28ZUx8l9zIj1g0/7NbWpIdkuJyfZ7k0Mma8= Received: from PH7PR21MB3263.namprd21.prod.outlook.com (2603:10b6:510:1db::16) by BL1PR21MB3090.namprd21.prod.outlook.com (2603:10b6:208:392::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6254.0; Tue, 21 Mar 2023 22:20:25 +0000 Received: from PH7PR21MB3263.namprd21.prod.outlook.com ([fe80::f5a1:139f:7a0e:4c5e]) by PH7PR21MB3263.namprd21.prod.outlook.com ([fe80::f5a1:139f:7a0e:4c5e%5]) with mapi id 15.20.6254.003; Tue, 21 Mar 2023 22:20:25 +0000 From: Long Li To: Chengwen Feng , "thomas@monjalon.net" , "ferruh.yigit@amd.com" , Stephen Hemminger CC: "dev@dpdk.org" Subject: RE: [PATCH v2 24/44] net/netvsc: fix segment fault when parse devargs Thread-Topic: [PATCH v2 24/44] net/netvsc: fix segment fault when parse devargs Thread-Index: AQHZWw5J9TZt0sa6F0up8+8B7INiJ68F0G5A Date: Tue, 21 Mar 2023 22:20:25 +0000 Message-ID: References: <20230314124813.39521-1-fengchengwen@huawei.com> <20230320092110.37295-1-fengchengwen@huawei.com> <20230320092110.37295-25-fengchengwen@huawei.com> In-Reply-To: <20230320092110.37295-25-fengchengwen@huawei.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: msip_labels: MSIP_Label_f42aa342-8706-4288-bd11-ebb85995028c_ActionId=9ae04070-cd16-4cfe-a8f6-079ecca78a4d; MSIP_Label_f42aa342-8706-4288-bd11-ebb85995028c_ContentBits=0; MSIP_Label_f42aa342-8706-4288-bd11-ebb85995028c_Enabled=true; MSIP_Label_f42aa342-8706-4288-bd11-ebb85995028c_Method=Standard; MSIP_Label_f42aa342-8706-4288-bd11-ebb85995028c_Name=Internal; MSIP_Label_f42aa342-8706-4288-bd11-ebb85995028c_SetDate=2023-03-21T22:19:58Z; MSIP_Label_f42aa342-8706-4288-bd11-ebb85995028c_SiteId=72f988bf-86f1-41af-91ab-2d7cd011db47; authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=microsoft.com; x-ms-publictraffictype: Email x-ms-traffictypediagnostic: PH7PR21MB3263:EE_|BL1PR21MB3090:EE_ x-ms-office365-filtering-correlation-id: 4e177663-cfe4-45c2-3f98-08db2a5a7810 x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: 18IZCX4viIPYYvEBu5xt3f6SHdSwzRKgDZAL7spseELABNOT4L/hB9xgu6g8nKl1QNk9br0L0mVcK4LkWlBPne9NZ1KwdhpBeLuurfxqI33XCcS8S+kAVrgglE7PCTHlvgm6BgSuNNeV6MFKv+19XZMnZZ1gJs4iWuq5tBgtH2ZiiUhZ5RVYAzQNuVO+6hY3MWQWkWRKe4QZkK9N29VZii+dMoye5T2qm0dzaZlxGPwhn4U0UbsFWS0QgPAxSgbA7odFbDPRRnnAOVBch6TKjcJa9f70uPzZW7Q0aBfrCctj9ONjg9J95syh2xhqqRJIMKskt4omWRaLbfogzZHqXzJ7flwcTb21/2wq4B8A2pD/yqZctJuW3yMKjLrQekmArfXmx1w8KnnDfqJKNYFLzHGkGKr1mjhlBlsJkJEk297oKpGH/6Xip+pPBC9h8WgvfYdUsNWaLVrBJ4FN3lcFBL2XXi2EU5e+sEa4zPRgQ5brhgkiWCZWXLjzaIJGYgS11yCBmB+f7oQ01kASqHCu0WhFWeDoXCNdj4PSUEi2j8j7RpOhyJWr09RpPnRlfZ+BdI3LQvos+WLqyUqMHIQKfA+ZjfT20cFFk5+1CFqO1D0gZrpqeyXUbU65J0pUDl6TrWFIaPHGfhJlsEzJctCQ8XWlqK3uFCIUHVSm55gA/a1D24Ww6VkVP1uAsSAlz4NcKdQLqJs4Y3gCdBJzdlgETIYgn7oqe8i+zhbI5qA3Wm4q3f3jCTxz+8PTNSjYLZBd x-forefront-antispam-report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:PH7PR21MB3263.namprd21.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230025)(4636009)(39860400002)(396003)(346002)(366004)(136003)(376002)(451199018)(41300700001)(8936002)(2906002)(52536014)(38100700002)(122000001)(86362001)(33656002)(7696005)(38070700005)(82960400001)(82950400001)(8676002)(5660300002)(8990500004)(66946007)(10290500003)(478600001)(76116006)(71200400001)(66446008)(66476007)(64756008)(55016003)(4326008)(66556008)(316002)(6636002)(186003)(110136005)(9686003)(26005)(6506007); DIR:OUT; SFP:1102; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?IEY/lVApLfTX/sdaumTU9WlKOFo2Nq1DWm93i8jtsUpST3DAtG2rSSxpDnt5?= =?us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UGTDSdX?= =?us-ascii?Q?BuynzoD+eCTDFYRKTHSpJOIE3W83Ow738yt7ZTFw0sV+EkjUAaZE0hOH17nn?= =?us-ascii?Q?+Dx9c95GfTnP1gVyo+cMUwuLq+z8wpmDCKPmDoLTrh2LsgVQWVt1IMIwB6yu?= =?us-ascii?Q?6QEdUBS7dNdjYABxYCJHS54BlogsSA0XNVP/tVh8az4FkJAXLIP5u3nxXYdQ?= =?us-ascii?Q?2RxSZHZHo6+GSm4CLTFF80FtUC2782XfxkGYJ9mRSbHibKDPnbukG3IT25QO?= =?us-ascii?Q?xXm2E609iDF1aF0R1b5KbZdDTaZJ0bSjlHVVIKiNmFssw2n11nC26r1qtkwN?= =?us-ascii?Q?fK215QxQaaT2fXEX8ZbqkTr8p75G00UpzbyRRlwCGDGM+R2dJaMv9/0PIzcX?= =?us-ascii?Q?6VzAXUKw/hNRGIUCWdS/+qhbQS6leKicp7YhPaTQbHWJJDB8x07MoeIjKoVM?= =?us-ascii?Q?dQDh0/w0fQO9PruICIXaXsiWQednBZVy/0ixuwYm9xv2HcKLVGOv2lyVwtyj?= =?us-ascii?Q?YxV4jzo4diok0qmFqA1vDJB1kfDiwhUJdjbQw3+fsuyKSOFeZQHr6hzJ1bPD?= =?us-ascii?Q?PNfB/cSptmHFXVdbePP9d4BOejym8susgV7wvW8uMKGESF3FQ81b/rYZ/M8a?= =?us-ascii?Q?4ac3dzT889AIOsvpvo2occ7ztitkMgpw/GOYhD4z?= Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-OriginatorOrg: microsoft.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: PH7PR21MB3263.namprd21.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 4e177663-cfe4-45c2-3f98-08db2a5a7810 X-MS-Exchange-CrossTenant-originalarrivaltime: 21 Mar 2023 22:20:25.2581 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 72f988bf-86f1-41af-91ab-2d7cd011db47 X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: Znftv5bHwn85RWlPWI9gaBv3nLtZc7T3hnch7n1paRtUGa+zCUY1RqVabXISBqFpnCIERVI6ZWRvLi/6j7fPDw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: BL1PR21MB3090 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 > Subject: [PATCH v2 24/44] net/netvsc: fix segment fault when parse devarg= s >=20 > 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 'v= alue' is > NULL when parsed 'only keys'. >=20 > This patch fixes segment fault when parse input args with 'only keys'. >=20 > Fixes: a25d39a3eb69 ("net/netvsc: allow tuning latency with devargs") > Cc: stable@dpdk.org >=20 > Signed-off-by: Chengwen Feng Thank you. Acked-by: Long Li > --- > drivers/net/netvsc/hn_ethdev.c | 3 +++ > 1 file changed, 3 insertions(+) >=20 > diff --git a/drivers/net/netvsc/hn_ethdev.c b/drivers/net/netvsc/hn_ethde= v.c > index d0bbc0a4c0..e13eb03176 100644 > --- a/drivers/net/netvsc/hn_ethdev.c > +++ b/drivers/net/netvsc/hn_ethdev.c > @@ -157,6 +157,9 @@ static int hn_set_parameter(const char *key, const > char *value, void *opaque) > char *endp =3D NULL; > unsigned long v; >=20 > + if (value =3D=3D NULL) > + return -EINVAL; > + > v =3D strtoul(value, &endp, 0); > if (*value =3D=3D '\0' || *endp !=3D '\0') { > PMD_DRV_LOG(ERR, "invalid parameter %s=3D%s", key, value); > -- > 2.17.1