From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from EUR04-HE1-obe.outbound.protection.outlook.com (mail-eopbgr70051.outbound.protection.outlook.com [40.107.7.51]) by dpdk.org (Postfix) with ESMTP id 022F91B147; Thu, 2 May 2019 20:12:49 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=Mellanox.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=Xb5YsnaM7hkBsNqBUtaj5s39YVqDCIGVl3T3bXb9t3o=; b=inqY7tXUZrBogAmLY7+NBjuLzN+7dmU58y/RwN9fE5eqK2eH5TxSyTrL74Vrm/zKYqKZPoe6xhbO+FIAhB7bAWdHMyVNHOIdNaQd9avWt84Vfb+k5rwkSrRia3LT51PC5g33lywj36Y1fceI0iXhHv6LP8t00Fa+j55Ukdlb40k= Received: from DB3PR0502MB3980.eurprd05.prod.outlook.com (52.134.72.27) by DB3PR0502MB3979.eurprd05.prod.outlook.com (52.134.67.155) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1856.11; Thu, 2 May 2019 18:12:48 +0000 Received: from DB3PR0502MB3980.eurprd05.prod.outlook.com ([fe80::e8d5:4aff:902d:6e98]) by DB3PR0502MB3980.eurprd05.prod.outlook.com ([fe80::e8d5:4aff:902d:6e98%5]) with mapi id 15.20.1856.008; Thu, 2 May 2019 18:12:48 +0000 From: Yongseok Koh To: Dekel Peled CC: Shahaf Shuler , dev , "stable@dpdk.org" Thread-Topic: [PATCH v2 2/4] net/mlx5: fix missing validation of null pointer Thread-Index: AQHVAPh2Kbq+kZElKkODZeDwr1FgIKZYI1gA Date: Thu, 2 May 2019 18:12:48 +0000 Message-ID: References: In-Reply-To: Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: spf=none (sender IP is ) smtp.mailfrom=yskoh@mellanox.com; x-originating-ip: [209.116.155.178] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 1496d3ad-ef62-40a3-8c59-08d6cf29c859 x-ms-office365-filtering-ht: Tenant x-microsoft-antispam: BCL:0; PCL:0; RULEID:(2390118)(7020095)(4652040)(8989299)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(5600141)(711020)(4605104)(4618075)(2017052603328)(7193020); SRVR:DB3PR0502MB3979; x-ms-traffictypediagnostic: DB3PR0502MB3979: x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:3383; x-forefront-prvs: 0025434D2D x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(396003)(39860400002)(346002)(376002)(366004)(136003)(199004)(189003)(43544003)(6436002)(6116002)(3846002)(68736007)(14454004)(73956011)(37006003)(91956017)(316002)(54906003)(6862004)(8936002)(6636002)(83716004)(450100002)(4326008)(186003)(71200400001)(71190400001)(66946007)(99286004)(2906002)(66066001)(66476007)(66556008)(66446008)(64756008)(229853002)(26005)(6486002)(5660300002)(76116006)(486006)(305945005)(7736002)(6506007)(82746002)(6246003)(8676002)(53936002)(81166006)(81156014)(14444005)(25786009)(33656002)(102836004)(256004)(6512007)(86362001)(446003)(11346002)(476003)(76176011)(478600001)(36756003)(2616005)(53546011); DIR:OUT; SFP:1101; SCL:1; SRVR:DB3PR0502MB3979; H:DB3PR0502MB3980.eurprd05.prod.outlook.com; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; A:1; MX:1; received-spf: None (protection.outlook.com: mellanox.com does not designate permitted sender hosts) x-ms-exchange-senderadcheck: 1 x-microsoft-antispam-message-info: S7DLZPmCOwC0TmyrdvXKuDaR8110MDTLnktz2h/0DtjCEfv30QANsUgNVCUGFjjpr/RjixHEisduIhnsAUO2leQyDcYveGkfxwdCzEvffEXSDKdWsyAFq9ZNpR3qeYnMxrWcu4sJHvOKhXub6VuUuexQ0wgPwpzPipw+x+8h11x0m9FTWzY+JEkRORp71AIc5bPrjdXp64lRDx22WYWAyVmc2ts/l/judRameYRkKS5BMtwsryd9JnViddi2WNENzLyTUDP8vR5MX5aOHWOpMJB86FA1spsIiziY8Huoef08CM3V9kgq7u9iDHi/vhiCLvd/qtgvHKeEFFV83Ksf1D/WdDMkvp3Bp3nMVao0wvG7pXj/evyJ5eQgqWGCgsf/KPkYM99LkGA1AsXX6vybEekZ4dt9nIUOROiYcH5cIGE= Content-Type: text/plain; charset="us-ascii" Content-ID: <594E70984B6C414CBF949F15FF6CB76A@eurprd05.prod.outlook.com> Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-OriginatorOrg: Mellanox.com X-MS-Exchange-CrossTenant-Network-Message-Id: 1496d3ad-ef62-40a3-8c59-08d6cf29c859 X-MS-Exchange-CrossTenant-originalarrivaltime: 02 May 2019 18:12:48.0123 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: a652971c-7d2e-4d9b-a6a4-d149256f461b X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB3PR0502MB3979 Subject: Re: [dpdk-dev] [PATCH v2 2/4] net/mlx5: fix missing validation of null pointer X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 02 May 2019 18:12:50 -0000 > On May 2, 2019, at 8:01 AM, Dekel Peled wrote: >=20 > Function mlx5_rxq_ibv_release() is called in several places. > Before each call except one, the input parameter is validated to make > sure it is not null. >=20 > This patch adds the missing validation where it is missing. >=20 > Fixes: af4f09f28294 ("net/mlx5: prefix all functions with mlx5") > Cc: stable@dpdk.org >=20 > Signed-off-by: Dekel Peled > --- > drivers/net/mlx5/mlx5_rxq.c | 3 ++- > 1 file changed, 2 insertions(+), 1 deletion(-) >=20 > diff --git a/drivers/net/mlx5/mlx5_rxq.c b/drivers/net/mlx5/mlx5_rxq.c > index db8c340..c9c2a14 100644 > --- a/drivers/net/mlx5/mlx5_rxq.c > +++ b/drivers/net/mlx5/mlx5_rxq.c > @@ -617,7 +617,8 @@ > */ > rxq_data =3D (*priv->rxqs)[i]; > rxq_ctrl =3D container_of(rxq_data, struct mlx5_rxq_ctrl, rxq); > - mlx5_rxq_ibv_release(rxq_ctrl->ibv); > + if (rxq_ctrl->ibv) > + mlx5_rxq_ibv_release(rxq_ctrl->ibv); Please take care of two more things. 1) In mlx5_rx_intr_disable(),=20 mlx5_rxq_ibv_get() isn't paired with mlx5_rxq_ibv_release() This would need a separate patch. 2) In mlx5_rx_intr_vec_disable() Please fix the comment having the old name - priv_rx_intr_vec_enable(). This should be mlx5_rx_intr_vec_enable() No need to have a separate patch. You can fix it in this patch. With the change, Acked-by: Yongseok Koh > } > free: > rte_intr_free_epoll_fd(intr_handle); > --=20 > 1.8.3.1 >=20 From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by dpdk.space (Postfix) with ESMTP id D780EA0AC5 for ; Thu, 2 May 2019 20:12:52 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 518C51B1D6; Thu, 2 May 2019 20:12:51 +0200 (CEST) Received: from EUR04-HE1-obe.outbound.protection.outlook.com (mail-eopbgr70051.outbound.protection.outlook.com [40.107.7.51]) by dpdk.org (Postfix) with ESMTP id 022F91B147; Thu, 2 May 2019 20:12:49 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=Mellanox.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=Xb5YsnaM7hkBsNqBUtaj5s39YVqDCIGVl3T3bXb9t3o=; b=inqY7tXUZrBogAmLY7+NBjuLzN+7dmU58y/RwN9fE5eqK2eH5TxSyTrL74Vrm/zKYqKZPoe6xhbO+FIAhB7bAWdHMyVNHOIdNaQd9avWt84Vfb+k5rwkSrRia3LT51PC5g33lywj36Y1fceI0iXhHv6LP8t00Fa+j55Ukdlb40k= Received: from DB3PR0502MB3980.eurprd05.prod.outlook.com (52.134.72.27) by DB3PR0502MB3979.eurprd05.prod.outlook.com (52.134.67.155) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1856.11; Thu, 2 May 2019 18:12:48 +0000 Received: from DB3PR0502MB3980.eurprd05.prod.outlook.com ([fe80::e8d5:4aff:902d:6e98]) by DB3PR0502MB3980.eurprd05.prod.outlook.com ([fe80::e8d5:4aff:902d:6e98%5]) with mapi id 15.20.1856.008; Thu, 2 May 2019 18:12:48 +0000 From: Yongseok Koh To: Dekel Peled CC: Shahaf Shuler , dev , "stable@dpdk.org" Thread-Topic: [PATCH v2 2/4] net/mlx5: fix missing validation of null pointer Thread-Index: AQHVAPh2Kbq+kZElKkODZeDwr1FgIKZYI1gA Date: Thu, 2 May 2019 18:12:48 +0000 Message-ID: References: In-Reply-To: Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: spf=none (sender IP is ) smtp.mailfrom=yskoh@mellanox.com; x-originating-ip: [209.116.155.178] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 1496d3ad-ef62-40a3-8c59-08d6cf29c859 x-ms-office365-filtering-ht: Tenant x-microsoft-antispam: BCL:0; PCL:0; RULEID:(2390118)(7020095)(4652040)(8989299)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(5600141)(711020)(4605104)(4618075)(2017052603328)(7193020); SRVR:DB3PR0502MB3979; x-ms-traffictypediagnostic: DB3PR0502MB3979: x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:3383; x-forefront-prvs: 0025434D2D x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(396003)(39860400002)(346002)(376002)(366004)(136003)(199004)(189003)(43544003)(6436002)(6116002)(3846002)(68736007)(14454004)(73956011)(37006003)(91956017)(316002)(54906003)(6862004)(8936002)(6636002)(83716004)(450100002)(4326008)(186003)(71200400001)(71190400001)(66946007)(99286004)(2906002)(66066001)(66476007)(66556008)(66446008)(64756008)(229853002)(26005)(6486002)(5660300002)(76116006)(486006)(305945005)(7736002)(6506007)(82746002)(6246003)(8676002)(53936002)(81166006)(81156014)(14444005)(25786009)(33656002)(102836004)(256004)(6512007)(86362001)(446003)(11346002)(476003)(76176011)(478600001)(36756003)(2616005)(53546011); DIR:OUT; SFP:1101; SCL:1; SRVR:DB3PR0502MB3979; H:DB3PR0502MB3980.eurprd05.prod.outlook.com; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; A:1; MX:1; received-spf: None (protection.outlook.com: mellanox.com does not designate permitted sender hosts) x-ms-exchange-senderadcheck: 1 x-microsoft-antispam-message-info: S7DLZPmCOwC0TmyrdvXKuDaR8110MDTLnktz2h/0DtjCEfv30QANsUgNVCUGFjjpr/RjixHEisduIhnsAUO2leQyDcYveGkfxwdCzEvffEXSDKdWsyAFq9ZNpR3qeYnMxrWcu4sJHvOKhXub6VuUuexQ0wgPwpzPipw+x+8h11x0m9FTWzY+JEkRORp71AIc5bPrjdXp64lRDx22WYWAyVmc2ts/l/judRameYRkKS5BMtwsryd9JnViddi2WNENzLyTUDP8vR5MX5aOHWOpMJB86FA1spsIiziY8Huoef08CM3V9kgq7u9iDHi/vhiCLvd/qtgvHKeEFFV83Ksf1D/WdDMkvp3Bp3nMVao0wvG7pXj/evyJ5eQgqWGCgsf/KPkYM99LkGA1AsXX6vybEekZ4dt9nIUOROiYcH5cIGE= Content-Type: text/plain; charset="UTF-8" Content-ID: <594E70984B6C414CBF949F15FF6CB76A@eurprd05.prod.outlook.com> Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-OriginatorOrg: Mellanox.com X-MS-Exchange-CrossTenant-Network-Message-Id: 1496d3ad-ef62-40a3-8c59-08d6cf29c859 X-MS-Exchange-CrossTenant-originalarrivaltime: 02 May 2019 18:12:48.0123 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: a652971c-7d2e-4d9b-a6a4-d149256f461b X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB3PR0502MB3979 Subject: Re: [dpdk-dev] [PATCH v2 2/4] net/mlx5: fix missing validation of null pointer X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" Message-ID: <20190502181248.RnxSQjdoDCI6ovopLMKhpDaFm0lz2XFF2a_93-ZGBeg@z> > On May 2, 2019, at 8:01 AM, Dekel Peled wrote: >=20 > Function mlx5_rxq_ibv_release() is called in several places. > Before each call except one, the input parameter is validated to make > sure it is not null. >=20 > This patch adds the missing validation where it is missing. >=20 > Fixes: af4f09f28294 ("net/mlx5: prefix all functions with mlx5") > Cc: stable@dpdk.org >=20 > Signed-off-by: Dekel Peled > --- > drivers/net/mlx5/mlx5_rxq.c | 3 ++- > 1 file changed, 2 insertions(+), 1 deletion(-) >=20 > diff --git a/drivers/net/mlx5/mlx5_rxq.c b/drivers/net/mlx5/mlx5_rxq.c > index db8c340..c9c2a14 100644 > --- a/drivers/net/mlx5/mlx5_rxq.c > +++ b/drivers/net/mlx5/mlx5_rxq.c > @@ -617,7 +617,8 @@ > */ > rxq_data =3D (*priv->rxqs)[i]; > rxq_ctrl =3D container_of(rxq_data, struct mlx5_rxq_ctrl, rxq); > - mlx5_rxq_ibv_release(rxq_ctrl->ibv); > + if (rxq_ctrl->ibv) > + mlx5_rxq_ibv_release(rxq_ctrl->ibv); Please take care of two more things. 1) In mlx5_rx_intr_disable(),=20 mlx5_rxq_ibv_get() isn't paired with mlx5_rxq_ibv_release() This would need a separate patch. 2) In mlx5_rx_intr_vec_disable() Please fix the comment having the old name - priv_rx_intr_vec_enable(). This should be mlx5_rx_intr_vec_enable() No need to have a separate patch. You can fix it in this patch. With the change, Acked-by: Yongseok Koh > } > free: > rte_intr_free_epoll_fd(intr_handle); > --=20 > 1.8.3.1 >=20