Skip to contentSkip to conversation

CVE-2025-40015: media: stm32-csi: Fix dereference before NULL check

DISCUSSION Greg Kroah-Hartman 1 participant 1 message Oct 20, 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:

media: stm32-csi: Fix dereference before NULL check

In 'stm32_csi_start', 'csidev->s_subdev' is dereferenced directly while assigning a value to the 'src_pad'. However the same value is being checked against NULL at a later point of time indicating that there are chances that the value can be NULL.

Move the dereference after the NULL check.

The Linux kernel CVE team has assigned CVE-2025-40015 to this issue.

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

	Issue introduced in 6.15 with commit e7bad98c205d17c745de9d83ebf73e53cbf99d48 and fixed in 6.16.11 with commit 1f053d82e59c785b2b939cbed12f13657f84b296
	Issue introduced in 6.15 with commit e7bad98c205d17c745de9d83ebf73e53cbf99d48 and fixed in 6.17.1 with commit 4eeafff163e80d576c5efc1360ae310c0ceedd02
	Issue introduced in 6.15 with commit e7bad98c205d17c745de9d83ebf73e53cbf99d48 and fixed in 6.18-rc1 with commit 80eaf32672871bd2623ce6ba13ffc1f018756580

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-2025-40015

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/st/stm32/stm32-csi.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/1f053d82e59c785b2b939cbed12f13657f84b296
	https://git.kernel.org/stable/c/4eeafff163e80d576c5efc1360ae310c0ceedd02
	https://git.kernel.org/stable/c/80eaf32672871bd2623ce6ba13ffc1f018756580