Loading
drm/plane: Move range check for format_count earlier
stable inclusion from stable-v4.19.247 commit 4ab7e453a3ee88c274cf97bee9487ab92a66d313 category: bugfix bugzilla: https://gitee.com/src-openeuler/kernel/issues/IBP6CD CVE: CVE-2021-47659 Reference: https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?id=4ab7e453a3ee88c274cf97bee9487ab92a66d313 -------------------------------- [ Upstream commit 4b674dd6 ] While the check for format_count > 64 in __drm_universal_plane_init() shouldn't be hit (it's a WARN_ON), in its current position it will then leak the plane->format_types array and fail to call drm_mode_object_unregister() leaking the modeset identifier. Move it to the start of the function to avoid allocating those resources in the first place. Signed-off-by:Steven Price <steven.price@arm.com> Signed-off-by:
Liviu Dudau <liviu.dudau@arm.com> Link: https://lore.kernel.org/dri-devel/20211203102815.38624-1-steven.price@arm.com/ Signed-off-by:
Sasha Levin <sashal@kernel.org> Signed-off-by:
Wang Wensheng <wangwensheng4@huawei.com>