Skip to content

Commit 5363fc4

Browse files
selvintxavierjgunthorpe
authored andcommitted
RDMA/bnxt_re: Properly order ib_device_unalloc() to avoid UAF
ib_dealloc_device() should be called only after device cleanup. Fix the dealloc sequence. Fixes: 6d75814 ("RDMA/bnxt_re: Use auxiliary driver interface") Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Selvin Xavier <[email protected]> Signed-off-by: Jason Gunthorpe <[email protected]>
1 parent 8e7b295 commit 5363fc4

File tree

1 file changed

+1
-1
lines changed
  • drivers/infiniband/hw/bnxt_re

1 file changed

+1
-1
lines changed

drivers/infiniband/hw/bnxt_re/main.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1526,8 +1526,8 @@ static void bnxt_re_remove(struct auxiliary_device *adev)
15261526
}
15271527
bnxt_re_setup_cc(rdev, false);
15281528
ib_unregister_device(&rdev->ibdev);
1529-
ib_dealloc_device(&rdev->ibdev);
15301529
bnxt_re_dev_uninit(rdev);
1530+
ib_dealloc_device(&rdev->ibdev);
15311531
skip_remove:
15321532
mutex_unlock(&bnxt_re_mutex);
15331533
}

0 commit comments

Comments
 (0)