summaryrefslogtreecommitdiff
path: root/include/linux
diff options
context:
space:
mode:
authorJianqiang Zou <jq.zou@outlook.com>2026-11-01 10:41:42 +0000
committerHelge Deller <deller@gmx.de>2026-11-19 17:57:11 +0100
commitb3f1631d362539cfe14571ccfd7db919ffbc08c7 (patch)
treeb87f0604a754775d35931713a6634c3e065f6c81 /include/linux
parentae14fe6f367a9779e108449b4af41791bd6aaa47 (diff)
fbdev: radeonfb: reject a zero pixclock in radeonfb_check_var()
radeonfb_set_par() derives the dot clock from the user supplied struct fb_var_screeninfo: dotClock = 1000000000 / pixClock; where pixClock is copied from mode->pixclock. A zero pixclock bypasses the existing validation and makes the kernel divide by zero in radeonfb_set_par(). The driver does have a check for this: fb_validate_mode() returns -EINVAL when pixclock is 0, but radeon_match_mode() only calls it when the output has no scaler and an EDID-derived mode database is available: if (has_rmx == 0 && rinfo->mon1_modedb) if (fb_validate_mode(...)) return -EINVAL; mon1_modedb is only filled in when an EDID is read, so when no EDID-derived mode database is available the validation is skipped and the invalid mode reaches radeonfb_set_par(). Reject a zero pixclock in radeonfb_check_var() before matching the mode. fb_set_var() calls it on the FBIOPUT_VSCREENINFO path before ->fb_set_par(), so the invalid value is rejected before the mode is applied. This is the same check other fbdev drivers use (i740fb, arkfb, s3fb). Reproduced on Linux 7.3.0 using a custom QEMU PCI stub device with vendor/device ID 1002:5955; no physical Radeon hardware was used. A single FBIOPUT_VSCREENINFO with pixclock = 0 is enough to trigger the divide error. Signed-off-by: Jianqiang Zou <jq.zou@outlook.com> Cc: stable@vger.kernel.org Signed-off-by: Helge Deller <deller@gmx.de>
Diffstat (limited to 'include/linux')
0 files changed, 0 insertions, 0 deletions