Received: by 2002:ac0:aa62:0:0:0:0:0 with SMTP id w31-v6csp1965588ima; Thu, 25 Oct 2018 07:40:49 -0700 (PDT) X-Google-Smtp-Source: AJdET5fhDSZSS9ijPKU+T51GOaYlPHiBZY4aJGLpBCKVOaEHIug/JG/7WDCtaSGl3fy3aldSNHmX X-Received: by 2002:a63:f91e:: with SMTP id h30-v6mr1742396pgi.154.1540478449202; Thu, 25 Oct 2018 07:40:49 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1540478449; cv=none; d=google.com; s=arc-20160816; b=sOOVkg0Xyy4sQN16KadAEdqTzUqRH+75bJxUEDfoMy7BZJfI0t2dVdpflrNt8cUQuo D4+70yLHDjCErUPjDh6jO/QgWc55rnaYZx+SQ/pmjDRH2cryQq0ptev8ZrrHRpywITqb 0JYzI3WmAMm3L6QQ/6jtT8KA0rC4FjN0r8Phc2xfrZTQdDDje4s19om7Vv8kyfoiipjh I450FtMwiGnoLwK/gAalsCQ8k+7MT9dBiWOfcIOOJztxufagcQPUlreuf4PxtAzq+SFD HQvfm7LktVhXn6FppjC3gIw91B/Y+mhBctHigykjN0krLKfgelDOLocjFJS7XorUc6oX AKgQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature; bh=YVzdX0lNBsqTyEQQnruPeXaNs8htUs5TRAhnukqzR6Y=; b=KpW7BCfmD7ckbx1ERhpsqrp7Gqxn5cJh/w1caBExoayPyeyEjGpaCJT6Z7WdIc09RF r3X1JECXY3Xi/EV1hGi+/2JKX/fiJum+nUFPdC4CPNXd5lij9/rDxJTyhf7Lxetd+mrj irct0mO7tA2zRad0euy4qtk7GWgHK5ka1AYtY0bVjYxzTvxKwRkufgQEauF0IUdZNva1 fshkz2FKUK381JIhYsdisNxP28/t60hmSNoaalGeVOeGAjWtYmJWmSD7yCuOgI0muugK qBw5R/DDrc/VKNCub1Tt11oabmetAA1cd9RG4nONMQaXsDG1x1rK9Xc+PRVw0laIFTY3 M1rw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=Gp7DYr+p; 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=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id p15-v6si8473333pgr.336.2018.10.25.07.40.32; Thu, 25 Oct 2018 07:40:49 -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=@kernel.org header.s=default header.b=Gp7DYr+p; 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=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729274AbeJYWtK (ORCPT + 99 others); Thu, 25 Oct 2018 18:49:10 -0400 Received: from mail.kernel.org ([198.145.29.99]:58162 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728155AbeJYWtI (ORCPT ); Thu, 25 Oct 2018 18:49:08 -0400 Received: from sasha-vm.mshome.net (unknown [167.98.65.38]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 9FE4120868; Thu, 25 Oct 2018 14:16:10 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1540476971; bh=bQAc0EFA6P4cK70aapV+fJXzBSBOrS7GccmQx9143Q8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Gp7DYr+piqeAk7RgD5ZfxMrp6TCATcm+GaEPbc8aeLaR4VsQll3YPj56biVQFCITl /micqN7jrIw5/UXkbECLqlGlh1jYj/MEhoemnHD5c6JzK+8+VJCIHVFBQBcWzfFwO9 4/HKJN94Vh/hFNpqgBF9V2DMiu+H1wlozKbiHlsU= From: Sasha Levin To: stable@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Alex Estrin , Dennis Dalessandro , Doug Ledford , Sasha Levin Subject: [PATCH AUTOSEL 4.9 73/98] Revert "IB/ipoib: Update broadcast object if PKey value was changed in index 0" Date: Thu, 25 Oct 2018 10:13:58 -0400 Message-Id: <20181025141423.213774-73-sashal@kernel.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20181025141423.213774-1-sashal@kernel.org> References: <20181025141423.213774-1-sashal@kernel.org> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Alex Estrin [ Upstream commit 612601d0013f03de9dc134809f242ba6da9ca252 ] commit 9a9b8112699d will cause core to fail UD QP from being destroyed on ipoib unload, therefore cause resources leakage. On pkey change event above patch modifies mgid before calling underlying driver to detach it from QP. Drivers' detach_mcast() will fail to find modified mgid it was never given to attach in a first place. Core qp->usecnt will never go down, so ib_destroy_qp() will fail. IPoIB driver actually does take care of new broadcast mgid based on new pkey by destroying an old mcast object in ipoib_mcast_dev_flush()) .... if (priv->broadcast) { rb_erase(&priv->broadcast->rb_node, &priv->multicast_tree); list_add_tail(&priv->broadcast->list, &remove_list); priv->broadcast = NULL; } ... then in restarted ipoib_macst_join_task() creating a new broadcast mcast object, sending join request and on completion tells the driver to attach to reinitialized QP: ... if (!priv->broadcast) { ... broadcast = ipoib_mcast_alloc(dev, 0); ... memcpy(broadcast->mcmember.mgid.raw, priv->dev->broadcast + 4, sizeof (union ib_gid)); priv->broadcast = broadcast; ... Fixes: 9a9b8112699d ("IB/ipoib: Update broadcast object if PKey value was changed in index 0") Cc: stable@vger.kernel.org Reviewed-by: Mike Marciniszyn Reviewed-by: Dennis Dalessandro Signed-off-by: Alex Estrin Signed-off-by: Dennis Dalessandro Reviewed-by: Feras Daoud Signed-off-by: Doug Ledford Signed-off-by: Sasha Levin --- drivers/infiniband/ulp/ipoib/ipoib_ib.c | 13 ------------- 1 file changed, 13 deletions(-) diff --git a/drivers/infiniband/ulp/ipoib/ipoib_ib.c b/drivers/infiniband/ulp/ipoib/ipoib_ib.c index 3dd5bf6c6c7a..ad3089c23e18 100644 --- a/drivers/infiniband/ulp/ipoib/ipoib_ib.c +++ b/drivers/infiniband/ulp/ipoib/ipoib_ib.c @@ -974,19 +974,6 @@ static inline int update_parent_pkey(struct ipoib_dev_priv *priv) */ priv->dev->broadcast[8] = priv->pkey >> 8; priv->dev->broadcast[9] = priv->pkey & 0xff; - - /* - * Update the broadcast address in the priv->broadcast object, - * in case it already exists, otherwise no one will do that. - */ - if (priv->broadcast) { - spin_lock_irq(&priv->lock); - memcpy(priv->broadcast->mcmember.mgid.raw, - priv->dev->broadcast + 4, - sizeof(union ib_gid)); - spin_unlock_irq(&priv->lock); - } - return 0; } -- 2.17.1