Commit 6487b4e0 authored by Wei Chen's avatar Wei Chen Committed by openeuler-sync-bot
Browse files

fbdev: nvidia: Fix potential divide by zero

stable inclusion
from stable-v5.10.177
commit 78eb964805f9ed40270a3c9339d68d7715cea18f
category: bugfix
bugzilla: https://gitee.com/openeuler/kernel/issues/I88YNP

Reference: https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?id=78eb964805f9ed40270a3c9339d68d7715cea18f



--------------------------------

[ Upstream commit 92e2a00f ]

variable var->pixclock can be set by user. In case it
equals to zero, divide by zero would occur in nvidiafb_set_par.

Similar crashes have happened in other fbdev drivers. There
is no check and modification on var->pixclock along the call
chain to nvidia_check_var and nvidiafb_set_par. We believe it
could also be triggered in driver nvidia from user site.

Signed-off-by: default avatarWei Chen <harperchen1110@gmail.com>
Signed-off-by: default avatarHelge Deller <deller@gmx.de>
Signed-off-by: default avatarSasha Levin <sashal@kernel.org>
Signed-off-by: default avatarsanglipeng <sanglipeng1@jd.com>
(cherry picked from commit c0603cfc)
parent 611eb441
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment