Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp894944yba; Thu, 18 Apr 2019 11:21:40 -0700 (PDT) X-Google-Smtp-Source: APXvYqzNe5Xtnu3GluCe7SpxBNUQ5qafjuXL00ddSvkAYPB9KmkUjRCmHv6/fKj7MoHw/Zjn05An X-Received: by 2002:a65:6389:: with SMTP id h9mr90618120pgv.398.1555611700228; Thu, 18 Apr 2019 11:21:40 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1555611700; cv=none; d=google.com; s=arc-20160816; b=HVxYaxSUQibsmPa9C3xiJjSyTJZ/zNWVCwCPtXPxKd/PiM45d53BMT18iBLX6e9/Vi 69dEM1rh5v9vanGfEY8asOTFXEEz1t+KtGBeID0XQ0I99YpkEB7mP2dhOzKkhTgLp/Xa k06U5yaK01gx8shJpaNPk6FT65U8RBiq5Xp/AfHKJNTiQJ3W5uaKCHePMdbT9oHE5gA/ d9SBWKsOs4aozahnyXclIKT4Z89J7EuiIczmFbrzwJ4IiWV33j+8rXQKDLh48TFrGqTI dEPNP37awGW0e6/vvNCK4g/5MX+0bqM11kYaoFABM+s8D+sQdQOOHKJuc+6mG4g+fmBy Aqjw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=8aF4vlV36QxxvRTbMpO6AUznTse5xjGrx0rlayQ1EXA=; b=hNaOYJZFu43Eve9wOciA4VlC2zQfRwmMpueDGImXdllyYVRBk3j1jSCHs1ArZ1AtkI 3ScmlMBAtM9L08JioybCFuwIV9Z276EYAkdlSuAtdj8g65y0wh8Z9V1pf3q9ZtISeAu+ eoHjBhNV3nEzbs07rnj7JqX9laICHhBH2X9mgJ6fR7yxZHbxDqoWCJ3nHcalBx+dqLLN CBNWUCQM02YGzNYB1hR/aVd3TbCoT9SzZesDNW/npuHxqr7H5/85pzWow7hmIFnNxmxB 8nufJKBalRle1Ui+Coi1rPl3t+HvTR3agLMkeShq9uj4l4gjdE/Ugfx+dJi6x440hwPs rsiQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=nvJLQyBS; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id f11si2702908plo.169.2019.04.18.11.21.25; Thu, 18 Apr 2019 11:21:40 -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=nvJLQyBS; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2391883AbfDRSJo (ORCPT + 99 others); Thu, 18 Apr 2019 14:09:44 -0400 Received: from mail.kernel.org ([198.145.29.99]:41360 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2391431AbfDRSJn (ORCPT ); Thu, 18 Apr 2019 14:09:43 -0400 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 153CE2186A; Thu, 18 Apr 2019 18:09:41 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1555610982; bh=dnlOL0GRo6NlzBvMP6fKrj3f9Z2S385NBRAMpJJvTUs=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=nvJLQyBSLwOKROTjFuDWtI9TDiOZFRjNixJ7frcVglcvxy7RPVsfjt2Q+akj9v35B rlynrNgpswAjtSSZOGOlDvwEgsTesT4u0KzYLmOP4UKvpwgBb8YRva6Zrq7g6qYY8h SeOEWA12WoxNE3z9SkIbE735t8JXIBXXxOWgUd/s= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Jack Morgenstein , Leon Romanovsky , Jason Gunthorpe , Sasha Levin Subject: [PATCH 5.0 14/93] IB/mlx4: Fix race condition between catas error reset and aliasguid flows Date: Thu, 18 Apr 2019 19:56:52 +0200 Message-Id: <20190418160438.287488237@linuxfoundation.org> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20190418160436.781762249@linuxfoundation.org> References: <20190418160436.781762249@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org [ Upstream commit 587443e7773e150ae29e643ee8f41a1eed226565 ] Code review revealed a race condition which could allow the catas error flow to interrupt the alias guid query post mechanism at random points. Thiis is fixed by doing cancel_delayed_work_sync() instead of cancel_delayed_work() during the alias guid mechanism destroy flow. Fixes: a0c64a17aba8 ("mlx4: Add alias_guid mechanism") Signed-off-by: Jack Morgenstein Signed-off-by: Leon Romanovsky Signed-off-by: Jason Gunthorpe Signed-off-by: Sasha Levin --- drivers/infiniband/hw/mlx4/alias_GUID.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/infiniband/hw/mlx4/alias_GUID.c b/drivers/infiniband/hw/mlx4/alias_GUID.c index 782499abcd98..2a0b59a4b6eb 100644 --- a/drivers/infiniband/hw/mlx4/alias_GUID.c +++ b/drivers/infiniband/hw/mlx4/alias_GUID.c @@ -804,8 +804,8 @@ void mlx4_ib_destroy_alias_guid_service(struct mlx4_ib_dev *dev) unsigned long flags; for (i = 0 ; i < dev->num_ports; i++) { - cancel_delayed_work(&dev->sriov.alias_guid.ports_guid[i].alias_guid_work); det = &sriov->alias_guid.ports_guid[i]; + cancel_delayed_work_sync(&det->alias_guid_work); spin_lock_irqsave(&sriov->alias_guid.ag_work_lock, flags); while (!list_empty(&det->cb_list)) { cb_ctx = list_entry(det->cb_list.next, -- 2.19.1