From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.8 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI, SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 6A8E3C0650F for ; Mon, 5 Aug 2019 05:36:31 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 412642086D for ; Mon, 5 Aug 2019 05:36:31 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1564983391; bh=qa91R55Zt869gTqD1j+Db+MsyM2OnyPK8kEA5jmTMa8=; h=Subject:To:Cc:From:Date:List-ID:From; b=08qa6f2/uo/nI1t0l75EvU1JYekDnP7kGUonVDKvpx73h/MU0DVrTy/SR0dozO2w7 kaIlDdfYuoE4ewvGCRen2I9GoAt50XL9ttfzU6FsQVmsk3c2ObVzpWr8eVvidxth1q v79NIOm9CH8TAPMgRP/WCNE9WNgT+mXyu3GF3/+4= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726436AbfHEFgb (ORCPT ); Mon, 5 Aug 2019 01:36:31 -0400 Received: from out1-smtp.messagingengine.com ([66.111.4.25]:55919 "EHLO out1-smtp.messagingengine.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725951AbfHEFga (ORCPT ); Mon, 5 Aug 2019 01:36:30 -0400 Received: from compute6.internal (compute6.nyi.internal [10.202.2.46]) by mailout.nyi.internal (Postfix) with ESMTP id A89282102F; Mon, 5 Aug 2019 01:36:29 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute6.internal (MEProxy); Mon, 05 Aug 2019 01:36:29 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:content-type :date:from:message-id:mime-version:subject:to:x-me-proxy :x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s=fm3; bh=Qj5B3F ODRGPA57cCbZjfVki0J20DTPzFJ6WPPZgrUZA=; b=YUbXh82QSfQ0xzsXjl+MG0 S/ym2gWbCvxlrC2AuaeCjEpcPgXccXhNZRGxrkfBzYxJVmOtXJHuVw4XQntAIuzB ogJ+X/iJgbNrP4gB7Cjmi4BJtn8yPZ4ZGlriMuV0B2u8X8FIMzTWTq9fTFCEFUMz /SJnCyCYtrJdWtrDyi1i+tEcKwcQ5/tbSLVAAdNbeUhhmItw65jVj+E/wZU+iA/Y nmJf+PQvgn8FumubV1z0EjExfhaKwfF0taJIJVkpgziEDZDsh3p08ZWtuvcZdca9 ZurxCSc/0+MMu8EKjA+QRAi6Z/PiQutoiR0coULnFVZNVTRScHxx/4sPy/cBvd3A == X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeduvddruddtiedgkeekucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucenucfjughrpefuvffhfffkgggtgfesthekredttd dtlfenucfhrhhomhepoehgrhgvghhkhheslhhinhhugihfohhunhgurghtihhonhdrohhr gheqnecuffhomhgrihhnpehkvghrnhgvlhdrohhrghenucfkphepkeefrdekiedrkeelrd dutdejnecurfgrrhgrmhepmhgrihhlfhhrohhmpehgrhgvgheskhhrohgrhhdrtghomhen ucevlhhushhtvghrufhiiigvpeef X-ME-Proxy: Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) by mail.messagingengine.com (Postfix) with ESMTPA id 2A2D68005A; Mon, 5 Aug 2019 01:36:29 -0400 (EDT) Subject: FAILED: patch "[PATCH] IB/mlx5: Move MRs to a kernel PD when freeing them to the MR" failed to apply to 4.9-stable tree To: yishaih@mellanox.com, artemyko@mellanox.com, jgg@mellanox.com, leonro@mellanox.com, stable@vger.kernel.org Cc: From: Date: Mon, 05 Aug 2019 07:36:19 +0200 Message-ID: <1564983379159138@kroah.com> MIME-Version: 1.0 Content-Type: text/plain; charset=ANSI_X3.4-1968 Content-Transfer-Encoding: 8bit Sender: stable-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org The patch below does not apply to the 4.9-stable tree. If someone wants it applied there, or to any other stable or longterm tree, then please email the backport, including the original git commit id to . thanks, greg k-h ------------------ original commit in Linus's tree ------------------ >From 9ec4483a3f0f71a228a5933bc040441322bfb090 Mon Sep 17 00:00:00 2001 From: Yishai Hadas Date: Tue, 23 Jul 2019 09:57:27 +0300 Subject: [PATCH] IB/mlx5: Move MRs to a kernel PD when freeing them to the MR cache Fix unreg_umr to move the MR to a kernel owned PD (i.e. the UMR PD) which can't be accessed by userspace. This ensures that nothing can continue to access the MR once it has been placed in the kernels cache for reuse. MRs in the cache continue to have their HW state, including DMA tables, present. Even though the MR has been invalidated, changing the PD provides an additional layer of protection against use of the MR. Link: https://lore.kernel.org/r/20190723065733.4899-5-leon@kernel.org Cc: # 3.10 Fixes: e126ba97dba9 ("mlx5: Add driver for Mellanox Connect-IB adapters") Signed-off-by: Yishai Hadas Reviewed-by: Artemy Kovalyov Signed-off-by: Leon Romanovsky Reviewed-by: Jason Gunthorpe Signed-off-by: Jason Gunthorpe diff --git a/drivers/infiniband/hw/mlx5/mr.c b/drivers/infiniband/hw/mlx5/mr.c index b83361aebf28..7274a9b9df58 100644 --- a/drivers/infiniband/hw/mlx5/mr.c +++ b/drivers/infiniband/hw/mlx5/mr.c @@ -1375,8 +1375,10 @@ static int unreg_umr(struct mlx5_ib_dev *dev, struct mlx5_ib_mr *mr) if (mdev->state == MLX5_DEVICE_STATE_INTERNAL_ERROR) return 0; - umrwr.wr.send_flags = MLX5_IB_SEND_UMR_DISABLE_MR; + umrwr.wr.send_flags = MLX5_IB_SEND_UMR_DISABLE_MR | + MLX5_IB_SEND_UMR_UPDATE_PD_ACCESS; umrwr.wr.opcode = MLX5_IB_WR_UMR; + umrwr.pd = dev->umrc.pd; umrwr.mkey = mr->mmkey.key; umrwr.ignore_free_state = 1;