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=1796380904; b=C7KnTWJkML/wkYIg6RK2pBi1lBKR9JcY8+gu0rLwY8OipYQLqg159PxST0bkpvdQPv5U iMNIyejqg+5qEzcO+Pv4sqrgus21Bf49rl+8654t8xWUTU8xIgTP9l39Dagvw8gl6EqS0 cn+SAqp2hVHQiPzfMtxpYt3bwAfbOs+a75k7b8JxHV4mYE6CbBwD7aN3evk72RsAnFL0o vVce39iXVK2qITZmmhffMHsvnM2cYADZV5ZhHnHYU9oa6+gFpQKTCA1nMp9qaXrxceUWp Q5Q45qMqIrvBQpIFLPhdcbV2oP+1mzB4iaJ/g7FhmEP9DKjbdB5ECviOafkWmjndSkA== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796380904; 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=u0bC2XbaUaTlOclPHQwG8XWlFjusDqCWkOez13I+uIg=; b=3KtQ7fYnWWVpWlffCGd8Y7DL05bKjFTmi3k+2lBob2Q6Z/tq+WqA1IKMxyZwmjCj7lPW g1bHueP9nA3A1HmgHH+ZLWWuED3VQncYU3SQcfd7LCeh+Urz8ENyzTuTTHT5O5f3wbMhj biWQ4+iaYTPM+UNh+y+NJmNdajRvvu1nzrmbKGI3PDcPwADCcrlC57Te1ysURCQPRz4dx YQcJfxVVotLn5777FrAbqx2Q4R3YV3OJXKO7MEpWlUHRxoPABhmzue+j/2CHew2bBg0z6 xQmau7uYNQNKPdozMcIKiJWuOTCcddsuwjNa/ARy+Msd8s9cq/GzPXHe+rZtr/r33Cw== 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=FQNV3kKC; 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 8AF9B606A32C; Fri, 4 Dec 2026 10:41:44 +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=FQNV3kKC Received: by smtp.kernel.org (Postfix) with ESMTPSA id 022431F000C2; Fri, 4 Dec 2026 10:41:43 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=korg; t=1796380904; bh=u0bC2XbaUaTlOclPHQwG8XWlFjusDqCWkOez13I+uIg=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=FQNV3kKCyrzn2qrozzubkI2ijo+v+NDeuHP+E/fgtK9NOTRmDlndNzk9fpk6bVJrd jS1kB+xPezPH4zzS+MgFK4Lh4WAconbQSzqQw8Bp6DDGdyyEX+7ahbRNiJvJtJHDQS GzVpuCpdoM4Pam6ty0SJ60c0GS/t8yeyqbGhCIus= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Tim Douglas , Helge Deller Subject: [PATCH 7.3 473/742] fbdev: valkyriefb: keep the framebuffer mapping size fixed Date: Fri, 4 Dec 2026 19:05:37 +0900 Message-ID: <20261204100647.716830372@linuxfoundation.org> X-Mailer: git-send-email 2.56.1 In-Reply-To: <20261204100635.034361255@linuxfoundation.org> References: <20261204100635.034361255@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 7.3-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;