]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/blob - queue-4.14/ib-mlx4-fix-race-condition-between-catas-error-reset.patch
autosel patches for 4.14
[thirdparty/kernel/stable-queue.git] / queue-4.14 / ib-mlx4-fix-race-condition-between-catas-error-reset.patch
1 From 8f22a30c3ca97e624a14b5b047848c1278ca9ddc Mon Sep 17 00:00:00 2001
2 From: Jack Morgenstein <jackm@dev.mellanox.co.il>
3 Date: Wed, 6 Mar 2019 19:17:56 +0200
4 Subject: IB/mlx4: Fix race condition between catas error reset and aliasguid
5 flows
6
7 [ Upstream commit 587443e7773e150ae29e643ee8f41a1eed226565 ]
8
9 Code review revealed a race condition which could allow the catas error
10 flow to interrupt the alias guid query post mechanism at random points.
11 Thiis is fixed by doing cancel_delayed_work_sync() instead of
12 cancel_delayed_work() during the alias guid mechanism destroy flow.
13
14 Fixes: a0c64a17aba8 ("mlx4: Add alias_guid mechanism")
15 Signed-off-by: Jack Morgenstein <jackm@dev.mellanox.co.il>
16 Signed-off-by: Leon Romanovsky <leonro@mellanox.com>
17 Signed-off-by: Jason Gunthorpe <jgg@mellanox.com>
18 Signed-off-by: Sasha Levin <sashal@kernel.org>
19 ---
20 drivers/infiniband/hw/mlx4/alias_GUID.c | 2 +-
21 1 file changed, 1 insertion(+), 1 deletion(-)
22
23 diff --git a/drivers/infiniband/hw/mlx4/alias_GUID.c b/drivers/infiniband/hw/mlx4/alias_GUID.c
24 index 155b4dfc0ae8..baab9afa9174 100644
25 --- a/drivers/infiniband/hw/mlx4/alias_GUID.c
26 +++ b/drivers/infiniband/hw/mlx4/alias_GUID.c
27 @@ -804,8 +804,8 @@ void mlx4_ib_destroy_alias_guid_service(struct mlx4_ib_dev *dev)
28 unsigned long flags;
29
30 for (i = 0 ; i < dev->num_ports; i++) {
31 - cancel_delayed_work(&dev->sriov.alias_guid.ports_guid[i].alias_guid_work);
32 det = &sriov->alias_guid.ports_guid[i];
33 + cancel_delayed_work_sync(&det->alias_guid_work);
34 spin_lock_irqsave(&sriov->alias_guid.ag_work_lock, flags);
35 while (!list_empty(&det->cb_list)) {
36 cb_ctx = list_entry(det->cb_list.next,
37 --
38 2.19.1
39