Message ID | 1552283715-18723-1-git-send-email-anoobj@marvell.com (mailing list archive) |
---|---|
State | Accepted, archived |
Delegated to: | akhil goyal |
Headers |
Return-Path: <dev-bounces@dpdk.org> X-Original-To: patchwork@dpdk.org Delivered-To: patchwork@dpdk.org Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 770563772; Mon, 11 Mar 2019 06:55:55 +0100 (CET) Received: from mx0b-0016f401.pphosted.com (mx0b-0016f401.pphosted.com [67.231.156.173]) by dpdk.org (Postfix) with ESMTP id A7959375B for <dev@dpdk.org>; Mon, 11 Mar 2019 06:55:53 +0100 (CET) Received: from pps.filterd (m0045851.ppops.net [127.0.0.1]) by mx0b-0016f401.pphosted.com (8.16.0.27/8.16.0.27) with SMTP id x2B5tc0p027858; Sun, 10 Mar 2019 22:55:53 -0700 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=marvell.com; h=from : to : cc : subject : date : message-id : references : in-reply-to : content-type : content-transfer-encoding : mime-version; s=pfpt0818; bh=4nKW9g7HuhvQaRrs1mR/j6CECSE05VZiolWToE1F8Jo=; b=N33HnBZYkkgVkf4/0nYSZn2OOWoic4F3M40H0VizIC2Tx62P1jwkLyuz9+C8rWgk+DH8 FE24YCgxW5r/xrb1sgtN46USDi/XHLLuJg7Gus9pDQoaWF4z6DfhKd6rqOsBKIuWV99s BrinF3jwoAEpCttKl6MS5dvPZ4ZFdP4SieX6xlqytqiN/0xA0Dr6gdyale5q5E3P4z+1 CVqlO/IoBvOFPXbPYBZ+BAQ4PY78Nh4iaVgJmaG95ZeL3c1Z1k+z/pa6hpSaeIHNxzqc 4b1oDZ3cKZu38AhShQJ8ybkhG5+TK8XJlDsp0bCaLbqJEVDJZp/qyjVI5RNeZx2FSn1M sw== Received: from sc-exch01.marvell.com ([199.233.58.181]) by mx0b-0016f401.pphosted.com with ESMTP id 2r4dvrcq6t-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-SHA384 bits=256 verify=NOT); Sun, 10 Mar 2019 22:55:53 -0700 Received: from SC-EXCH04.marvell.com (10.93.176.84) by SC-EXCH01.marvell.com (10.93.176.81) with Microsoft SMTP Server (TLS) id 15.0.1367.3; Sun, 10 Mar 2019 22:55:45 -0700 Received: from NAM01-BN3-obe.outbound.protection.outlook.com (104.47.33.57) by SC-EXCH04.marvell.com (10.93.176.84) with Microsoft SMTP Server (TLS) id 15.0.1367.3 via Frontend Transport; Sun, 10 Mar 2019 22:55:45 -0700 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=marvell.onmicrosoft.com; s=selector1-marvell-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=4nKW9g7HuhvQaRrs1mR/j6CECSE05VZiolWToE1F8Jo=; b=GuWs/YzLdksebj8HJ0FVzazVUv+ZdKuTkga0aMFepDKUN+cL95g/PCT774H+N4cEEE2yw7pupiXI20CX8D0jeUNmes3p3xJeWYrVz9uQRw8PMk5RlEgZ/mmQLzCYK1GO+r4Mdg8k5GQkO2RMyd0fWDBczGaw/Z6NkKWNW6QxR40= Received: from MN2PR18MB2877.namprd18.prod.outlook.com (20.179.20.218) by MN2PR18MB2672.namprd18.prod.outlook.com (20.179.84.74) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1686.18; Mon, 11 Mar 2019 05:55:44 +0000 Received: from MN2PR18MB2877.namprd18.prod.outlook.com ([fe80::1905:8cf6:f4a1:5d9a]) by MN2PR18MB2877.namprd18.prod.outlook.com ([fe80::1905:8cf6:f4a1:5d9a%4]) with mapi id 15.20.1686.021; Mon, 11 Mar 2019 05:55:44 +0000 From: Anoob Joseph <anoobj@marvell.com> To: Akhil Goyal <akhil.goyal@nxp.com>, Declan Doherty <declan.doherty@intel.com>, Pablo de Lara <pablo.de.lara.guarch@intel.com> CC: Anoob Joseph <anoobj@marvell.com>, Ankur Dwivedi <adwivedi@marvell.com>, Jerin Jacob Kollanukkaran <jerinj@marvell.com>, Narayana Prasad Raju Athreya <pathreya@marvell.com>, Suheil Chandran <schandran@marvell.com>, "dev@dpdk.org" <dev@dpdk.org> Thread-Topic: [PATCH v2] lib/cryptodev: fix driver name comparison Thread-Index: AQHU188QzNfa5uFkwUeHDLSJ/oWkIg== Date: Mon, 11 Mar 2019 05:55:44 +0000 Message-ID: <1552283715-18723-1-git-send-email-anoobj@marvell.com> References: <1549279528-10397-1-git-send-email-anoobj@marvell.com> In-Reply-To: <1549279528-10397-1-git-send-email-anoobj@marvell.com> Accept-Language: en-IN, en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-clientproxiedby: BMXPR01CA0014.INDPRD01.PROD.OUTLOOK.COM (2603:1096:b00:d::24) To MN2PR18MB2877.namprd18.prod.outlook.com (2603:10b6:208:3b::26) x-ms-exchange-messagesentrepresentingtype: 1 x-mailer: git-send-email 2.7.4 x-originating-ip: [115.113.156.2] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 348e956b-e921-404c-3a24-08d6a5e63312 x-microsoft-antispam: BCL:0; PCL:0; RULEID:(2390118)(7020095)(4652040)(8989299)(4534185)(7168020)(4627221)(201703031133081)(201702281549075)(8990200)(5600127)(711020)(4605104)(2017052603328)(7153060)(7193020); SRVR:MN2PR18MB2672; x-ms-traffictypediagnostic: MN2PR18MB2672: x-microsoft-exchange-diagnostics: =?iso-8859-1?Q?1; MN2PR18MB2672; 23:WUol04d7kVfa0d6XVpFTUTnzfQ9EwNflpTIUoVY?= =?iso-8859-1?q?WV0mnh2MV3725EQ4hZX4nF7RG?= =?iso-8859-1?q?SicmXfBV7Zqt7JBVv45hvLNrSeAPhajeDbDKsS50jM5AEsi+EfD?= =?iso-8859-1?q?7SzZb6DkBC72HfcUcuidk1+EdCLu/u885rAd8sLklN9aPWnAffO?= =?iso-8859-1?q?yVNobOFB0ztYSujk0h7RjmLGBc9KJDgKxNRimEeN2QB3MzvD3bR?= =?iso-8859-1?q?bpGx7LekA+No0eMNmeAJzmcODRontXpisHtua36HH+uflhhQ9XZ?= =?iso-8859-1?q?BxLM6x0Z0n4c8y6p1wO8gRSq4sAGsEDbU7wAbl5D8eoX8UGBo12?= =?iso-8859-1?q?HsoDjmScZz57Dqe6P14wce2zdCJbEm5H78Exu6S8T84uJrJVIfe?= =?iso-8859-1?q?1/DMbHhdKw2OBQIzSEbWbtQEMThj6nt6ME++7bKQT8BMDsKZLtc?= =?iso-8859-1?q?vXmSBTaglOzhfhgSxj14uZxQd5z2Uh/Bx46Rpkj0sXiDlLtCBkQ?= =?iso-8859-1?q?436At9qJpDl9CYL+yGJ95eYUHiLFUmh0YudwbCornkySau3EafC?= =?iso-8859-1?q?esdUKytGqkveyI/+p8ISALKGE4HERjlmNLtTvBv1hEV2B4C1Hlb?= =?iso-8859-1?q?7wuUqiH8aV5gyOJwLUkTpcVBUcs0ToIS8naDjQA3tbf32iSYlfm?= =?iso-8859-1?q?0uDXciKIQpXyOpNkzzMYvT3U+TkGnI/vIjRgoYZ+4XtqceqLP57?= =?iso-8859-1?q?xUcg3B5lxdtLqtC121rtKPm8NUOhED/t7Zf+ByMzkIwUGdVr6jw?= =?iso-8859-1?q?/eCbVlonHiRz6kBZQZ4lbEvchuac+1f9kCsRn4dE4HdicwmOXDT?= =?iso-8859-1?q?SG3a7GVPYIJMsMlnm6xSviy4pFEaXxOKcSmYgaD0PBlIiHiXPGo?= =?iso-8859-1?q?pJSOhftdy57McCV5f3Idiw0cWudEvlS7Tsm1N97g01S3uMoTBFO?= =?iso-8859-1?q?T3aF4wpK3vJR6WZM4sR39rkO6rv3I2ucGpoFnJ4tYG+wEADCTxr?= =?iso-8859-1?q?3nPj0UZQUYCcLt9k26qGkZIYT/bePZj5pDW0lFRFQTNyZrCVqOh?= =?iso-8859-1?q?LxjqZxBS4ubKgJxE1ehxu64IwMZEtMhQypBUlDO4C8Tjrer8cQM?= =?iso-8859-1?q?rRoyVLh+7Rr7ZIhBuRwmbN6Enu3O2ouCwbIeb1ZcMEHhxsMyWJs?= =?iso-8859-1?q?9i1fN3gJdn0+boHk7ks9Piw0sQ+QNOw2rXfZUW+hjNDGAbELF6e?= =?iso-8859-1?q?NAS1lHLttPKhK0kNqyEUiUxWHeRClRi+BrBJboPXtCYRxydyqSU?= =?iso-8859-1?q?RMpghfilR3kdv3/KY7YKHq9HpeUup6I9U2p3EwrMStmSuG3MDKo?= =?iso-8859-1?q?A=3D=3D?= x-microsoft-antispam-prvs: <MN2PR18MB2672E472BA0D5C729D8DA78CDF480@MN2PR18MB2672.namprd18.prod.outlook.com> x-forefront-prvs: 09730BD177 x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(136003)(396003)(39850400004)(376002)(346002)(366004)(199004)(189003)(25786009)(7736002)(36756003)(316002)(55236004)(6506007)(386003)(305945005)(102836004)(68736007)(6512007)(8936002)(97736004)(50226002)(53936002)(6436002)(6486002)(52116002)(76176011)(8676002)(3846002)(2906002)(105586002)(99286004)(81156014)(81166006)(4326008)(6116002)(486006)(476003)(66066001)(2616005)(86362001)(106356001)(14454004)(186003)(478600001)(54906003)(26005)(110136005)(71190400001)(71200400001)(11346002)(446003)(5660300002)(256004)(14444005); DIR:OUT; SFP:1101; SCL:1; SRVR:MN2PR18MB2672; H:MN2PR18MB2877.namprd18.prod.outlook.com; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; A:1; MX:1; received-spf: None (protection.outlook.com: marvell.com does not designate permitted sender hosts) x-ms-exchange-senderadcheck: 1 x-microsoft-antispam-message-info: TH3PS/uYyh2Omn7cQ7ZycB2/WMXLvU/JyWW3fl/AStMoPn6QqG6I8p//3iWU/OZUqi4YNp87GTK4OoYkXl4U3klesA0yT04ucmc8c6fYB2/7nubVGL+URrgAiIfRtiKjTn3QvcuO7eL+tgtCVayEFYQPzwmf1H4lI8VZr4xGSmnH6A0SmGtZ/z1ZABZFxBytpAsE7ff9Ol8rh9qtLe8qwPb05e0CESWydk2TZDBlx1DkAzBYPd6zPaFxOR+pri2AlgfkNosjqCOWMoxuPYJA7S5i6MXV7Y6smXCtJbRYYCVt0BmnISt1l8uLPLzBNF8niNeCVVfEpj2opfXxSu7AOzD+zIaUUbpmiaXEyxMFGARsP7FEYUV/DL1feGfK11AwCo+xa9d3/eJldG2PtSOrnhe9nVocSkLVzyS6dAnT/O0= Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-MS-Exchange-CrossTenant-Network-Message-Id: 348e956b-e921-404c-3a24-08d6a5e63312 X-MS-Exchange-CrossTenant-originalarrivaltime: 11 Mar 2019 05:55:44.0679 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 70e1fb47-1155-421d-87fc-2e58f638b6e0 X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-Transport-CrossTenantHeadersStamped: MN2PR18MB2672 X-OriginatorOrg: marvell.com X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:, , definitions=2019-03-11_05:, , signatures=0 Subject: [dpdk-dev] [PATCH v2] lib/cryptodev: fix driver name comparison X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions <dev.dpdk.org> List-Unsubscribe: <https://mails.dpdk.org/options/dev>, <mailto:dev-request@dpdk.org?subject=unsubscribe> List-Archive: <http://mails.dpdk.org/archives/dev/> List-Post: <mailto:dev@dpdk.org> List-Help: <mailto:dev-request@dpdk.org?subject=help> List-Subscribe: <https://mails.dpdk.org/listinfo/dev>, <mailto:dev-request@dpdk.org?subject=subscribe> Errors-To: dev-bounces@dpdk.org Sender: "dev" <dev-bounces@dpdk.org> |
Series |
[v2] lib/cryptodev: fix driver name comparison
|
|
Checks
Context | Check | Description |
---|---|---|
ci/checkpatch | success | coding style OK |
ci/Intel-compilation | success | Compilation OK |
ci/mellanox-Performance-Testing | success | Performance Testing PASS |
ci/intel-Performance-Testing | success | Performance Testing PASS |
Commit Message
Anoob Joseph
March 11, 2019, 5:55 a.m. UTC
The string compare to the length of driver name might give false positives when there are drivers with similar names (one being the subset of another). Following is such a naming which could result in false positive. 1. crypto_driver 2. crypto_driver1 When strncmp with len = strlen("crypto_driver") is done, it could give a false positive when compared against "crypto_driver1". For such cases, 'strlen + 1' is done, so that the NULL termination also would be considered for the comparison. Fixes: d11b0f30df88 ("cryptodev: introduce API and framework for crypto devices") Signed-off-by: Ankur Dwivedi <adwivedi@marvell.com> Signed-off-by: Anoob Joseph <anoobj@marvell.com> --- v2: * Using strlen + 1, instead of RTE_CRYPTODEV_NAME_MAX_LEN for the comparison. * Strcmp would not cause this issue. Touching only the places which would result in the issue. lib/librte_cryptodev/rte_cryptodev.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
Comments
> -----Original Message----- > From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of Anoob Joseph > Sent: Monday, March 11, 2019 5:56 AM > To: Akhil Goyal <akhil.goyal@nxp.com>; Doherty, Declan <declan.doherty@intel.com>; De Lara Guarch, > Pablo <pablo.de.lara.guarch@intel.com> > Cc: Anoob Joseph <anoobj@marvell.com>; Ankur Dwivedi <adwivedi@marvell.com>; Jerin Jacob > Kollanukkaran <jerinj@marvell.com>; Narayana Prasad Raju Athreya <pathreya@marvell.com>; Suheil > Chandran <schandran@marvell.com>; dev@dpdk.org > Subject: [dpdk-dev] [PATCH v2] lib/cryptodev: fix driver name comparison > > The string compare to the length of driver name might give false > positives when there are drivers with similar names (one being the > subset of another). > > Following is such a naming which could result in false positive. > 1. crypto_driver > 2. crypto_driver1 > > When strncmp with len = strlen("crypto_driver") is done, it could give > a false positive when compared against "crypto_driver1". For such cases, > 'strlen + 1' is done, so that the NULL termination also would be > considered for the comparison. > > Fixes: d11b0f30df88 ("cryptodev: introduce API and framework for crypto devices") > > Signed-off-by: Ankur Dwivedi <adwivedi@marvell.com> > Signed-off-by: Anoob Joseph <anoobj@marvell.com> Acked-by: Fiona Trahe <fiona.trahe@intel.com>
Hi Akhil, Declan, Pablo, Can you review this patch and share your thoughts? Thanks, Anoob > -----Original Message----- > From: Trahe, Fiona <fiona.trahe@intel.com> > Sent: Monday, March 11, 2019 4:11 PM > To: Anoob Joseph <anoobj@marvell.com>; Akhil Goyal > <akhil.goyal@nxp.com>; Doherty, Declan <declan.doherty@intel.com>; De > Lara Guarch, Pablo <pablo.de.lara.guarch@intel.com> > Cc: Ankur Dwivedi <adwivedi@marvell.com>; Jerin Jacob Kollanukkaran > <jerinj@marvell.com>; Narayana Prasad Raju Athreya > <pathreya@marvell.com>; Suheil Chandran <schandran@marvell.com>; > dev@dpdk.org > Subject: RE: [PATCH v2] lib/cryptodev: fix driver name comparison > > > > > -----Original Message----- > > From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of Anoob Joseph > > Sent: Monday, March 11, 2019 5:56 AM > > To: Akhil Goyal <akhil.goyal@nxp.com>; Doherty, Declan > > <declan.doherty@intel.com>; De Lara Guarch, Pablo > > <pablo.de.lara.guarch@intel.com> > > Cc: Anoob Joseph <anoobj@marvell.com>; Ankur Dwivedi > > <adwivedi@marvell.com>; Jerin Jacob Kollanukkaran > > <jerinj@marvell.com>; Narayana Prasad Raju Athreya > > <pathreya@marvell.com>; Suheil Chandran <schandran@marvell.com>; > > dev@dpdk.org > > Subject: [dpdk-dev] [PATCH v2] lib/cryptodev: fix driver name > > comparison > > > > The string compare to the length of driver name might give false > > positives when there are drivers with similar names (one being the > > subset of another). > > > > Following is such a naming which could result in false positive. > > 1. crypto_driver > > 2. crypto_driver1 > > > > When strncmp with len = strlen("crypto_driver") is done, it could give > > a false positive when compared against "crypto_driver1". For such > > cases, 'strlen + 1' is done, so that the NULL termination also would > > be considered for the comparison. > > > > Fixes: d11b0f30df88 ("cryptodev: introduce API and framework for > > crypto devices") > > > > Signed-off-by: Ankur Dwivedi <adwivedi@marvell.com> > > Signed-off-by: Anoob Joseph <anoobj@marvell.com> > Acked-by: Fiona Trahe <fiona.trahe@intel.com>
On 3/11/2019 11:25 AM, Anoob Joseph wrote: > The string compare to the length of driver name might give false > positives when there are drivers with similar names (one being the > subset of another). > > Following is such a naming which could result in false positive. > 1. crypto_driver > 2. crypto_driver1 > > When strncmp with len = strlen("crypto_driver") is done, it could give > a false positive when compared against "crypto_driver1". For such cases, > 'strlen + 1' is done, so that the NULL termination also would be > considered for the comparison. > > Fixes: d11b0f30df88 ("cryptodev: introduce API and framework for crypto devices") > > Signed-off-by: Ankur Dwivedi <adwivedi@marvell.com> > Signed-off-by: Anoob Joseph <anoobj@marvell.com> > --- > v2: > * Using strlen + 1, instead of RTE_CRYPTODEV_NAME_MAX_LEN for the comparison. > * Strcmp would not cause this issue. Touching only the places which > would result in the issue. > > lib/librte_cryptodev/rte_cryptodev.c | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) > > diff --git a/lib/librte_cryptodev/rte_cryptodev.c b/lib/librte_cryptodev/rte_cryptodev.c > index 7009735..871d7dd 100644 > --- a/lib/librte_cryptodev/rte_cryptodev.c > +++ b/lib/librte_cryptodev/rte_cryptodev.c > @@ -586,7 +586,7 @@ rte_cryptodev_devices_get(const char *driver_name, uint8_t *devices, > > cmp = strncmp(devs[i].device->driver->name, > driver_name, > - strlen(driver_name)); > + strlen(driver_name) + 1); > > if (cmp == 0) > devices[count++] = devs[i].data->dev_id; > @@ -1691,7 +1691,7 @@ rte_cryptodev_driver_id_get(const char *name) > > TAILQ_FOREACH(driver, &cryptodev_driver_list, next) { > driver_name = driver->driver->name; > - if (strncmp(driver_name, name, strlen(driver_name)) == 0) > + if (strncmp(driver_name, name, strlen(driver_name) + 1) == 0) > return driver->id; > } > return -1; Acked-by: Akhil Goyal <akhil.goyal@nxp.com>
On 3/19/2019 7:12 PM, Akhil Goyal wrote: > > On 3/11/2019 11:25 AM, Anoob Joseph wrote: >> The string compare to the length of driver name might give false >> positives when there are drivers with similar names (one being the >> subset of another). >> >> Following is such a naming which could result in false positive. >> 1. crypto_driver >> 2. crypto_driver1 >> >> When strncmp with len = strlen("crypto_driver") is done, it could give >> a false positive when compared against "crypto_driver1". For such cases, >> 'strlen + 1' is done, so that the NULL termination also would be >> considered for the comparison. >> >> Fixes: d11b0f30df88 ("cryptodev: introduce API and framework for crypto devices") >> >> Signed-off-by: Ankur Dwivedi <adwivedi@marvell.com> >> Signed-off-by: Anoob Joseph <anoobj@marvell.com> >> --- >> v2: >> * Using strlen + 1, instead of RTE_CRYPTODEV_NAME_MAX_LEN for the comparison. >> * Strcmp would not cause this issue. Touching only the places which >> would result in the issue. >> >> lib/librte_cryptodev/rte_cryptodev.c | 4 ++-- >> 1 file changed, 2 insertions(+), 2 deletions(-) >> >> diff --git a/lib/librte_cryptodev/rte_cryptodev.c b/lib/librte_cryptodev/rte_cryptodev.c >> index 7009735..871d7dd 100644 >> --- a/lib/librte_cryptodev/rte_cryptodev.c >> +++ b/lib/librte_cryptodev/rte_cryptodev.c >> @@ -586,7 +586,7 @@ rte_cryptodev_devices_get(const char *driver_name, uint8_t *devices, >> >> cmp = strncmp(devs[i].device->driver->name, >> driver_name, >> - strlen(driver_name)); >> + strlen(driver_name) + 1); >> >> if (cmp == 0) >> devices[count++] = devs[i].data->dev_id; >> @@ -1691,7 +1691,7 @@ rte_cryptodev_driver_id_get(const char *name) >> >> TAILQ_FOREACH(driver, &cryptodev_driver_list, next) { >> driver_name = driver->driver->name; >> - if (strncmp(driver_name, name, strlen(driver_name)) == 0) >> + if (strncmp(driver_name, name, strlen(driver_name) + 1) == 0) >> return driver->id; >> } >> return -1; > Acked-by: Akhil Goyal <akhil.goyal@nxp.com> Applied to dpdk-next-crypto Thanks.
diff --git a/lib/librte_cryptodev/rte_cryptodev.c b/lib/librte_cryptodev/rte_cryptodev.c index 7009735..871d7dd 100644 --- a/lib/librte_cryptodev/rte_cryptodev.c +++ b/lib/librte_cryptodev/rte_cryptodev.c @@ -586,7 +586,7 @@ rte_cryptodev_devices_get(const char *driver_name, uint8_t *devices, cmp = strncmp(devs[i].device->driver->name, driver_name, - strlen(driver_name)); + strlen(driver_name) + 1); if (cmp == 0) devices[count++] = devs[i].data->dev_id; @@ -1691,7 +1691,7 @@ rte_cryptodev_driver_id_get(const char *name) TAILQ_FOREACH(driver, &cryptodev_driver_list, next) { driver_name = driver->driver->name; - if (strncmp(driver_name, name, strlen(driver_name)) == 0) + if (strncmp(driver_name, name, strlen(driver_name) + 1) == 0) return driver->id; } return -1;