diff options
| author | Xue Haolin <xuehaolin@uniontech.com> | 2026-11-17 11:17:14 +0800 |
|---|---|---|
| committer | Helge Deller <deller@gmx.de> | 2026-11-19 07:08:56 +0100 |
| commit | f37d206e145d25607c6a8e920d7bb643d203a1f7 (patch) | |
| tree | 51e87140c07ea812ce11ab67a73e2c2496d6f26d /rust/kernel/alloc | |
| parent | f0486dd91e27d2eaf62abbd0c2af73a9c04eac48 (diff) | |
fbdev: sstfb: Error out if pixclock equals zero
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.
sstfb_check_var() calls PICOS2KHZ(var->pixclock) which expands to
1000000000UL / var->pixclock. If var->pixclock is zero, this causes
a divide-by-zero exception.
Fix this by checking whether pixclock is zero at the beginning of
sstfb_check_var(), before it is used as a divisor.
This is similar to CVE-2022-3061 in i740fb which was fixed by
commit 15cf0b82271b ("video: fbdev: i740fb: Error out if
'pixclock' equals zero"), and the fix in savagefb by
commit 04e5eac8f3ab ("fbdev: savage: Error out if pixclock equals zero").
Fixes: 1da177e4c3f4 ("Linux-2.6.12-rc2")
Cc: stable@vger.kernel.org
Signed-off-by: Xue Haolin <xuehaolin@uniontech.com>
Signed-off-by: Helge Deller <deller@gmx.de>
Diffstat (limited to 'rust/kernel/alloc')
0 files changed, 0 insertions, 0 deletions
