]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
fbdev: savage: Error out if pixclock equals zero
authorFullway Wang <fullwaywang@outlook.com>
Thu, 18 Jan 2024 03:49:40 +0000 (11:49 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 1 Mar 2024 12:34:48 +0000 (13:34 +0100)
commitbc3c2e58d73b28b9a8789fca84778ee165a72d13
tree199577b2151869b33a5f6592014ec74996ce9f1a
parent54b79d8786964e2f840e8a2ec4a9f9a50f3d4954
fbdev: savage: Error out if pixclock equals zero

[ Upstream commit 04e5eac8f3ab2ff52fa191c187a46d4fdbc1e288 ]

The userspace program could pass any values to the driver through
ioctl() interface. If the driver doesn't check the value of pixclock,
it may cause divide-by-zero error.

Although pixclock is checked in savagefb_decode_var(), but it is not
checked properly in savagefb_probe(). Fix this by checking whether
pixclock is zero in the function savagefb_check_var() before
info->var.pixclock is used as the divisor.

This is similar to CVE-2022-3061 in i740fb which was fixed by
commit 15cf0b8.

Signed-off-by: Fullway Wang <fullwaywang@outlook.com>
Signed-off-by: Helge Deller <deller@gmx.de>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/video/fbdev/savage/savagefb_driver.c