From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail.linuxfoundation.org ([140.211.169.12]:34193 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752483AbcHRMoh (ORCPT ); Thu, 18 Aug 2016 08:44:37 -0400 Subject: Patch "IB/mlx5: Fix entries check in mlx5_ib_resize_cq" has been added to the 4.4-stable tree To: noaos@mellanox.com, dledford@redhat.com, gregkh@linuxfoundation.org, leon@kernel.org, majd@mellanox.com Cc: , From: Date: Thu, 18 Aug 2016 14:44:19 +0200 Message-ID: <1471524259180224@kroah.com> MIME-Version: 1.0 Content-Type: text/plain; charset=ANSI_X3.4-1968 Content-Transfer-Encoding: 8bit Sender: stable-owner@vger.kernel.org List-ID: This is a note to let you know that I've just added the patch titled IB/mlx5: Fix entries check in mlx5_ib_resize_cq to the 4.4-stable tree which can be found at: http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary The filename of the patch is: ib-mlx5-fix-entries-check-in-mlx5_ib_resize_cq.patch and it can be found in the queue-4.4 subdirectory. If you, or anyone else, feels it should not be added to the stable tree, please let know about it. >>From 3c4c37746c919c983e439ac6a7328cd2d48c10ed Mon Sep 17 00:00:00 2001 From: Noa Osherovich Date: Sat, 4 Jun 2016 15:15:35 +0300 Subject: IB/mlx5: Fix entries check in mlx5_ib_resize_cq From: Noa Osherovich commit 3c4c37746c919c983e439ac6a7328cd2d48c10ed upstream. Verify that number of entries is less than device capability. Add an appropriate warning message for error flow. Fixes: bde51583f49b ('IB/mlx5: Add support for resize CQ') Signed-off-by: Majd Dibbiny Signed-off-by: Noa Osherovich Signed-off-by: Leon Romanovsky Signed-off-by: Doug Ledford Signed-off-by: Greg Kroah-Hartman --- drivers/infiniband/hw/mlx5/cq.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) --- a/drivers/infiniband/hw/mlx5/cq.c +++ b/drivers/infiniband/hw/mlx5/cq.c @@ -1095,11 +1095,16 @@ int mlx5_ib_resize_cq(struct ib_cq *ibcq return -ENOSYS; } - if (entries < 1) + if (entries < 1 || + entries > (1 << MLX5_CAP_GEN(dev->mdev, log_max_cq_sz))) { + mlx5_ib_warn(dev, "wrong entries number %d, max %d\n", + entries, + 1 << MLX5_CAP_GEN(dev->mdev, log_max_cq_sz)); return -EINVAL; + } entries = roundup_pow_of_two(entries + 1); - if (entries > (1 << MLX5_CAP_GEN(dev->mdev, log_max_cq_sz)) + 1) + if (entries > (1 << MLX5_CAP_GEN(dev->mdev, log_max_cq_sz)) + 1) return -EINVAL; if (entries == ibcq->cqe + 1) Patches currently in stable-queue which might be from noaos@mellanox.com are queue-4.4/ib-mlx5-fix-returned-values-of-query-qp.patch queue-4.4/ib-mlx5-return-port_err-in-active-to-initializing-tranisition.patch queue-4.4/ib-mlx5-fix-entries-checks-in-mlx5_ib_create_cq.patch queue-4.4/ib-mlx5-fix-entries-check-in-mlx5_ib_resize_cq.patch queue-4.4/ib-mlx5-check-blueflame-hca-support.patch