From: Vishnu Reddy <busanna.reddy@oss.qualcomm.com>
To: Vikash Garodia <vikash.garodia@oss.qualcomm.com>,
Dikshita Agarwal <dikshita.agarwal@oss.qualcomm.com>,
Abhinav Kumar <abhinav.kumar@linux.dev>,
Bryan O'Donoghue <bod@kernel.org>,
Mauro Carvalho Chehab <mchehab@kernel.org>,
Hans Verkuil <hverkuil@kernel.org>,
Stefan Schmidt <stefan.schmidt@linaro.org>,
Dmitry Baryshkov <dmitry.baryshkov@oss.qualcomm.com>,
Vishnu Reddy <busanna.reddy@oss.qualcomm.com>,
Hungyu Lin <dennylin0707@gmail.com>
Cc: linux-media@vger.kernel.org, linux-arm-msm@vger.kernel.org,
linux-kernel@vger.kernel.org,
Bryan O'Donoghue <bryan.odonoghue@linaro.org>,
stable@vger.kernel.org, sashiko-bot <sashiko-bot@kernel.org>
Subject: [PATCH v3 0/4] media: iris: Fix issues in the driver unbind path
Date: Thu, 19 Nov 2026 17:15:29 +0530 [thread overview]
Message-ID: <20261119-iris-handle-unbind-v3-0-52d467a13907@oss.qualcomm.com> (raw)
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 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 v3:
- Ensured that runtime PM references are dropped before driver removal.
- Dropped the unnecessary interrupt freeing change.
- Link to v2: https://patch.msgid.link/20261110-iris-handle-unbind-v2-0-86d5f6f1dea8@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 (4):
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
drivers/media/platform/qcom/iris/iris_core.c | 5 ++
drivers/media/platform/qcom/iris/iris_core.h | 4 ++
drivers/media/platform/qcom/iris/iris_hfi_queue.c | 20 ++++++-
drivers/media/platform/qcom/iris/iris_instance.h | 2 +
drivers/media/platform/qcom/iris/iris_power.c | 24 ++++++++-
drivers/media/platform/qcom/iris/iris_probe.c | 66 +++++++++++++++++++----
drivers/media/platform/qcom/iris/iris_vidc.c | 20 ++++++-
7 files changed, 127 insertions(+), 14 deletions(-)
---
base-commit: e8017d29067fd1310a65c3494ce1a1b492adbac6
change-id: 20261013-iris-handle-unbind-fe09689e6696
Best regards,
--
Vishnu Reddy <busanna.reddy@oss.qualcomm.com>
next reply other threads:[~2026-11-19 11:46 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-19 11:45 Vishnu Reddy [this message]
2026-11-19 11:45 ` [PATCH v3 1/4] media: iris: Fix runtime PM reference imbalance on failed resume Vishnu Reddy
2026-11-19 11:45 ` [PATCH v3 2/4] media: iris: Disable the system error work on removal Vishnu Reddy
2026-11-19 11:45 ` [PATCH v3 3/4] media: iris: Fix use-after-free on unbind with open sessions Vishnu Reddy
2026-11-19 11:45 ` [PATCH v3 4/4] media: iris: Wake up blocked clients when the driver is removed Vishnu Reddy
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20261119-iris-handle-unbind-v3-0-52d467a13907@oss.qualcomm.com \
--to=busanna.reddy@oss.qualcomm.com \
--cc=abhinav.kumar@linux.dev \
--cc=bod@kernel.org \
--cc=bryan.odonoghue@linaro.org \
--cc=dennylin0707@gmail.com \
--cc=dikshita.agarwal@oss.qualcomm.com \
--cc=dmitry.baryshkov@oss.qualcomm.com \
--cc=hverkuil@kernel.org \
--cc=linux-arm-msm@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-media@vger.kernel.org \
--cc=mchehab@kernel.org \
--cc=sashiko-bot@kernel.org \
--cc=stable@vger.kernel.org \
--cc=stefan.schmidt@linaro.org \
--cc=vikash.garodia@oss.qualcomm.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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®