]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
media: qcom: camss: vfe: Fix out-of-bounds access in vfe_isr_reg_update()
authorAlper Ak <alperyasinak1@gmail.com>
Mon, 29 Dec 2025 07:52:17 +0000 (10:52 +0300)
committerHans Verkuil <hverkuil+cisco@kernel.org>
Tue, 13 Jan 2026 09:25:01 +0000 (10:25 +0100)
commitd965919af524e68cb2ab1a685872050ad2ee933d
tree1614c7a938efcb0305b30bf4ea3019ecb4f094ec
parent0b61ce8dc4a71ea7baa19275c655677c612dde6d
media: qcom: camss: vfe: Fix out-of-bounds access in vfe_isr_reg_update()

vfe_isr() iterates using MSM_VFE_IMAGE_MASTERS_NUM(7) as the loop
bound and passes the index to vfe_isr_reg_update(). However,
vfe->line[] array is defined with VFE_LINE_NUM_MAX(4):

    struct vfe_line line[VFE_LINE_NUM_MAX];

When index is 4, 5, 6, the access to vfe->line[line_id] exceeds
the array bounds and resulting in out-of-bounds memory access.

Fix this by using separate loops for output lines and write masters.

Fixes: 4edc8eae715c ("media: camss: Add initial support for VFE hardware version Titan 480")
Signed-off-by: Alper Ak <alperyasinak1@gmail.com>
Cc: stable@vger.kernel.org
Reviewed-by: Bryan O'Donoghue <bryan.odonoghue@linaro.org>
Signed-off-by: Bryan O'Donoghue <bod@kernel.org>
Signed-off-by: Hans Verkuil <hverkuil+cisco@kernel.org>
drivers/media/platform/qcom/camss/camss-vfe-480.c