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 Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id ACC91C433EF for ; Wed, 22 Dec 2021 02:52:06 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S241985AbhLVCwF (ORCPT ); Tue, 21 Dec 2021 21:52:05 -0500 Received: from out30-42.freemail.mail.aliyun.com ([115.124.30.42]:43234 "EHLO out30-42.freemail.mail.aliyun.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S241974AbhLVCwC (ORCPT ); Tue, 21 Dec 2021 21:52:02 -0500 X-Alimail-AntiSpam: AC=PASS;BC=-1|-1;BR=01201311R181e4;CH=green;DM=||false|;DS=||;FP=0|-1|-1|-1|0|-1|-1|-1;HT=e01e04423;MF=tonylu@linux.alibaba.com;NM=1;PH=DS;RN=7;SR=0;TI=SMTPD_---0V.O7seW_1640141519; Received: from localhost(mailfrom:tonylu@linux.alibaba.com fp:SMTPD_---0V.O7seW_1640141519) by smtp.aliyun-inc.com(127.0.0.1); Wed, 22 Dec 2021 10:52:00 +0800 Date: Wed, 22 Dec 2021 10:51:58 +0800 From: Tony Lu To: Leon Romanovsky Cc: Jason Gunthorpe , Maor Gottlieb , Alaa Hleihel , Chuck Lever , linux-kernel@vger.kernel.org, linux-rdma@vger.kernel.org Subject: Re: [PATCH rdma-rc] RDMA/mlx5: Fix dereg mr flow for kernel MRs Message-ID: Reply-To: Tony Lu References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Dec 21, 2021 at 11:46:41AM +0200, Leon Romanovsky wrote: > From: Maor Gottlieb > > The cited commit moved umem into the union, hence > umem could be accessed only for user MRs. Add udata check > before access umem in the dereg flow. > > Fixes: f0ae4afe3d35 ("RDMA/mlx5: Fix releasing unallocated memory in dereg MR flow") > Tested-by: Chuck Lever > Signed-off-by: Maor Gottlieb > Signed-off-by: Leon Romanovsky > --- > drivers/infiniband/hw/mlx5/mlx5_ib.h | 2 +- > drivers/infiniband/hw/mlx5/mr.c | 4 ++-- > drivers/infiniband/hw/mlx5/odp.c | 4 ++-- > 3 files changed, 5 insertions(+), 5 deletions(-) > > diff --git a/drivers/infiniband/hw/mlx5/mlx5_ib.h b/drivers/infiniband/hw/mlx5/mlx5_ib.h This patch was tested and works for me in our environment for SMC. It wouldn't panic when release link and call ib_dereg_mr. Tested-by: Tony Lu Thanks, Tony Lu