From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=100.103.45.18 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796383900; b=Ydn21dmJAb5sTiOzZspWp+aWOTXFiqMUghzFWFcQsfnZut0PiBvkGU8Za5ihCTw7NR+M eTHQzwxP3vGkepk6uBWZIAgR+v69vORT46L1VsTYynqs0bMK5PFcvLt4iYm9ODzRtezWJ N/l9+zmm9yzz55qzOCKdZZTZsVyeOd1ULRr62iEnCxROKsq6oHkyTOHL7DPyTaIh9E3EW VUROsO04Lt/CaaNwdPQZPoStTQfL62ImwxSCbuengCuJmc41xBvxAHwUUAF59oeHidVnN noYhoW+jdehWHjj+2hfHQoQIs6T8lFp8SOA9H/8d4IeqSkokoLHktMoS9BQrxzuNCow== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796383900; h=Received:DKIM-Signature:From:To:Cc:Subject:Date:Message-ID:X-Mailer: In-Reply-To:References:User-Agent:X-stable:X-Patchwork-Hint: MIME-Version:Content-Transfer-Encoding; bh=QVWBsthhN8Q2ZKj5BuKtruBKT9L2wdp1yH5H5RVg7f8=; b=0oh8fm1+jrLe9/rJufBKudgft7WgE04aNsCWNXVa4/mN0+qc1IKRHlhDkQajto3s2lil 8SHRR1SL/XYOOuommKraiLbyVq5Cdpocvh41Ws/O/izY8DQ57sC9emrtPImWTnSk57T+n Os/7fz5/soRMACLHEVgK1EuesP9qgrQKK3S/ayfhn1INlP1E62rG3RZgtr7O3NqQmceuz LTj7c6zx313viiLncwCPKrbLaPEBqSIDXH+f/zzkiKUPUt3iXYKmmaH5DR7PwCKpqrLA+ eNHLGAfFHI5OnSGhEGN4fIkmw5jlqGY4+jFecluio9wKyyYhs0BJm8zmV83KxHWuiDQ== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass header.d=linuxfoundation.org header.i=@linuxfoundation.org header.a=rsa-sha256 header.s=korg header.b=uoQS79db; arc=none smtp.remote-ip=100.103.45.18 Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id CDB0C606A33E; Fri, 4 Dec 2026 11:31:40 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.a=rsa-sha256 header.s=korg header.b=uoQS79db Received: by smtp.kernel.org (Postfix) with ESMTPSA id 08ADF1F00A05; Fri, 4 Dec 2026 11:31:39 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=korg; t=1796383900; bh=QVWBsthhN8Q2ZKj5BuKtruBKT9L2wdp1yH5H5RVg7f8=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=uoQS79db9vyGdl3VtyTPldOrnYf2FC033LrdrjKbXU8zM9B4vJRnMOQ6+ClcTYI5Z h6L3gnADFbYFKJNYpgRfQtgrGgcXqylV5p0ACQYykj5HaDfzI5EAoQy79cFruScE16 c6NGWXDWzFpTwRw9s5+ci0rihWN7Nabqp6rEWj/s= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Jianqiang Zou , Helge Deller Subject: [PATCH 6.12 375/555] fbdev: radeonfb: reject a zero pixclock in radeonfb_check_var() Date: Fri, 4 Dec 2026 19:06:58 +0900 Message-ID: <20261204100624.168951208@linuxfoundation.org> X-Mailer: git-send-email 2.56.1 In-Reply-To: <20261204100603.988357525@linuxfoundation.org> References: <20261204100603.988357525@linuxfoundation.org> User-Agent: quilt/0.69 X-stable: review X-Patchwork-Hint: ignore X-Mailing-List: stable@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 6.12-stable review patch. If anyone has any objections, please let me know. ------------------ From: Jianqiang Zou commit b3f1631d362539cfe14571ccfd7db919ffbc08c7 upstream. 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 Cc: stable@vger.kernel.org Signed-off-by: Helge Deller Signed-off-by: Greg Kroah-Hartman --- drivers/video/fbdev/aty/radeon_base.c | 3 +++ 1 file changed, 3 insertions(+) --- a/drivers/video/fbdev/aty/radeon_base.c +++ b/drivers/video/fbdev/aty/radeon_base.c @@ -836,6 +836,9 @@ static int radeonfb_check_var (struct fb int nom, den; unsigned int pitch; + if (!var->pixclock) + return -EINVAL; + if (radeon_match_mode(rinfo, &v, var)) return -EINVAL;