mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH v2 0/5] media: iris: Fix issues in the driver unbind path
@ 2026-11-10 14:09 Vishnu Reddy
  2026-11-10 14:09 ` [PATCH v2 1/5] media: iris: Fix runtime PM reference imbalance on failed resume Vishnu Reddy
                   ` (4 more replies)
  0 siblings, 5 replies; 7+ messages in thread
From: Vishnu Reddy @ 2026-11-10 14:09 UTC (permalink / raw)
  To: Vikash Garodia, Dikshita Agarwal, Abhinav Kumar,
	Bryan O'Donoghue, Mauro Carvalho Chehab, Hans Verkuil,
	Stefan Schmidt, Dmitry Baryshkov, Vishnu Reddy, Hungyu Lin
  Cc: linux-media, linux-arm-msm, linux-kernel, Bryan O'Donoghue,
	stable, sashiko-bot

The driver unbind can be triggered through sysfs while a client has a
video session running. The devm resources are freed when the unbind
completes. That leads to use after free for the running sessions.

The core and its device are now kept allocated until the last file
descriptor is closed. New sessions are stopped as soon as the removal
starts. The interrupt is freed before the core, so the interrupt thread
cannot run on freed memory.

The system error work was only cancelled during the removal. An
interrupt could still arrive afterwards and queue the work again. The
work is now disabled.

The runtime PM usage count was dropped twice when a resume failed. This
happens for a command written after runtime PM is disabled. The count
underflowed. The reference is no longer dropped a second time.

Signed-off-by: Vishnu Reddy <busanna.reddy@oss.qualcomm.com>
---
Changes in v2:
- Updated the commit description of patch 3 (Bryan)
- Split the interrupt freeing into a separate patch (Bryan)
- Added a new patch to wake up clients blocked on open sessions at removal.
- Link to v1: https://lore.kernel.org/r/20261017-iris-handle-unbind-v1-0-7809148eb90f@oss.qualcomm.com

---
Vishnu Reddy (5):
      media: iris: Fix runtime PM reference imbalance on failed resume
      media: iris: Disable the system error work on removal
      media: iris: Fix use-after-free on unbind with open sessions
      media: iris: Wake up blocked clients when the driver is removed
      media: iris: Free the interrupt in iris_remove()

 drivers/media/platform/qcom/iris/iris_core.c      | 10 +++-
 drivers/media/platform/qcom/iris/iris_core.h      |  2 +
 drivers/media/platform/qcom/iris/iris_hfi_queue.c | 17 +++++-
 drivers/media/platform/qcom/iris/iris_instance.h  |  2 +
 drivers/media/platform/qcom/iris/iris_power.c     | 13 +++++
 drivers/media/platform/qcom/iris/iris_probe.c     | 64 +++++++++++++++++++----
 drivers/media/platform/qcom/iris/iris_vidc.c      |  8 +++
 7 files changed, 103 insertions(+), 13 deletions(-)
---
base-commit: 630059a5a632377b9b7b487baccde92b7ae1dd47
change-id: 20261013-iris-handle-unbind-fe09689e6696

Best regards,
--  
Vishnu Reddy <busanna.reddy@oss.qualcomm.com>


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

end of thread, other threads:[~2026-11-10 14:42 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-11-10 14:09 [PATCH v2 0/5] media: iris: Fix issues in the driver unbind path Vishnu Reddy
2026-11-10 14:09 ` [PATCH v2 1/5] media: iris: Fix runtime PM reference imbalance on failed resume Vishnu Reddy
2026-11-10 14:09 ` [PATCH v2 2/5] media: iris: Disable the system error work on removal Vishnu Reddy
2026-11-10 14:09 ` [PATCH v2 3/5] media: iris: Fix use-after-free on unbind with open sessions Vishnu Reddy
2026-11-10 14:42   ` Bryan O'Donoghue
2026-11-10 14:09 ` [PATCH v2 4/5] media: iris: Wake up blocked clients when the driver is removed Vishnu Reddy
2026-11-10 14:09 ` [PATCH v2 5/5] media: iris: Free the interrupt in iris_remove() Vishnu Reddy

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®