Skip to contentSkip to conversation

CVE-2022-50826: ipu3-imgu: Fix NULL pointer dereference in imgu_subdev_set_selection()

DISCUSSION Greg Kroah-Hartman 1 participant 1 message Dec 30, 2025

lore
Share & tools
lore
#0 lore raw

From: Greg Kroah-Hartman <[email protected]>

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

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

ipu3-imgu: Fix NULL pointer dereference in imgu_subdev_set_selection()

Calling v4l2_subdev_get_try_crop() and v4l2_subdev_get_try_compose() with a subdev state of NULL leads to a NULL pointer dereference. This can currently happen in imgu_subdev_set_selection() when the state passed in is NULL, as this method first gets pointers to both the "try" and "active" states and only then decides which to use.

The same issue has been addressed for imgu_subdev_get_selection() with commit 30d03a0de650 ("ipu3-imgu: Fix NULL pointer dereference in active selection access"). However the issue still persists in imgu_subdev_set_selection().

Therefore, apply a similar fix as done in the aforementioned commit to imgu_subdev_set_selection(). To keep things a bit cleaner, introduce helper functions for "crop" and "compose" access and use them in both imgu_subdev_set_selection() and imgu_subdev_get_selection().

The Linux kernel CVE team has assigned CVE-2022-50826 to this issue.

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

	Issue introduced in 5.14 with commit 0d346d2a6f54f06f36b224fd27cd6eafe8c83be9 and fixed in 5.15.87 with commit fa6bbb4894b9b947063c6ff90018a954c5f9f4b3
	Issue introduced in 5.14 with commit 0d346d2a6f54f06f36b224fd27cd6eafe8c83be9 and fixed in 6.0.18 with commit 611d617bdb6c5d636a9861ec1c98e813fc8a5556
	Issue introduced in 5.14 with commit 0d346d2a6f54f06f36b224fd27cd6eafe8c83be9 and fixed in 6.1.4 with commit 5038ee677606106c91564f9c4557d808d14bad70
	Issue introduced in 5.14 with commit 0d346d2a6f54f06f36b224fd27cd6eafe8c83be9 and fixed in 6.2 with commit dc608edf7d45ba0c2ad14c06eccd66474fec7847

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-2022-50826

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/staging/media/ipu3/ipu3-v4l2.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/fa6bbb4894b9b947063c6ff90018a954c5f9f4b3
	https://git.kernel.org/stable/c/611d617bdb6c5d636a9861ec1c98e813fc8a5556
	https://git.kernel.org/stable/c/5038ee677606106c91564f9c4557d808d14bad70
	https://git.kernel.org/stable/c/dc608edf7d45ba0c2ad14c06eccd66474fec7847