Re: [PATCH v2] fbdev: sstfb: Error out if pixclock equals zero

From: Helge Deller

Date: Wed Nov 18 2026 - 13:56:09 EST


On 11/17/26 04:17, Xue Haolin wrote:
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@xxxxxxxxxxxxxxx
Signed-off-by: Xue Haolin <xuehaolin@xxxxxxxxxxxxx>
---
Changes in v2:
- Fix sign-off to use real name "Xue Haolin" to satisfy DCO.

drivers/video/fbdev/sstfb.c | 3 +++
1 file changed, 3 insertions(+)

applied.

Thanks!
Helge