Received: by 10.213.65.68 with SMTP id h4csp2131735imn; Sun, 8 Apr 2018 20:31:01 -0700 (PDT) X-Google-Smtp-Source: AIpwx4896BU+Vc5xWwoH6AFrS6gs10CNMpMDf6JwHaNJyNvMErAXyDcVWdhKVndkM+25uUPNW2HV X-Received: by 10.98.68.135 with SMTP id m7mr27885518pfi.57.1523244661247; Sun, 08 Apr 2018 20:31:01 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1523244661; cv=none; d=google.com; s=arc-20160816; b=fjiPTwROGffo21OsIIJM/ukSrXuoqprKsnJaCPSUTj1zQySQhU5h/X2nDKMvRbHAHh R7oziILruBF6z3exttfRcNe4zWxB68d03g7pCECu9MVqvplTifEXppGENRpMnwUNXoZG 3GMJQ/NgWd9wWnhOU3hAoCISIYkFfhWDMnke77mhDax7cazlsK+0jvMHoc1kjdoYoxoU GBWGZo5SliTPsQkaq7NcluYzN7alOJI3fXQrz69mhYfhPI3P0ozMjIandoCXKpXTSiJb p3ZUNktHOz/6TnNMacJcxDSkczKQWJolyzPjWhDJumVylaz2X05U6Tk3HVkFOiUcpr49 ORGw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:content-transfer-encoding :spamdiagnosticmetadata:spamdiagnosticoutput:content-language :accept-language:in-reply-to:references:message-id:date:thread-index :thread-topic:subject:cc:to:from:dkim-signature :arc-authentication-results; bh=eiskCYjjoa64bvej4scXpvFJvoTeRxBwtJOuMAuGAaE=; b=BxnDdXlK5CPLeu2Hc67zYpFJh00CLFT4mY1tGtVBalriuiURtTEuIlZc7T69bTI6ML XyVHymUCl7nubgWpchCg9uNgco+M1X62d+usoR7AdocDwFuwoR43sWcgrwk/cUTCKdNJ cX6/205sS9AWQ71UerwIDFNi0x88Lc0wDqlPz7GnSzrUPmtNUbAqSBnzaBA6CSqPVZ30 cFs/SXmjkM4J0DVP2PMTHX1aS8Qym8ad7zO4TErrHNqikTlbAHTjXjg54mjkNPLloH7W JlR201g+SmzNS3n0eb+uTLroEAbiB6EGiy0imwimQKJb8ENOjNB4L8K51skc97QIS0A/ L07g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@microsoft.com header.s=selector1 header.b=IzRl46yF; 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; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=microsoft.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 2si11778546pfk.291.2018.04.08.20.30.24; Sun, 08 Apr 2018 20:31:01 -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; dkim=pass header.i=@microsoft.com header.s=selector1 header.b=IzRl46yF; 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; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=microsoft.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754308AbeDIDZy (ORCPT + 99 others); Sun, 8 Apr 2018 23:25:54 -0400 Received: from mail-sn1nam01on0122.outbound.protection.outlook.com ([104.47.32.122]:20813 "EHLO NAM01-SN1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1753280AbeDIAWk (ORCPT ); Sun, 8 Apr 2018 20:22:40 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=eiskCYjjoa64bvej4scXpvFJvoTeRxBwtJOuMAuGAaE=; b=IzRl46yF4+M88rt5tHBZy9uwoe4MoJ6TYh/7gY8K54SAzqGyxar2M3DC711pU2mXknraI9Dsko5tK0/3eWTbpvtLTM62UneGVm2qDmwY9aUySdeAm/eM6WdJkQQlRnf2nawokgK0YR6+9v3AcBpsmgGe5klAd3h9czXOEdnI7wY= Received: from DM5PR2101MB1032.namprd21.prod.outlook.com (52.132.128.13) by DM5PR2101MB0966.namprd21.prod.outlook.com (52.132.133.24) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.696.0; Mon, 9 Apr 2018 00:22:38 +0000 Received: from DM5PR2101MB1032.namprd21.prod.outlook.com ([fe80::8109:aef0:a777:7059]) by DM5PR2101MB1032.namprd21.prod.outlook.com ([fe80::8109:aef0:a777:7059%2]) with mapi id 15.20.0696.003; Mon, 9 Apr 2018 00:22:38 +0000 From: Sasha Levin To: "stable@vger.kernel.org" , "linux-kernel@vger.kernel.org" CC: Shiraz Saleem , Jason Gunthorpe , Sasha Levin Subject: [PATCH AUTOSEL for 4.14 022/161] i40iw: Zero-out consumer key on allocate stag for FMR Thread-Topic: [PATCH AUTOSEL for 4.14 022/161] i40iw: Zero-out consumer key on allocate stag for FMR Thread-Index: AQHTz5h+C9Zgf5NizUWQQq0nydOBLg== Date: Mon, 9 Apr 2018 00:19:58 +0000 Message-ID: <20180409001936.162706-22-alexander.levin@microsoft.com> References: <20180409001936.162706-1-alexander.levin@microsoft.com> In-Reply-To: <20180409001936.162706-1-alexander.levin@microsoft.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [52.168.54.252] x-ms-publictraffictype: Email x-microsoft-exchange-diagnostics: 1;DM5PR2101MB0966;7:51piHkjzHUFTZOdau/X5G4TW1s43v6Ap9DRdTbfZXZDv91DJpzwdxmq90pHrrIxGjQWpF3CnwMVIc7q+ISDAcW9hokWiGfEnzSNe26On9U1FlaypjqWbjA4RdeGcEBSLLJIM7z1iVaoZmXbC//FJVEHOdnhOdaRDk/L8CFyksRAA1fVTyBPlLXyKGiIT2gCeEPGctMYTczf52troenVTYT8JVZhrGjkiR+UI47Kv7Xq6XKOs1NVMdi1425WhKH2H;20:DjvPMD/RaAa7bTdFvLpvhS3DWIC3wPCDnIR69M1RQFNB3nz5pdmQTpMyaLWlByCF6vi86KCLSSQAxi3GE8KXNq1lEkpVZukYE8bNXDYUhDSERKGCyT+lfH6a4PfGhGT53OonTXoSX+I6N2jkciklje0UckzmMJ+G+822oi06s/I= x-ms-office365-filtering-ht: Tenant X-MS-Office365-Filtering-Correlation-Id: df0d12ee-1be0-47b3-b364-08d59db00041 x-microsoft-antispam: UriScan:;BCL:0;PCL:0;RULEID:(7020095)(4652020)(48565401081)(5600026)(4604075)(3008032)(4534165)(4627221)(201703031133081)(201702281549075)(2017052603328)(7193020);SRVR:DM5PR2101MB0966; x-ms-traffictypediagnostic: DM5PR2101MB0966: authentication-results: spf=none (sender IP is ) smtp.mailfrom=Alexander.Levin@microsoft.com; x-microsoft-antispam-prvs: x-exchange-antispam-report-test: UriScan:(28532068793085)(89211679590171)(228905959029699); x-exchange-antispam-report-cfa-test: BCL:0;PCL:0;RULEID:(8211001083)(61425038)(6040522)(2401047)(5005006)(8121501046)(93006095)(93001095)(3231221)(944501327)(52105095)(3002001)(10201501046)(6055026)(61426038)(61427038)(6041310)(20161123558120)(20161123562045)(20161123560045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123564045)(6072148)(201708071742011);SRVR:DM5PR2101MB0966;BCL:0;PCL:0;RULEID:;SRVR:DM5PR2101MB0966; x-forefront-prvs: 0637FCE711 x-forefront-antispam-report: SFV:NSPM;SFS:(10019020)(376002)(346002)(39860400002)(39380400002)(396003)(366004)(199004)(189003)(6512007)(316002)(6436002)(186003)(6666003)(2900100001)(8936002)(486006)(6486002)(6506007)(10290500003)(81166006)(22452003)(25786009)(1076002)(81156014)(53936002)(106356001)(10090500001)(5250100002)(107886003)(102836004)(76176011)(8676002)(66066001)(2501003)(446003)(476003)(36756003)(99286004)(478600001)(86362001)(72206003)(2616005)(68736007)(5660300001)(305945005)(3846002)(6116002)(26005)(86612001)(14454004)(97736004)(3660700001)(4326008)(2906002)(110136005)(54906003)(3280700002)(105586002)(7736002)(11346002)(22906009)(217873001);DIR:OUT;SFP:1102;SCL:1;SRVR:DM5PR2101MB0966;H:DM5PR2101MB1032.namprd21.prod.outlook.com;FPR:;SPF:None;LANG:en;PTR:InfoNoRecords;A:1;MX:1; received-spf: None (protection.outlook.com: microsoft.com does not designate permitted sender hosts) x-microsoft-antispam-message-info: sI+Ht+0BnBj+j7kobO0+n3VAX7i+Efz1JSuEFAj0ScYLUbxHRDxd2lM1NUapdlxYWQPMb5zGfZ1Xol+fkhYNpJcbVK1dXHxs4UbA11XSoRQmblpGVLmVIC0OeZqG6B/W413ZuaKv0Onqvn2KsNJZ+y3GDstJaw1N20hdmCP0H3OUX9v5ExFy6Kqy1cxrRuRRQ0xET51E25IxMR8lbqyLdTzp7PMwYUfoZ8/yYsL/j4JRar6SooarWG7HZSfJvehtiLcDdIe4vmielgxsxBN14h4+g1x+zRpxFP7dGLNkShNeKnKIlOOkse4LmNvw1DZ3ASoI8jdUweMJ3M/AkbcNWjQwLUC34rcoHGsffcYkSqQq22PIlw8vgebCSKQ065yBruIoNkZPadjKQR+d79QtIRbcW/mHpEMcrlTHNe482Pk= spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-OriginatorOrg: microsoft.com X-MS-Exchange-CrossTenant-Network-Message-Id: df0d12ee-1be0-47b3-b364-08d59db00041 X-MS-Exchange-CrossTenant-originalarrivaltime: 09 Apr 2018 00:19:58.9730 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 72f988bf-86f1-41af-91ab-2d7cd011db47 X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM5PR2101MB0966 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 --- drivers/infiniband/hw/i40iw/i40iw_verbs.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/infiniband/hw/i40iw/i40iw_verbs.c b/drivers/infiniband= /hw/i40iw/i40iw_verbs.c index 9e7ae7161d2f..b7961f21b555 100644 --- 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(struct ib_pd *pd, err_code =3D -EOVERFLOW; goto err; } + stag &=3D ~I40IW_CQPSQ_STAG_KEY_MASK; iwmr->stag =3D stag; iwmr->ibmr.rkey =3D stag; iwmr->ibmr.lkey =3D stag; --=20 2.15.1