CVE-2026-64358: media: mtk-jpeg: cancel workqueue on release for supported platforms only

Greg Kroah-Hartman <[email protected]> Sat, 25 Jul 2026 10:49:35 +0200
Newsgroups org.kernel.vger.linux-cve-announce
Message-ID <2026072520-CVE-2026-64358-2728@gregkh>
From: Greg Kroah-Hartman <[email protected]>

Description
===========

In the Linux kernel, the following vulnerability has been resolved:

media: mtk-jpeg: cancel workqueue on release for supported platforms only

Since a recent fix the mtk_jpeg_release function cancels any pending
or running work present in the driver workqueue using
cancel_work_sync function.
Currently, only the multicore based variants use this workqueue and they
have the jpeg_worker platform data field initialized with a workqueue
callback function. For the others, this field value remain NULL by
default.
The cancel_work_sync function is unconditionally called in
mtk_jpeg_release function, even for the variants that do not use the
workqueue. This call generates a WARN_ON print in __flush_work because
the workqueue callback function presence check fails in __flush_work
function (used by cancel_work_sync).

So, to avoid these warnings, call cancel_work_sync only if a workqueue
callback is defined in platform data.

The Linux kernel CVE team has assigned CVE-2026-64358 to this issue.


Affected and fixed versions
===========================

	Issue introduced in 6.6.140 with commit 2209fdae5c2f615930c9af1379c1cfca199ec5d8 and fixed in 6.6.145 with commit 0fed0fc34ce734b4b8c2f6a467d38bddcb21dda9
	Issue introduced in 6.12.86 with commit 0498b27a1542021d90269d58347501d4c3ccd84e and fixed in 6.12.96 with commit ac0774961a6ea174a71d4ffa39966edafbf7662d
	Issue introduced in 6.18.27 with commit 26506a30e0e26d612f82a7bf0e395626968a44e6 and fixed in 6.18.39 with commit 973408ceab14555a8548b97c8cc7b54208c3f251
	Issue introduced in 7.1 with commit 34c519feef3e4fcff1078dc8bdb25fbbbd10303f and fixed in 7.1.4 with commit 4c4b4af4a9f278da096f0dbdb6b59594701d29bf
	Issue introduced in 7.1 with commit 34c519feef3e4fcff1078dc8bdb25fbbbd10303f and fixed in 7.2-rc1 with commit b1845a227fda37b2fe5327df3ca0015d7e290235
	Issue introduced in 7.0.4 with commit e78c39f720679fcf3a2eacd82725ec3ea2648301

Please see https://www.kernel.org for a full list of currently supported
kernel versions by the kernel community.

Unaffected versions might change over time as fixes are backported to
older supported kernel versions.  The official CVE entry at
	https://cve.org/CVERecord/?id=CVE-2026-64358
will be updated if fixes are backported, please check that for the most
up to date information about this issue.


Affected files
==============

The file(s) affected by this issue are:
	drivers/media/platform/mediatek/jpeg/mtk_jpeg_core.c


Mitigation
==========

The Linux kernel CVE team recommends that you update to the latest
stable kernel version for this, and many other bugfixes.  Individual
changes are never tested alone, but rather are part of a larger kernel
release.  Cherry-picking individual commits is not recommended or
supported by the Linux kernel community at all.  If however, updating to
the latest release is impossible, the individual changes to resolve this
issue can be found at these commits:
	https://git.kernel.org/stable/c/0fed0fc34ce734b4b8c2f6a467d38bddcb21dda9
	https://git.kernel.org/stable/c/ac0774961a6ea174a71d4ffa39966edafbf7662d
	https://git.kernel.org/stable/c/973408ceab14555a8548b97c8cc7b54208c3f251
	https://git.kernel.org/stable/c/4c4b4af4a9f278da096f0dbdb6b59594701d29bf
	https://git.kernel.org/stable/c/b1845a227fda37b2fe5327df3ca0015d7e290235