All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH rc 0/2] Do not UAF during iommufd_put_object()
@ 2023-11-21  1:28 Jason Gunthorpe
  2023-11-21  1:28 ` [PATCH rc 1/2] iommufd: Add iommufd_ctx to iommufd_put_object() Jason Gunthorpe
  2023-11-21  1:28 ` [PATCH rc 2/2] iommufd: Do not UAF during iommufd_put_object() Jason Gunthorpe
  0 siblings, 2 replies; 6+ messages in thread
From: Jason Gunthorpe @ 2023-11-21  1:28 UTC (permalink / raw)
  To: iommu, Kevin Tian
  Cc: Lu Baolu, Eric Auger, Lixiao Yang, Matthew Rosato, Nicolin Chen,
	patches, syzbot+7574ebfe589049630608, syzbot+d31adfb277377ef8fcba,
	Yi Liu

The mixture of kernel and user space lifecycle objects continues to be
complicated inside iommufd. The obj->destroy_rwsem is used to bring order
to the kernel driver destruction sequence but it cannot be sequenced right
with the other refcounts so we end up possibly UAF'ing.

Fix it by using two refcounts and a wait queue to sequence the destruction
process.

Jason Gunthorpe (2):
  iommufd: Add iommufd_ctx to iommufd_put_object()
  iommufd: Do not UAF during iommufd_put_object()

 drivers/iommu/iommufd/device.c          |  14 +--
 drivers/iommu/iommufd/hw_pagetable.c    |   8 +-
 drivers/iommu/iommufd/ioas.c            |  14 +--
 drivers/iommu/iommufd/iommufd_private.h |  51 ++++++---
 drivers/iommu/iommufd/main.c            | 131 ++++++++++++------------
 drivers/iommu/iommufd/selftest.c        |  14 +--
 drivers/iommu/iommufd/vfio_compat.c     |  18 ++--
 7 files changed, 136 insertions(+), 114 deletions(-)


base-commit: 98b1cc82c4affc16f5598d4fa14b1858671b2263
-- 
2.42.0


^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2023-11-21 13:04 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-11-21  1:28 [PATCH rc 0/2] Do not UAF during iommufd_put_object() Jason Gunthorpe
2023-11-21  1:28 ` [PATCH rc 1/2] iommufd: Add iommufd_ctx to iommufd_put_object() Jason Gunthorpe
2023-11-21  3:42   ` Tian, Kevin
2023-11-21  1:28 ` [PATCH rc 2/2] iommufd: Do not UAF during iommufd_put_object() Jason Gunthorpe
2023-11-21  3:49   ` Tian, Kevin
2023-11-21 13:04     ` Jason Gunthorpe

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.