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=1796383814; b=xxE4eU/GwsHiMUYsDdAjtxqzevNldLbuwNKByVJwRs0UXs0/6Zp0WmAtpTbLkXPV1bvP bY/455d8rmjSBSiG3NA60RznxOnOstcIsqA1aG0gnAcMR9f8yKSITPtKM/j2AlwNjB0Z1 Ewjwh85UAcDQ6L/5az9i4U7vJ2Cnm+kHMcyu15/hZ84j4tMlUhQLRVxxxKey+nefEyV+w zWbcPImMBZsQ5WTTkgnce+C6oC/1ZUT9v2/14Fu/RwEhtolk4VG3l4A+O0333nCvobQEG 5XxBiY5ch93ionpAbJVFe+Ti7MyuiAztcCqDlV/ZZkQnFbyMoFoAQ6thcoPeNOTQFCg== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796383814; 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=S+/EhJX74duA+0Y+/ayFgOwgZq2ctLjcYPUkOAD5doM=; b=w86S2VBuweCsYJRTzJfyHNLJv7U3t3K+ucKJ7U0b+FfDh2edk5eUiEM7RGIobxokoySC KrUj3F9wGhD+3FkyiLDHa0ZTBaQn7i1qd1zjUAet6MmxGmQNbj3lR0EPZKoUEdFNw1W4V 92Sn0zFu4PrO/UyQh9CZIRt1IO4J2LjjA38nT1nFuvamHeuJSYZI0BNQk+/eX8kdQPkJl 0UnIky+V3uJJYPNN8XA+hotLM3nop0JUVlGEhYkMimfnnPpDRotYCSQAIIviUyHJeaMKh EkF3+p15t/Zyu90GSgYbYK7iIJFjHZQJlKTSMmgzvM7AbtV2m9BTXihwMuPv3VzS0cg== 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=L+rffQY5; 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 E15A9606A330; Fri, 4 Dec 2026 11:30:13 +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=L+rffQY5 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 24D361F000CE; Fri, 4 Dec 2026 11:30:13 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=korg; t=1796383813; bh=S+/EhJX74duA+0Y+/ayFgOwgZq2ctLjcYPUkOAD5doM=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=L+rffQY5Hi1KdJwLOfKHa1oPDsSd80zrhO26H4GuRmQDInEYOy7OC0j/kcmWyzwPt l/07AwARPcAKFI4PqkN6B064lvbE/MDeuoFkwG0XuRlZR6r8jAaf2Ci3p4rf0JQYkM VyXwrcye+r7/C0iuyNYR8D/eVqUpFSAJcvFZ+q7k= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Xue Haolin , Helge Deller Subject: [PATCH 6.12 379/555] fbdev: sstfb: Error out if pixclock equals zero Date: Fri, 4 Dec 2026 19:07:02 +0900 Message-ID: <20261204100624.277171595@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: Xue Haolin commit f37d206e145d25607c6a8e920d7bb643d203a1f7 upstream. 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 Signed-off-by: Helge Deller Signed-off-by: Greg Kroah-Hartman --- drivers/video/fbdev/sstfb.c | 3 +++ 1 file changed, 3 insertions(+) --- a/drivers/video/fbdev/sstfb.c +++ b/drivers/video/fbdev/sstfb.c @@ -359,6 +359,9 @@ static int sstfb_check_var(struct fb_var int tiles_in_X, real_length; unsigned int freq; + if (!var->pixclock) + return -EINVAL; + if (sst_calc_pll(PICOS2KHZ(var->pixclock), &freq, &par->pll)) { printk(KERN_ERR "sstfb: Pixclock at %ld KHZ out of range\n", PICOS2KHZ(var->pixclock));