]> git.baikalelectronics.ru Git - kernel.git/commit
fbdev: nvidia: Fix potential divide by zero
authorWei Chen <harperchen1110@gmail.com>
Wed, 15 Mar 2023 07:18:31 +0000 (07:18 +0000)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 5 Apr 2023 09:16:42 +0000 (11:16 +0200)
commitd097d706140567f9298a52a4959740d10c92c1ce
treece6c0a4eeb304a8cf1f8da2c6313de482075400b
parent754efdc19b6195cd5e31419dba9590e6e2eb6139
fbdev: nvidia: Fix potential divide by zero

[ Upstream commit 92e2a00f2987483e1f9253625828622edd442e61 ]

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: Wei Chen <harperchen1110@gmail.com>
Signed-off-by: Helge Deller <deller@gmx.de>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/video/fbdev/nvidia/nvidia.c