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=1794065177; b=C94plAmCIMtQoGgOP1yQUbl3TRnmUpVJZN3udAK4nNXaLvgQk7nvy0blkiL1UrcLtXfU zJEQekSJh1hVZty5FkjSPBr/PlvG81HrJAX9gWeov7Ek6jW8N1BFViaijWGVnDriLuhHv AeYU6yfeCdhh3YQTGJFciKZSffsOf0mfIOVDD5k1M7xHA0ynfSLYRU34mKZw01c5G2VLh cbE7h/DoK05eJhHCUz6S8sjJqlk5boUIO57++zK6J6E29vG7klHFeCtcbGYfLG53Sp2Fl WMK2+FU8ICBYceTgsD/QuFslKaBpi9WTj60qbf3g5gpGBBbVOXCCAc/FBPqrmrIy9cw== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1794065177; 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=jBwfzlgSnTuk5845JS71NTUq/WrNJ0TxaWElT7um+vw=; b=j1lTAnWtmyjyzNyIur4Fp78M5Unv9eOqUKA/9Z5F06PnG9zVTQ680AnpkpDNElhBtxPH atKiapUdPhMtsQDV97N5Q9art7E7m1PU0LR4Zkzd98kxpb9CpgnEqe//AYeJ85ZKiXyhY QP9Ofzc3FvaElksBP53F/4nt1h6+dMcwxd1OzJwVTz1t7K006lu6NIRrX4eLlJ5TY1114 ZXTbCb51QynXeehFIwtbxh3wJ2w2c6bAlRZ4EKeUSlcW2lyYbTCuVMSscrVut73Wi4d5d TRDfJdinZtQQFmV+snmwVOyi1qRTskMUTurMCvtK2VvtqNsEJHH1P/b0lgHFq2DLMGg== 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=AlrOxvZq; 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 4FB62606A32E; Sat, 7 Nov 2026 15:26:17 +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=AlrOxvZq Received: by smtp.kernel.org (Postfix) with ESMTPSA id F37B01F0089F; Sat, 7 Nov 2026 15:26:16 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=korg; t=1794065177; bh=jBwfzlgSnTuk5845JS71NTUq/WrNJ0TxaWElT7um+vw=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=AlrOxvZqoZiJAXuZ1wirYkvTrpWMbzUMMX/P6nwIP9WKiTgUDGGdj3oj9bDFsqc4E gYEwK0d+vvp8Bw+PX36HwI9kwDwosTn6CtNVVS54u3BhPrzCUVpElK/MSSokrk3+ks SPfd338fEB4XOKBdPe+4TFBHDYbZtrLKRxU5J2OI= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Thomas Zimmermann , Tingjie Zhong , Helge Deller , Sasha Levin Subject: [PATCH 7.3 0975/1257] fbdev: bitblit: Fix glyph clipping when fbcon pans Date: Sat, 7 Nov 2026 08:54:31 -0500 Message-ID: <20261107135006.285577263@linuxfoundation.org> X-Mailer: git-send-email 2.56.0 In-Reply-To: <20261107134939.434104957@linuxfoundation.org> References: <20261107134939.434104957@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 7.3-stable review patch. If anyone has any objections, please let me know. ------------------ From: Tingjie Zhong [ Upstream commit 06fccf840640d8f6b0e08a1756f8d2f0435b4cbe ] Commit 3637d34b35b2 ("fbdev: Add bounds checking in bit_putcs to fix vmalloc-out-of-bounds") made bit_putcs() clip glyphs to var.yres. When fbcon scrolls by panning, it draws text rows up to var.yres_virtual, so after the first pan most new text is not drawn until the next full redraw. This affects fbdev drivers that set FBINFO_HWACCEL_YPAN or FBINFO_HWACCEL_YWRAP, such as vesafb with the ypan option, when CONFIG_FRAMEBUFFER_CONSOLE_LEGACY_ACCELERATION=y. Clip to GETVYRES() instead, which fbcon_ud.c and fbcon_ccw.c already use as the drawing area height. When fbcon does not pan, GETVYRES() returns var.yres, keeping the existing bound. When fbcon pans, it returns var.yres_virtual, which the framebuffer memory must cover anyway for panning to work. Fixes: 3637d34b35b2 ("fbdev: Add bounds checking in bit_putcs to fix vmalloc-out-of-bounds") Reported-by: Thomas Zimmermann Closes: https://lore.kernel.org/linux-fbdev/b8b52ffd-ecec-4fba-b432-ba32135c2f99@suse.de/ Tested-by: Thomas Zimmermann Cc: stable@vger.kernel.org Signed-off-by: Tingjie Zhong Signed-off-by: Helge Deller Signed-off-by: Sasha Levin --- drivers/video/fbdev/core/bitblit.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/drivers/video/fbdev/core/bitblit.c b/drivers/video/fbdev/core/bitblit.c index 39f44258d793f..323a9e79a684d 100644 --- a/drivers/video/fbdev/core/bitblit.c +++ b/drivers/video/fbdev/core/bitblit.c @@ -18,6 +18,7 @@ #include #include #include "fbcon.h" +#include "fbcon_rotate.h" /* * Accelerated handlers. @@ -150,7 +151,9 @@ static void bit_putcs(struct vc_data *vc, struct fb_info *info, const unsigned short *s, int count, int yy, int xx, int fg, int bg) { + struct fbcon_par *par = info->fbcon_par; struct fb_image image; + u32 vyres = GETVYRES(par->p, info); u32 width = DIV_ROUND_UP(vc->vc_font.width, 8); u32 cellsize = width * vc->vc_font.height; u32 maxcnt = info->pixmap.size/cellsize; @@ -167,10 +170,10 @@ static void bit_putcs(struct vc_data *vc, struct fb_info *info, image.height = vc->vc_font.height; image.depth = 1; - if (image.dy >= info->var.yres) + if (image.dy >= vyres) return; - image.height = min(image.height, info->var.yres - image.dy); + image.height = min(image.height, vyres - image.dy); if (attribute) { buf = kmalloc(cellsize, GFP_ATOMIC); -- 2.53.0