Skip to content

Fix a use-after-free in the SRP target driver

Bart Van Assche linux-rdma 2 versions – Applied

Status from this message: Applied to for-next, thanks

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v2 Latest3 patches 1 replyApplied
  2. v13 patches 7 repliesSuperseded

Changes in v2 from the cover letter

- Left out three BUG_ON() statements.
- Added three WARN_ON_ONCE() statements.
- Removed an unnecessary if (!sport_id) statement block.

Patches in v2 Applied

#Subject and filesSizeRepliesApplied
1/3RDMA/srpt: Duplicate port name membersdrivers/infiniband/ulp/srpt/ib_srpt.c drivers/infiniband/ulp/srpt/ib_srpt.h+13 -60 replies
2/3RDMA/srpt: Introduce a reference count in struct srpt_devicedrivers/infiniband/ulp/srpt/ib_srpt.c drivers/infiniband/ulp/srpt/ib_srpt.h+17 -20 replies
3/3RDMA/srpt: Fix a use-after-freedrivers/infiniband/ulp/srpt/ib_srpt.c drivers/infiniband/ulp/srpt/ib_srpt.h+94 -460 replies

Reviews trailers per patch

None of the 3 patches has a Reviewed-by or Acked-by.

PatchLi Zhijian
1/3
2/3
3/3T-b

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v2 thread

Cover letter [PATCH v2 0/3] Fix a use-after-free in the SRP target driver

Hi Jason,

A known issue in the SRP target driver is that a use-after-free is triggered if an RDMA port is removed while a LIO target port is still associated with that RDMA port. This patch series fixes that use-after-free.

Thanks,

Bart.

See also:
* Commit 9b64f7d0bb0a ("RDMA/srpt: Postpone HCA removal until after configfs directory removal").
* https://lore.kernel.org/all/[email protected]/

Changes compared to v1:
- Left out three BUG_ON() statements.
- Added three WARN_ON_ONCE() statements.
- Removed an unnecessary if (!sport_id) statement block.

Bart Van Assche (3):
RDMA/srpt: Duplicate port name members
RDMA/srpt: Introduce a reference count in struct srpt_device RDMA/srpt: Fix a use-after-free

 drivers/infiniband/ulp/srpt/ib_srpt.c | 148 ++++++++++++++++++--------
 drivers/infiniband/ulp/srpt/ib_srpt.h |  18 ++--
 2 files changed, 118 insertions(+), 48 deletions(-)