Received: by 10.192.165.148 with SMTP id m20csp573049imm; Wed, 25 Apr 2018 04:30:13 -0700 (PDT) X-Google-Smtp-Source: AB8JxZpzlNbheTZ6ENYpzGditoMLGoWybUSyH/gjRZAMZ0KP81qElnV9sTMWo0uDx9GsqNZ/6ANS X-Received: by 10.101.67.9 with SMTP id j9mr4315703pgq.375.1524655813101; Wed, 25 Apr 2018 04:30:13 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1524655813; cv=none; d=google.com; s=arc-20160816; b=jFLH6uyM4zGe4MdArliFeZWy3T9Cb9yCscPAoAmLSXchq7vbt9H9M5OT8cgsTjlPj7 3d68WNPteSTheqQ0oA4pbM+tv4Vyy7VZFjq7hZ3W2a8/ja0anlSGeS/9sE0cxE/sQO8h qSc4+BRZ2KxQUWwnhRCCEpTVOnsjm5r5hURJbZGou9lXiTTCEToGFhbXO96ZEUxdFUaK ePfquV8MbLINKagbHmjUO8eFkBSi6nmxYYsoMNjCd2YMbvEa5CQJFd3A1nJQUjJYB5zm 2oV4lz0KOtLg8wmIc5AoUz3dFNGH6dbV5qhdAyYx8toxHrgHt8iSMb9zC/LHwASM6o/X mtZg== 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=ZDyjofpxS2kCWElhh/Jr9Q325T9i30T1iyaxVbaCoMc=; b=sd9tVwFhdwsTfbQmZwEFG49BaTO9LedrgBlLFKlVUSYT9xwy4KdORuzjXCDlowROy8 BpYs4Y9XO9LAbKvq9mmPzqlUGBwObrvVVVjc9qcvQfuy9/2pcrFKYd0F/VxXQAEBLlvd 14ouCNSY61e8upl+ytdaFOnJLClHtRTzTFwAdFten9S188yFTwzJe1VMP101pepK1plr ftD2W+nRTVCxhwuPcJLg3rOjge4UPDhDDTqbBFXZVDxhw6CMAv+ab/dxg5i8ShXrvR6G EPhrHax9vU84DBiRymyPfE1xScFn7H0SLnA4cXuP6q9RSCwFPWbl1fT7e0ElZQMsee4o /lUw== 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 d3-v6si1992572pll.184.2018.04.25.04.29.58; Wed, 25 Apr 2018 04:30:13 -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 S1753862AbeDYL25 (ORCPT + 99 others); Wed, 25 Apr 2018 07:28:57 -0400 Received: from mail.linuxfoundation.org ([140.211.169.12]:51326 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753423AbeDYKiQ (ORCPT ); Wed, 25 Apr 2018 06:38:16 -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 190C84A3; Wed, 25 Apr 2018 10:38:14 +0000 (UTC) From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Shiraz Saleem , Jason Gunthorpe , Sasha Levin Subject: [PATCH 4.14 036/183] i40iw: Zero-out consumer key on allocate stag for FMR Date: Wed, 25 Apr 2018 12:34:16 +0200 Message-Id: <20180425103244.032341402@linuxfoundation.org> X-Mailer: git-send-email 2.17.0 In-Reply-To: <20180425103242.532713678@linuxfoundation.org> References: <20180425103242.532713678@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.14-stable review patch. If anyone has any objections, please let me know. ------------------ From: Shiraz Saleem [ Upstream commit 6376e926af1a8661dd1b2e6d0896e07f84a35844 ] If the application invalidates the MR before the FMR WR, HW parses the consumer key portion of the stag and returns an invalid stag key Asynchronous Event (AE) that tears down the QP. Fix this by zeroing-out the consumer key portion of the allocated stag returned to application for FMR. Fixes: ee855d3b93f3 ("RDMA/i40iw: Add base memory management extensions") Signed-off-by: Shiraz Saleem Signed-off-by: Jason Gunthorpe Signed-off-by: Sasha Levin Signed-off-by: Greg Kroah-Hartman --- drivers/infiniband/hw/i40iw/i40iw_verbs.c | 1 + 1 file changed, 1 insertion(+) --- a/drivers/infiniband/hw/i40iw/i40iw_verbs.c +++ b/drivers/infiniband/hw/i40iw/i40iw_verbs.c @@ -1656,6 +1656,7 @@ static struct ib_mr *i40iw_alloc_mr(stru err_code = -EOVERFLOW; goto err; } + stag &= ~I40IW_CQPSQ_STAG_KEY_MASK; iwmr->stag = stag; iwmr->ibmr.rkey = stag; iwmr->ibmr.lkey = stag;