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=1796389394; b=JBHFbzAQZM1qSXF7tWWSkJh9uAtjM5fAediCV0mnXGbVK9JBvPLwRGHNQ6YK7pseUEQD wSBMc5pnqlpx/9l9tEQbgRqvesuFZfiQV0j2aDqRecLPumiOT/V8tcDCNOQRygqkWS5tr uuxLfZZJifAXgAAZBd+nDFE5NpGyza2vL2OdgdiEVszrazDBY0Rf5mtHehiijKhbOrjFo ii9+zRVt/7DjyqYQU5b0pbwkjdqzdXC/+i9dRfvg1FPFyKpVdi+UQd3zw1GxkPygPT9xw pISg7U4fNAPgIaHEPKb7Z3Y/M/0xlTzQNKCy9T1q8ZT7hTmivuUNLFXw93nmFAtkfzw== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796389394; 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=L+KVcHMTWYZjNAsQUK6l1oZJ7Z713VPTGHU1lMIeS0A=; b=yi/woat/NFmWB4wP3tj8RK56uiOnA5HVhKC1f+2/hlElGlhWU1gNikji/sumH2CIckuZ nkH8Q3tNS9wF/lOWPfrdMbmQt/xn0ZJoQx+CfANVkn9OA9JuzeetyLaSkKHvQOko72GGM l6LpUL5ATnFx21QoMMbP3GmC/C7xJuTwx2QH4aifT8guWS4GWMUr+r1VeEGKO2ax0d/eb GGsXPiwgOLt2rKBsY0Le4eNsy3EzCp1c45LJdOMePBqCLfj/rsfpxm2dbBweAV1S1XpRO VeusayE6omoEmwjSWsB8zvLX0SHk+dZ/sifC+9b7AfCy+W3buDZBdxm7sB2ixLTjszg== 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=yme429Q+; 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 E2E2F606A322; Fri, 4 Dec 2026 13:03: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=yme429Q+ Received: by smtp.kernel.org (Postfix) with ESMTPSA id D40E91F00897; Fri, 4 Dec 2026 13:03:12 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=korg; t=1796389393; bh=L+KVcHMTWYZjNAsQUK6l1oZJ7Z713VPTGHU1lMIeS0A=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=yme429Q+fqT2XAaNGJehHFoog85ZrZpnAiCEviuE323ufvYOER3O8dyGhw261cnWR NphA6d7ofLPIwod+bHGytKeLnybWdUPp4ja3P59RceJI5QA5xqrTm6AZ4ysUlkQyjD 6TxNlWfTyo7oiobVJerURgczRk1bZbd4IORePd9E= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Tim Douglas , Helge Deller Subject: [PATCH 6.1 0934/1059] fbdev: valkyriefb: keep the framebuffer mapping size fixed Date: Fri, 4 Dec 2026 19:07:45 +0900 Message-ID: <20261204100708.215882899@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: 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.1-stable review patch. If anyone has any objections, please let me know. ------------------ From: Tim Douglas commit fa9bebccf45571bd710b0591359b28d5354e7e7a upstream. When /dev/fb0 is mapped before a depth change, as with Xorg's fbdev driver, the mapping may be too short for the new mode. At 640x480, a full frame at 16 bpp is 600 KiB, so drawing it through the original 300 KiB mapping from 8 bpp can fault. Set smem_len to the usable video RAM by subtracting the 4 KiB offset already applied to smem_start, then keep that size across mode changes. On a Performa 6200CD using a kernel with local platform support, a write past the mapping caused a fault during an Xorg test at 16 bpp. With the corrected mapping size in the test kernel, twm and xterm were displayed successfully in Xorg at 640x480 and 16 bpp. In a test on a Quadra 630 in MAME with Linux v7.4-rc3, /dev/fb0 was mapped at 8 bpp and the depth was changed to 16 bpp with the original mapping still in place. A SIGSEGV was reported during the 16 bpp draw before the fix, and all 480 lines were drawn afterward. AI assistance was used to investigate the mapping size and draft the fix. Fixes: 1da177e4c3f4 ("Linux-2.6.12-rc2") Signed-off-by: Tim Douglas Cc: stable@vger.kernel.org Signed-off-by: Helge Deller Signed-off-by: Greg Kroah-Hartman --- drivers/video/fbdev/valkyriefb.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) --- a/drivers/video/fbdev/valkyriefb.c +++ b/drivers/video/fbdev/valkyriefb.c @@ -512,7 +512,7 @@ static void valkyrie_init_fix(struct fb_ fix->mmio_len = sizeof(struct valkyrie_regs); fix->type = FB_TYPE_PACKED_PIXELS; fix->smem_start = p->frame_buffer_phys + 0x1000; - fix->smem_len = p->total_vram; + fix->smem_len = p->total_vram - 0x1000; fix->type_aux = 0; fix->ywrapstep = 0; @@ -525,7 +525,6 @@ static void valkyrie_init_fix(struct fb_ static void valkyrie_par_to_fix(struct fb_par_valkyrie *par, struct fb_fix_screeninfo *fix) { - fix->smem_len = valkyrie_vram_reqd(par->vmode, par->cmode); fix->visual = (par->cmode == CMODE_8) ? FB_VISUAL_PSEUDOCOLOR : FB_VISUAL_DIRECTCOLOR; fix->line_length = par->vxres << par->cmode;