CVE-2023-53748: media: mediatek: vcodec: Fix potential array out-of-bounds in decoder queue_setup
From: Greg Kroah-Hartman <[email protected]>
Description
===========
In the Linux kernel, the following vulnerability has been resolved:
media: mediatek: vcodec: Fix potential array out-of-bounds in decoder queue_setup
variable *nplanes is provided by user via system call argument. The possible value of q_data->fmt->num_planes is 1-3, while the value of *nplanes can be 1-8. The array access by index i can cause array out-of-bounds.
Fix this bug by checking *nplanes against the array size.
The Linux kernel CVE team has assigned CVE-2023-53748 to this issue.
Affected and fixed versions
===========================
Fixed in 6.1.30 with commit 48e4e06e2c5fe1fda283d499f91492eda2248bb9 Fixed in 6.3.4 with commit b8e19bf3b4aebd855be01b64674187dcf6d1db51 Fixed in 6.4 with commit 8fbcf730cb89c3647f3365226fe7014118fa93c7
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-2023-53748
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/vcodec/mtk_vcodec_dec.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/48e4e06e2c5fe1fda283d499f91492eda2248bb9 https://git.kernel.org/stable/c/b8e19bf3b4aebd855be01b64674187dcf6d1db51 https://git.kernel.org/stable/c/8fbcf730cb89c3647f3365226fe7014118fa93c7