Skip to content

RFC iommu/iova: Unsafe locking in find_iova()

Dmitry Safonov linux-iommu lkml 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 RFC Latest3 patches 5 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/3iommu/iova: Find and split iova under rbtree's lockdrivers/iommu/intel-iommu.c drivers/iommu/iova.c include/linux/iova.h+19 -240 replies
2/3iommu/iova: Make free_iova() atomicdrivers/iommu/iova.c+6 -30 replies
3/3iommu/iova: Remove find_iova()drivers/iommu/iova.c include/linux/iova.h+0 -270 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.

Read the v1 thread

Cover letter [RFC 0/3] iommu/iova: Unsafe locking in find_iova()

find_iova() looks to be using a bad locking practice: it locks the returned iova only for the search time.
And looking in code, the element can be removed from the tree and freed under rbtree lock. That happens during memory hot-unplug and cleanup on module removal.
Here I cleanup users of the function and delete it.

Dmitry Safonov (3):
iommu/iova: Find and split iova under rbtree's lock iommu/iova: Make free_iova() atomic iommu/iova: Remove find_iova()

 drivers/iommu/intel-iommu.c | 14 +++----------
 drivers/iommu/iova.c        | 48 +++++++++++++++++----------------------------
 include/linux/iova.h        | 17 ++++------------
 3 files changed, 25 insertions(+), 54 deletions(-)
Signature · 1 line
2.13.6