]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
fbdev: omapfb: Add 'plane' value check
authorLeonid Arapov <arapovl839@gmail.com>
Tue, 18 Mar 2025 21:19:52 +0000 (21:19 +0000)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 25 Apr 2025 08:45:20 +0000 (10:45 +0200)
commitfda15c5b96b883d62fb2d84a3a1422aa87717897
tree00bacc07aea6bdf1aba90286e4d6b7bd110bcde9
parent3ab9cd2d2e9ae89614ecf57dde11b14716f8fdaf
fbdev: omapfb: Add 'plane' value check

[ Upstream commit 3e411827f31db7f938a30a3c7a7599839401ec30 ]

Function dispc_ovl_setup is not intended to work with the value OMAP_DSS_WB
of the enum parameter plane.

The value of this parameter is initialized in dss_init_overlays and in the
current state of the code it cannot take this value so it's not a real
problem.

For the purposes of defensive coding it wouldn't be superfluous to check
the parameter value, because some functions down the call stack process
this value correctly and some not.

For example, in dispc_ovl_setup_global_alpha it may lead to buffer
overflow.

Add check for this value.

Found by Linux Verification Center (linuxtesting.org) with SVACE static
analysis tool.

Signed-off-by: Leonid Arapov <arapovl839@gmail.com>
Signed-off-by: Helge Deller <deller@gmx.de>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/video/fbdev/omap2/omapfb/dss/dispc.c