From: "Shengzhuo Wei" <me@cherr.cc>
To: "Ming Qian(OSS)" <ming.qian@oss.nxp.com>
Cc: "Shengzhuo Wei" <me@cherr.cc>,
"Mirela Rabulea" <mirela.rabulea@nxp.com>,
"Mauro Carvalho Chehab" <mchehab@kernel.org>,
"Frank Li" <Frank.Li@nxp.com>,
"Sascha Hauer" <s.hauer@pengutronix.de>,
"Pengutronix Kernel Team" <kernel@pengutronix.de>,
"Fabio Estevam" <festevam@gmail.com>,
"Hans Verkuil" <hverkuil@kernel.org>,
"Ming Qian" <ming.qian@nxp.com>,
"Nicolas Dufresne" <nicolas.dufresne@collabora.com>,
"Benjamin Gaignard" <benjamin.gaignard@collabora.com>,
"Philipp Zabel" <p.zabel@pengutronix.de>,
"Ezequiel Garcia" <ezequiel@vanguardiasur.com.ar>,
"Bin Liu" <bin.liu@mediatek.com>,
"Matthias Brugger" <matthias.bgg@gmail.com>,
"AngeloGioacchino Del Regno"
<angelogioacchino.delregno@collabora.com>,
"irui wang" <irui.wang@mediatek.com>,
"kyrie wu" <kyrie.wu@mediatek.com>, <imx@lists.linux.dev>,
<linux-media@vger.kernel.org>,
<linux-arm-kernel@lists.infradead.org>, <stable@vger.kernel.org>
Subject: Re: [PATCH 1/3] media: nxp: imx-jpeg: cancel task_timer before freeing ctx
Date: Tue, 25 Aug 2026 11:39:14 +0800 [thread overview]
Message-ID: <ao0OYhW1YOtnWMdG@pve> (raw)
In-Reply-To: <aoz1dUszJJv80bkj@lsvm11u0000189.swis.ap-northeast-2.aws.nxp.com>
On 2026-08-25 10:56, Ming Qian(OSS) wrote:
> Hi Shengzhuo,
>
> Thanks for the patch.
>
> This use-after-free has already been fixed by Fan Wu:
> https://lore.kernel.org/lkml/20260623103031.3051-1-fanwu01@zju.edu.cn/
> [PATCH] media: imx-jpeg: cancel timeout worker when streaming stops
>
> Regards,
> Ming
>
Hi Ming,
Thanks for pointing me at Fan Wu's patch -- I had missed it (it is not
in the 7.2-rc6 base I worked from, and I failed to check for in-flight
patches on the list before sending). His version is also the better
one: placing the cancel in mxc_jpeg_stop_streaming() closes the
re-arm window that a cancel in mxc_jpeg_release() leaves open, which
Sashiko also flagged on my 1/3. I'll drop that patch.
The other two patches in the series (hantro watchdog, mtk-jpeg
job_timeout_work) fix the same class of bug in different drivers and,
as far as I can tell, have no equivalent fix in flight. Sashiko raised
one real point on the mtk patch: jpeg->job_timeout_work is only
initialized on the single-core path, so the unconditional
cancel_delayed_work_sync() in mtk_jpeg_remove() would hit a zeroed
work struct (WARN_ON(!work->func)) on multi-core variants. I plan to
send a v2 that drops the imx-jpeg patch and guards the mtk cancel
accordingly.
Do you see anything else in the remaining two patches you'd like
changed before I send the v2?
Regards,
Shengzhuo
next prev parent reply other threads:[~2026-08-25 3:39 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <20260825-media-timeout-work-v1-0-ebfebbeb6c31@cherr.cc>
2026-08-24 19:34 ` [PATCH 1/3] media: nxp: imx-jpeg: cancel task_timer before freeing ctx Shengzhuo Wei
2026-08-25 1:56 ` Ming Qian(OSS)
2026-08-25 3:39 ` Shengzhuo Wei [this message]
2026-08-24 19:34 ` [PATCH 2/3] media: verisilicon: hantro: cancel watchdog work before m2m release Shengzhuo Wei
2026-08-24 19:34 ` [PATCH 3/3] media: mediatek: jpeg: cancel job timeout " Shengzhuo Wei
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=ao0OYhW1YOtnWMdG@pve \
--to=me@cherr.cc \
--cc=Frank.Li@nxp.com \
--cc=angelogioacchino.delregno@collabora.com \
--cc=benjamin.gaignard@collabora.com \
--cc=bin.liu@mediatek.com \
--cc=ezequiel@vanguardiasur.com.ar \
--cc=festevam@gmail.com \
--cc=hverkuil@kernel.org \
--cc=imx@lists.linux.dev \
--cc=irui.wang@mediatek.com \
--cc=kernel@pengutronix.de \
--cc=kyrie.wu@mediatek.com \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-media@vger.kernel.org \
--cc=matthias.bgg@gmail.com \
--cc=mchehab@kernel.org \
--cc=ming.qian@nxp.com \
--cc=ming.qian@oss.nxp.com \
--cc=mirela.rabulea@nxp.com \
--cc=nicolas.dufresne@collabora.com \
--cc=p.zabel@pengutronix.de \
--cc=s.hauer@pengutronix.de \
--cc=stable@vger.kernel.org \
/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