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=1796389407; b=KdxrSEm/y1gnJQwOWeUKeAPaRLW8NOMZ4K3ajMZfXyZy21eaLAKPahuSgMEqIoDLkwF9 FeB/1r3JpEfZWn1L3EOxED393RD9SgXFqdaaYo1XF4TCfvq+d8Z0ZnLAXhtNIMFALcN3N O4PFe7D+z3IXyN86IQOPZV8fBFn1h2QKb+LGp7i7mG2LusVZQ3WY1+HQYS9W5lc1QwUtK kSz/mcytRnYuVQVm1KM62ZKU2wVTEoOS7ZtvG5QqbHuKBliXNgDD1j1fNSpPa4TfLDimn QUlMA3mOFBSg2VG2ZPLwqdeaFuiGdwvSp7khwYKJKGHOAhV+ggNuHP8InDCTUjdoKSw== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796389407; 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=+6Y+NHJioDnmogRXBj52MJMxRLJ1CdzndPSaVdbF3NE=; b=hyMZ+KIabf+zCSSl4JqL/3XFWdPPQdto7jjVU/+FyhrxHw48J+2z/6J6IKQZ+tdnpYwS SGxiX+sT8G2Jo1vPLiyysCzl3a7iXzi1cM4bto13JjU0JlYsxI3Zze+1HfLRH+y+EFMyO mtc6qHcf6px36TI2xPwCox1oA0SQtju3yYcEfB4dGzDduXiqkLZhaHiQmPfQq3SO6AXFm qIqR6K7jpUzrAcjI4yVFEJGX2TXq12Jf+QvXx8AcR0hjWHY+KdRxw5xI9sG4av2jWCRfn eboGlXJsZB7P3V9kre9xAPzovKj2Bl6AqBol1fpIvpAm2MGLquLkOdx6dRy+VlvhxlA== 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=I1MIgbFU; 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 5EDFA606A322; Fri, 4 Dec 2026 13:03:27 +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=I1MIgbFU Received: by smtp.kernel.org (Postfix) with ESMTPSA id 5A9691F0092C; Fri, 4 Dec 2026 13:03:26 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=korg; t=1796389406; bh=+6Y+NHJioDnmogRXBj52MJMxRLJ1CdzndPSaVdbF3NE=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=I1MIgbFUqANOHPfrlJ5sfEqrhWTJOqOQUYU9jPaIKFRAPwrDXt7Y45GBcYevbDecB WYlGCxQdaXDViCykxhnxampQptY6G37LXrYzCousSY/sPbA9B4Vj+mWKb7vFbGnAIP g5tSOFxHHXbf9XFkVY/Cdh/Mrw4kDrPtbSvRmPOo= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Jianqiang Zou , Helge Deller Subject: [PATCH 6.1 0929/1059] fbdev: radeonfb: reject a zero pixclock in radeonfb_check_var() Date: Fri, 4 Dec 2026 19:07:40 +0900 Message-ID: <20261204100708.086684408@linuxfoundation.org> X-Mailer: git-send-email 2.56.1 In-Reply-To: <20261204100643.980430235@linuxfoundation.org> References: <20261204100643.980430235@linuxfoundation.org> User-Agent: quilt/0.69 X-stable: review X-Patchwork-Hint: ignore X-Mailing-List: patches@lists.linux.dev List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 6.1-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;