From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail.linuxfoundation.org ([140.211.169.12]:34094 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753967AbcHRMnZ (ORCPT ); Thu, 18 Aug 2016 08:43:25 -0400 Subject: Patch "IB/mlx5: Fix entries checks in mlx5_ib_create_cq" has been added to the 3.14-stable tree To: noaos@mellanox.com, dledford@redhat.com, gregkh@linuxfoundation.org, leon@kernel.org, majd@mellanox.com, sagi@grimberg.me Cc: , From: Date: Thu, 18 Aug 2016 14:43:24 +0200 Message-ID: <1471524204201248@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 checks in mlx5_ib_create_cq to the 3.14-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-checks-in-mlx5_ib_create_cq.patch and it can be found in the queue-3.14 subdirectory. If you, or anyone else, feels it should not be added to the stable tree, please let know about it. >>From 9ea578528656e191c1097798a771ff08bab6f323 Mon Sep 17 00:00:00 2001 From: Noa Osherovich Date: Sat, 4 Jun 2016 15:15:34 +0300 Subject: IB/mlx5: Fix entries checks in mlx5_ib_create_cq From: Noa Osherovich commit 9ea578528656e191c1097798a771ff08bab6f323 upstream. Number of entries shouldn't be greater than the device's max capability. This should be checked before rounding the entries number to power of two. Fixes: 51ee86a4af639 ('IB/mlx5: Fix check of number of entries...') Signed-off-by: Majd Dibbiny Signed-off-by: Noa Osherovich Signed-off-by: Leon Romanovsky Reviewed-by: Sagi Grimberg Signed-off-by: Doug Ledford Signed-off-by: Greg Kroah-Hartman --- drivers/infiniband/hw/mlx5/cq.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) --- a/drivers/infiniband/hw/mlx5/cq.c +++ b/drivers/infiniband/hw/mlx5/cq.c @@ -686,7 +686,8 @@ struct ib_cq *mlx5_ib_create_cq(struct i int eqn; int err; - if (entries < 0) + if (entries < 0 || + (entries > (1 << MLX5_CAP_GEN(dev->mdev, log_max_cq_sz)))) return ERR_PTR(-EINVAL); entries = roundup_pow_of_two(entries + 1); Patches currently in stable-queue which might be from noaos@mellanox.com are queue-3.14/ib-mlx5-fix-returned-values-of-query-qp.patch queue-3.14/ib-mlx5-fix-entries-checks-in-mlx5_ib_create_cq.patch