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=1796382375; b=TMJHyJMUiTPqa7Y9bnmB1Xn82TvNpMzaSKUym0gLEuKT6NN7W8hldqYxvX2kgWx86ZNK nMFoRbKOzCfO+Z8kr25IR9CJ2k0n5mVVj/LnAgJI6u4012kLvsAYr7cX1DC/tOjeF0kxM NjugHhir+2GYbYpwe+HvNebjUicAY/JhluXcqKyiwyHK5xwPsZEO9FvbbWbwof8VYsbJ5 G8OefYhFdLi6BPycPkV3Ik3MfFng1ZxaWBQVzWlSlyikgk1q5+rIG81kG0akey0au+pjz ISz8u0/w0/m+squtiLvx2b/srTHvGWoFFTuV1DI+vsAdTQhUtLTt+Tv5Fb/0pYUIQLA== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796382375; 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=AHp68gF2vG5XBGkT6sWbo2ZuQRDU3OFDomHwOg0owt0=; b=MVXGte873ZcLmB81v4AnqD/9EpGpqWLnJVVEWKwd84oEHCU3Z1FhuTIAa3kW0MvhAnWU oS1PzAZvX4z2wJx99kBkSuH3QtBnuwQ/QDUidO4QTKP0fSm7V2wjQ2mJbkqraquzzwLdc SXM1umRlG1qezhoTX5fgStm2BgsWgqYvfSy5F/vV8xPqM+vgLDoNyb1GReZX0F2LTNNcO B4ihBATUJfKrcVLZBGhvreuoOrk3uY7WBpDyfZGE05S6cQJfRf/iPT4XKAO2ept9ghiMv DZ8VmZmwvt3LowvjNT/dYUiDkGiZZGJ7D4nEfbCirbAWpDOSIp2Cg139ssM9tYQnrnQ== 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=GcTjgyv9; 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 1E758606A322; Fri, 4 Dec 2026 11:06:15 +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=GcTjgyv9 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 8ACCA1F000C2; Fri, 4 Dec 2026 11:06:14 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=korg; t=1796382375; bh=AHp68gF2vG5XBGkT6sWbo2ZuQRDU3OFDomHwOg0owt0=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=GcTjgyv9zCRZiEezqTyQUyIBgvIWi2Jdwep64RIZsUcParQOUPJot+ReoJwagntS4 YlXFiWs8YCD6AGAhHW9/1Pzb2rtaA1pmjsEfWun1yysOY7mXimKq1w/pftUhIJ/C1C 4KxnU0JwaimMFdXhXghTIiYlRo8r/AYmrfUArHWQ= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Tim Douglas , Helge Deller Subject: [PATCH 6.18 426/703] fbdev: valkyriefb: keep the framebuffer mapping size fixed Date: Fri, 4 Dec 2026 19:05:25 +0900 Message-ID: <20261204100639.154628173@linuxfoundation.org> X-Mailer: git-send-email 2.56.1 In-Reply-To: <20261204100627.522266145@linuxfoundation.org> References: <20261204100627.522266145@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.18-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 @@ -510,7 +510,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; @@ -523,7 +523,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;