Received: by 10.213.65.68 with SMTP id h4csp2111785imn; Sun, 8 Apr 2018 20:01:14 -0700 (PDT) X-Google-Smtp-Source: AIpwx49bsQNCzhyYdaDLFDYZY2qLOPuj3SurzMjqwB/CVRiR3U+jEIw6JAlR1WAN8e/vpJYn8oLC X-Received: by 10.99.185.28 with SMTP id z28mr24204541pge.59.1523242874097; Sun, 08 Apr 2018 20:01:14 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1523242874; cv=none; d=google.com; s=arc-20160816; b=ncHMxdRaI2zxIGMrvowRMc3TA4N3ffaaqrEgrxW1b35UrAFrTJMkG3FvyvB8eVTdox 02z2Jr+mrwaejf6u9/LFGcZ+qLMFMnFtkqynle1ikXAl4Wpqb2gZKWr6mVDvcOGSCkqA Va7o+A8vjCR5MSVwsS7U0DiRpxnUFxXcWzWeGz7MA9wmsC1CCwgC1xPc6eCQvf5t2E69 JaYL1zErqwqhcX1FYgkVYLIL9evKVxR6Xjnldk6fzxm+Bv8Eb9hNIAzg6kwxQ/NPvADR 1ZHdcMy9hxvZiMkiLA1f85IXmums+WIObqZdLgIelrTLgW/BhfER2zXGfLqTXUoPS8G6 lYAQ== 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=uRQXRpXp7V8rtQBlpI2pqmQFBvKlWbWInMl0xtyac+s=; b=xOOG2pL5LjpeoyXpNpjgR6aOh2hbjMjBrLBboiEcfVmHLB3+NU6JAvZuS1piiIlExn iePfZAESxbE2JfMaPMf9Ojztx4yYogW9BU3ns4+Z3G22vdoAIFDVRZl/INqherAkYPKA lYxnbJIPbvTRXHbq/xFcUCOtDFZz687+D1JOKgjky4g3x3wq6nVRH4MM6Lm1CQN/vIpV 3ALgfPWIXtTjcOJ937KRuwMhO9ulczLcPVKfizG0TkbiKMIolKN3Sp+DI//B9jliogLT M5h0xsdrQ7S6WRs6BXSd49pVGCm62UBQAndtUggAGikzi9WSwt2Fvg/BtxVcKixi4Mku yJNw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@microsoft.com header.s=selector1 header.b=HiMJnEWD; 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 h13si9720662pfi.192.2018.04.08.20.00.36; Sun, 08 Apr 2018 20:01:14 -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=HiMJnEWD; 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 S1753159AbeDIARY (ORCPT + 99 others); Sun, 8 Apr 2018 20:17:24 -0400 Received: from mail-co1nam03on0128.outbound.protection.outlook.com ([104.47.40.128]:49080 "EHLO NAM03-CO1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1753093AbeDIARM (ORCPT ); Sun, 8 Apr 2018 20:17:12 -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=uRQXRpXp7V8rtQBlpI2pqmQFBvKlWbWInMl0xtyac+s=; b=HiMJnEWD2M4JBnAFwiJNUwlkHcxu5Ynt5Mbr6tt+JUs30EGP4fJDR59x0n4SqDxAmXIS781ZtiiEEOdm8WItmKMRe/Ir0kFUq34lD+kU/xtL5nH/zWv0rSn8M3pZ0z/jP99WkR9j46h/rUd0X3OhB+tptPjO9pYSJdu8RTAxu3k= Received: from DM5PR2101MB1032.namprd21.prod.outlook.com (52.132.128.13) by DM5PR2101MB1127.namprd21.prod.outlook.com (52.132.132.167) 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:17:06 +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:17:06 +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.15 026/189] i40iw: Zero-out consumer key on allocate stag for FMR Thread-Topic: [PATCH AUTOSEL for 4.15 026/189] i40iw: Zero-out consumer key on allocate stag for FMR Thread-Index: AQHTz5gX56rI7sxIqUusLQ2/V1xvhw== Date: Mon, 9 Apr 2018 00:17:06 +0000 Message-ID: <20180409001637.162453-26-alexander.levin@microsoft.com> References: <20180409001637.162453-1-alexander.levin@microsoft.com> In-Reply-To: <20180409001637.162453-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;DM5PR2101MB1127;7:oNNYfT0A1ptdhrG7Yv9w1odrrUBkB5L4UhOA+3DIdRaCtHYFYQqsBmfG4LTYUth7Ve/A/Yap3eq3rfGOZnC8sLf4Rj5axNZhxuyPv3zVqlXXujdPhjJ17//LlHXCurdLwKlpCbyxTXZ7rEyTj6bWAkdNkcgdgMllgMtEfIlU1Co4SOo3f5izNo+Lg0fzlTWiN5K//yTs60oumSYvka55kYvl/9E9GvFpD/rEiumBfl4hutzLio9qFZSH/zEvSGgt;20:Ka3x0In3xroZgSrR1qPoi5SmG4rg0+ezwTEjaB0+W0qbOq6mafx5NOyhBXAC5hCFOVh4+kjh2wPlp49X4DX8W8509zlP42Opl1UuF3Ezq1eIb3epAM0SxG6fGK/N3PIhjIOePaPhxGlsiULF/y2AIyafUQd5hk1N4SmP6Zd3tHQ= x-ms-exchange-antispam-srfa-diagnostics: SOS; x-ms-office365-filtering-ht: Tenant X-MS-Office365-Filtering-Correlation-Id: aaebc583-a2df-4272-ff58-08d59daf3a34 x-microsoft-antispam: UriScan:;BCL:0;PCL:0;RULEID:(7020095)(4652020)(48565401081)(5600026)(4604075)(3008032)(4534165)(4627221)(201703031133081)(201702281549075)(2017052603328)(7193020);SRVR:DM5PR2101MB1127; x-ms-traffictypediagnostic: DM5PR2101MB1127: 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)(8121501046)(5005006)(3231221)(944501327)(52105095)(3002001)(93006095)(93001095)(10201501046)(6055026)(61426038)(61427038)(6041310)(20161123560045)(20161123564045)(20161123558120)(20161123562045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(6072148)(201708071742011);SRVR:DM5PR2101MB1127;BCL:0;PCL:0;RULEID:;SRVR:DM5PR2101MB1127; x-forefront-prvs: 0637FCE711 x-forefront-antispam-report: SFV:NSPM;SFS:(10019020)(396003)(39380400002)(39860400002)(376002)(346002)(366004)(189003)(199004)(105586002)(186003)(66066001)(6486002)(54906003)(7736002)(26005)(86362001)(316002)(305945005)(110136005)(478600001)(3280700002)(86612001)(10290500003)(25786009)(5250100002)(2616005)(99286004)(22452003)(5660300001)(3660700001)(2900100001)(81166006)(3846002)(2906002)(106356001)(6506007)(107886003)(486006)(8676002)(81156014)(14454004)(10090500001)(68736007)(4326008)(6116002)(1076002)(72206003)(102836004)(97736004)(11346002)(8936002)(476003)(2501003)(6436002)(6512007)(446003)(76176011)(36756003)(53936002)(22906009)(217873001);DIR:OUT;SFP:1102;SCL:1;SRVR:DM5PR2101MB1127;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: FuwhiwjEsIPsKk8XaCI9dd32rv88tWpYOCi57Gtnb5xVyoZTbkVvV57BhFgF4BlDPAbU7gWZYa51jiuqcxLvKJZwMYiYCIrqma3GDEYGdTyQ3J2zGxOFmKGGDmMi2gGXa1S0NaU3kLmG3yALADVnWFcTHsu5OqLB1evFQT78ZeTHurBFRkuDd6yLEa0Hhr0cXMIAh3G7uRAT+XRiK1cM5NDMTJEXu7elwpfwriGHAvDh4ZOWETpJanAp5DvsNmPq7cQEB6FvvGUW2ccSVmvNLWbODjXeiT+E9UKKVwjgAQuaodTmULrlASBZA9TM325rKCH5uashw91xiz49YaVimKKWNvu6rMd4wSKA5uXp+V8l+aEa1BSXje2hDiJPK0WtObyweiDjEyDkpBUlH86iYgFUb1pyyK+39APeYw+0m+M= 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: aaebc583-a2df-4272-ff58-08d59daf3a34 X-MS-Exchange-CrossTenant-originalarrivaltime: 09 Apr 2018 00:17:06.3245 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 72f988bf-86f1-41af-91ab-2d7cd011db47 X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM5PR2101MB1127 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 6aa613835405..896c4f82e5ef 100644 --- a/drivers/infiniband/hw/i40iw/i40iw_verbs.c +++ b/drivers/infiniband/hw/i40iw/i40iw_verbs.c @@ -1638,6 +1638,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