Commit 9bddf524 authored by Fullway Wang's avatar Fullway Wang Committed by Cai Xinchen
Browse files

fbdev: savage: Error out if pixclock equals zero

stable inclusion
from stable-v4.19.308
commit 224453de8505aede1890f007be973925a3edf6a1
category: bugfix
bugzilla: https://gitee.com/src-openeuler/kernel/issues/I9E2Y8
CVE: CVE-2024-26778

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



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

[ 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 15cf0b82.

Signed-off-by: default avatarFullway Wang <fullwaywang@outlook.com>
Signed-off-by: default avatarHelge Deller <deller@gmx.de>
Signed-off-by: default avatarSasha Levin <sashal@kernel.org>
Signed-off-by: default avatarCai Xinchen <caixinchen1@huawei.com>
parent 58daf587
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment