Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp2050896imm; Mon, 16 Jul 2018 00:57:47 -0700 (PDT) X-Google-Smtp-Source: AAOMgpfRlSLZqzVP0yCiy1prwQN+7/o33tgrJYQqCLEMEi/kIfyTuJEf1aNXMISuJrb7w5D+PYN/ X-Received: by 2002:a63:1403:: with SMTP id u3-v6mr14559187pgl.13.1531727867034; Mon, 16 Jul 2018 00:57:47 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1531727867; cv=none; d=google.com; s=arc-20160816; b=Yj2sod6w0qKAjTOPxnUYY4P71Pp9XsyqaY2d4nqI1pBpXIn+6Kaa+nfncweIWjvdMn xQTLcluFUT8o8kbw+jFmSbA1BSy94Q0rRbaGg+YaCy75rl4KVXmO7Z1vofSsU5Dup5xg rOgqF+O0hNcaW2TqS/Qggh9/OiXYTTRI4DyzgL9jpKp+Ew5bQd0CEYFxjmBLdkc/S7WY n/v7xydzemswANgQzV2pEpUKxz0BhNgjc+DRqSjhXbXfykEJwds4IGlT/COqmLHdjAfB BRdgJjwSLRKEPFF9meey0WzcAWDackQn8M8yHGfgsA1nZy1gdpFXpc4v5N+s/robgdE0 PiBg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:references :in-reply-to:message-id:date:subject:cc:to:from :arc-authentication-results; bh=oV96Yf11EiJKeRn3iRkmpVL7rwGTMy44vs/8QNcNRpo=; b=n4OO7bkBh0K0Q+pB/1HL/B6NHdnor4E8lXWqAXLwJpKV5PmF993ZkAayTOCJo1Q0vC ajyRZhMwBcp+jRU3m0WDdofqPG880ysx4oROjNVoYssuKr3SzaNpylE/cTObOe93aWEB UJBsEl9PclF66pXWTJsyuygL/lHSWUyfc9xoxR3TMUtIWoAzlxRmog226FSZHKwJZ/dd 1DjC0JJO/TJQMKIehN5BjObbMUZFY/BKViUZLQDfpq1EnIHYPRGa48QipI9rAMrXeSqQ tt8Qc1jyP5J+d/ld6k8yiPdy+eTg0H94GWedthDE5FHkitn6tBZSloPGKBVvqnXGnB1J j37w== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id y8-v6si18016091pfk.75.2018.07.16.00.57.32; Mon, 16 Jul 2018 00:57:47 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2387873AbeGPIFL (ORCPT + 99 others); Mon, 16 Jul 2018 04:05:11 -0400 Received: from mail.linuxfoundation.org ([140.211.169.12]:47068 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726898AbeGPIFK (ORCPT ); Mon, 16 Jul 2018 04:05:10 -0400 Received: from localhost (LFbn-1-12247-202.w90-92.abo.wanadoo.fr [90.92.61.202]) by mail.linuxfoundation.org (Postfix) with ESMTPSA id 98274C03; Mon, 16 Jul 2018 07:39:08 +0000 (UTC) From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Steve Wise , Jason Gunthorpe Subject: [PATCH 4.17 48/67] iw_cxgb4: correctly enforce the max reg_mr depth Date: Mon, 16 Jul 2018 09:35:17 +0200 Message-Id: <20180716073450.825402381@linuxfoundation.org> X-Mailer: git-send-email 2.18.0 In-Reply-To: <20180716073443.294323458@linuxfoundation.org> References: <20180716073443.294323458@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 4.17-stable review patch. If anyone has any objections, please let me know. ------------------ From: Steve Wise commit 7b72717a20bba8bdd01b14c0460be7d15061cd6b upstream. The code was mistakenly using the length of the page array memory instead of the depth of the page array. This would cause MR creation to fail in some cases. Fixes: 8376b86de7d3 ("iw_cxgb4: Support the new memory registration API") Cc: stable@vger.kernel.org Signed-off-by: Steve Wise Signed-off-by: Jason Gunthorpe Signed-off-by: Greg Kroah-Hartman --- drivers/infiniband/hw/cxgb4/mem.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) --- a/drivers/infiniband/hw/cxgb4/mem.c +++ b/drivers/infiniband/hw/cxgb4/mem.c @@ -774,7 +774,7 @@ static int c4iw_set_page(struct ib_mr *i { struct c4iw_mr *mhp = to_c4iw_mr(ibmr); - if (unlikely(mhp->mpl_len == mhp->max_mpl_len)) + if (unlikely(mhp->mpl_len == mhp->attr.pbl_size)) return -ENOMEM; mhp->mpl[mhp->mpl_len++] = addr;