Received: by 10.213.65.68 with SMTP id h4csp2119695imn; Sun, 8 Apr 2018 20:11:30 -0700 (PDT) X-Google-Smtp-Source: AIpwx4923xZxbYTresGbQP3D6AgziXhHIyC2aLE2qnpi5gy0ZJ3RHcZ4hWHUpkKopkpws2zGmJmS X-Received: by 2002:a17:902:7d8a:: with SMTP id a10-v6mr13857990plm.268.1523243413040; Sun, 08 Apr 2018 20:10:13 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1523243412; cv=none; d=google.com; s=arc-20160816; b=g6BSSfnZByUUB1X6daF4CBSz9D0IpJDI95zNoDP5R/6XBa9JlE9xvG0ZGJzQCd5tau x75jt2jC+jUePHylXiPEJ/KPt6t6W6ke6KHRu1HJgL8086oR+OXNJCDXTSVRbmKBziiW wwwLeFVq2ZpQBRjfcQMH1qjRsd9aECnpIhed0q7BxqSevMUnLYPl53lWcXLqCpGFerlL Gf8j90vO4Fp6ZVaTz5Cgh5L06VjTOZO0UtWXRI5iDqPetaiApb1hRoAjJwVFjvkaQS2F YSZwZTZR/cA1RkpEEkwp4WsSyW6I8Exp9ffGhskleM9++yWZRb6fUv859gAnT6iX/zBm 3wBA== 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=9sTMgBD6p0LrxnIG3Zyuxa2k3+ks4pVp37RsZ0wazRU=; b=jF/OcT0rlVaq3rd4hbJhV1E+0MDqCZuRDGPZPkqacCuQQebGtjp3CmH6FDCQ7B5tBA b15NzUmpvadNDYExGS07dP/aGCOFNhahTN3HLXd3xiajX2WyglShs7kboKXHf3W23Wkt nqXSd6nyg8Qy3bbzU1qzFu3kgL3K60pctMe5Nrr7A/Ck8xktuwnQEaxnbHmh58VPOBvL 8k+gfn49MFS5akN4BzAbhZCFLnHRJ8JDIkuMB1N5DGTMHUrUx5CvPf76n0pbCNGInaSp F8izDP7R1cjUw+Rm1nYVfTMh1ySPzk5TkZj8YuQlQGKkFpVkD2Riq34Xop01AOAoAfSv NxPQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@microsoft.com header.s=selector1 header.b=SjwvQzy2; 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 f5si10282003pgv.668.2018.04.08.20.09.36; Sun, 08 Apr 2018 20:10:12 -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=SjwvQzy2; 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 S932932AbeDIB4f (ORCPT + 98 others); Sun, 8 Apr 2018 21:56:35 -0400 Received: from mail-by2nam01on0100.outbound.protection.outlook.com ([104.47.34.100]:61248 "EHLO NAM01-BY2-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S932164AbeDIAcy (ORCPT ); Sun, 8 Apr 2018 20:32:54 -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=9sTMgBD6p0LrxnIG3Zyuxa2k3+ks4pVp37RsZ0wazRU=; b=SjwvQzy2H0gF3GzJ+cun0cNXsjy1WB95ysMmWl5cmeNL2pJWCsdBN5m5TD85oRjsXRR1mZfQ3QMVZ/+v0rZ9f3yMN5YprWGC3pS8Gn7APyNJ0IsCveJIXonxJBDHT37/HcuPXIpiKmxGON8lQeDPiUEFpgLtvZLeNO2duJlLwY4= Received: from DM5PR2101MB1032.namprd21.prod.outlook.com (52.132.128.13) by DM5PR2101MB0998.namprd21.prod.outlook.com (52.132.133.32) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.696.0; Mon, 9 Apr 2018 00:32:51 +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:32:51 +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.9 220/293] i40iw: Zero-out consumer key on allocate stag for FMR Thread-Topic: [PATCH AUTOSEL for 4.9 220/293] i40iw: Zero-out consumer key on allocate stag for FMR Thread-Index: AQHTz5lNHcOfFeAsfUSBa5vxRe6UKw== Date: Mon, 9 Apr 2018 00:25:45 +0000 Message-ID: <20180409002239.163177-220-alexander.levin@microsoft.com> References: <20180409002239.163177-1-alexander.levin@microsoft.com> In-Reply-To: <20180409002239.163177-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;DM5PR2101MB0998;7:c5iOdaacU6FzrNxIM4j7gCqKnHqc4HgHX3F1rjwSbQ6gP3V6DTt3d1jLLZh49axPuGzuVKCDQPBP6KHJqEIMvorRJQjhY+xk3/FIt+peBxhvr11UCIc66QPO6t3ImGrzQxLSiIPSWFWOronQPvr6xSEFcwAcSAHVUl3MscmKvR2pPgvikxl7Tfl15uqWREhoTtvFW59e6qnsG7SUhuv5TRRUH2Ck6czFK9LV9zZi4vKB0RpxB2QQUogAFv3w5JBG;20:rWY8Bt489JrvKqdGOg8zaVA4vBsMqTwkjvZgnTJuaLzFIlQAr541apFai7e9H49B/mG8xOs5ypLz/E2NFeWHY+FkpvtxQMJAyPI/nEXZWOqzR0tWDtU4YqzX3gB2C53n1QFU8kW6hdSmjCtC8ltjcPaNhOgMoh0/C59CcTHyuos= x-ms-office365-filtering-ht: Tenant X-MS-Office365-Filtering-Correlation-Id: 155d4e73-380f-4837-1c59-08d59db16d92 x-microsoft-antispam: UriScan:;BCL:0;PCL:0;RULEID:(7020095)(4652020)(48565401081)(5600026)(4604075)(3008032)(4534165)(4627221)(201703031133081)(201702281549075)(2017052603328)(7193020);SRVR:DM5PR2101MB0998; x-ms-traffictypediagnostic: DM5PR2101MB0998: 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:DM5PR2101MB0998;BCL:0;PCL:0;RULEID:;SRVR:DM5PR2101MB0998; x-forefront-prvs: 0637FCE711 x-forefront-antispam-report: SFV:NSPM;SFS:(10019020)(346002)(39380400002)(376002)(396003)(366004)(39860400002)(189003)(199004)(25786009)(105586002)(14454004)(76176011)(68736007)(2906002)(316002)(97736004)(8676002)(86612001)(3660700001)(3280700002)(102836004)(6116002)(4326008)(8936002)(36756003)(22452003)(81166006)(81156014)(54906003)(6506007)(10090500001)(2501003)(6512007)(186003)(6666003)(3846002)(486006)(5660300001)(26005)(7736002)(5250100002)(305945005)(99286004)(2900100001)(110136005)(1076002)(6436002)(53936002)(106356001)(107886003)(72206003)(86362001)(476003)(446003)(66066001)(11346002)(478600001)(10290500003)(2616005)(6486002)(22906009)(217873001);DIR:OUT;SFP:1102;SCL:1;SRVR:DM5PR2101MB0998;H:DM5PR2101MB1032.namprd21.prod.outlook.com;FPR:;SPF:None;LANG:en;PTR:InfoNoRecords;MX:1;A:1; received-spf: None (protection.outlook.com: microsoft.com does not designate permitted sender hosts) x-microsoft-antispam-message-info: sps85xyAOefE5y4SeOaA6EsuW7ijX3ZX47odO9FjVkY00PcQMpsUIpJ76+vj1pCmFUc+gL3rhuyy+4paUF2Y+z2+kUF3y2mGKh69kcrpmLOaeG3tMKF3NnQQclHhJssC8cKiotvr7M6f7uIMiEX05fDza3zv2inN9bW15vvKB9NW3gdgCJEAqRe7sdneqaZVrrgd18WZEinX8fTS0CuU78qRXVIW9gDlp0SO04G9WRYH+OCouNoi72LL4xiVOr217spSF2CqTr6yRJJwd6QKGmCaZMJzS4TjZcgFrmnQ1jXR+FpKZqQa1c83msOyytc1R9i2oq24Dns7ZcYqVswQex9A1OazHKNvT4U72G+4IsPZ8Qafh2rh4aaF3gJoo8w2CR6OLqdU+A2ifaJOVu6/5HOjTocV1dqYZxOz0QT5qNU= 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: 155d4e73-380f-4837-1c59-08d59db16d92 X-MS-Exchange-CrossTenant-originalarrivaltime: 09 Apr 2018 00:25:45.9722 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 72f988bf-86f1-41af-91ab-2d7cd011db47 X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM5PR2101MB0998 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 4b892ca2b13a..095912fb3201 100644 --- a/drivers/infiniband/hw/i40iw/i40iw_verbs.c +++ b/drivers/infiniband/hw/i40iw/i40iw_verbs.c @@ -1515,6 +1515,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