CVE-2024-56579: media: amphion: Set video drvdata before register video device
Description
===========
In the Linux kernel, the following vulnerability has been resolved:
media: amphion: Set video drvdata before register video device
The video drvdata should be set before the video device is registered, otherwise video_drvdata() may return NULL in the open() file ops, and led to oops.
The Linux kernel CVE team has assigned CVE-2024-56579 to this issue.
Affected and fixed versions
===========================
Issue introduced in 5.18 with commit 3cd084519c6f91cbef9d604bcf26844fa81d4922 and fixed in 6.1.120 with commit cfe96c7c3382293179e291f66644d789e39e99f3 Issue introduced in 5.18 with commit 3cd084519c6f91cbef9d604bcf26844fa81d4922 and fixed in 6.6.64 with commit 988cc10ddbdee0369fe1f193d389da38ad760492 Issue introduced in 5.18 with commit 3cd084519c6f91cbef9d604bcf26844fa81d4922 and fixed in 6.12.4 with commit 182b9edc02c4cbb6fe6b97105c23c7047a3340d2 Issue introduced in 5.18 with commit 3cd084519c6f91cbef9d604bcf26844fa81d4922 and fixed in 6.13-rc1 with commit 8cbb1a7bd5973b57898b26eb804fe44af440bb63
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-2024-56579
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/amphion/vpu_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/cfe96c7c3382293179e291f66644d789e39e99f3 https://git.kernel.org/stable/c/988cc10ddbdee0369fe1f193d389da38ad760492 https://git.kernel.org/stable/c/182b9edc02c4cbb6fe6b97105c23c7047a3340d2 https://git.kernel.org/stable/c/8cbb1a7bd5973b57898b26eb804fe44af440bb63