Loading
drm/msm/mdp5: Return error code in mdp5_pipe_release when deadlock is detected
stable inclusion from stable-v4.19.247 commit 776f5c58bfe16cf322d71eeed3c5dda1eeac7e6b category: bugfix bugzilla: https://gitee.com/src-openeuler/kernel/issues/IBP1O4 CVE: CVE-2022-49490 Reference: https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?id=776f5c58bfe16cf322d71eeed3c5dda1eeac7e6b -------------------------------- [ Upstream commit d59be579 ] mdp5_get_global_state runs the risk of hitting a -EDEADLK when acquiring the modeset lock, but currently mdp5_pipe_release doesn't check for if an error is returned. Because of this, there is a possibility of mdp5_pipe_release hitting a NULL dereference error. To avoid this, let's have mdp5_pipe_release check if mdp5_get_global_state returns an error and propogate that error. Changes since v1: - Separated declaration and initialization of *new_state to avoid compiler warning - Fixed some spelling mistakes in commit message Changes since v2: - Return 0 in case where hwpipe is NULL as this is considered normal behavior - Added 2nd patch in series to fix a similar NULL dereference issue in mdp5_mixer_release Reported-by:Tomeu Vizoso <tomeu.vizoso@collabora.com> Signed-off-by:
Jessica Zhang <quic_jesszhan@quicinc.com> Fixes: 7907a0d7 ("drm/msm/mdp5: Use the new private_obj state") Reviewed-by:
Rob Clark <robdclark@gmail.com> Reviewed-by:
Dmitry Baryshkov <dmitry.baryshkov@linaro.org> Patchwork: https://patchwork.freedesktop.org/patch/485179/ Link: https://lore.kernel.org/r/20220505214051.155-1-quic_jesszhan@quicinc.com Signed-off-by:
Dmitry Baryshkov <dmitry.baryshkov@linaro.org> Signed-off-by:
Sasha Levin <sashal@kernel.org> Signed-off-by:
Zeng Heng <zengheng4@huawei.com>