From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id BC614344D9D for ; Tue, 12 May 2026 13:45:52 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1778593552; cv=none; b=Ztl+9C+I6Z7M1Tq0mwd4X/MOM5TWGYF7tdqmTpBKSdJvrScg91SDKi/Yv80vZLKZak8ll/vgpJON5VnGWvZ5cvkB3BhPsmSRSxpWkytQEa7Sq4UAMZFdDBB8lJY0HAyYjJHtDQubxS4zEyeWipmgGMdGQmMCgkd9fY6vvMkIYOA= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1778593552; c=relaxed/simple; bh=DLkwUs2/AoTW8ztDC+LnQJR/o+BR7nV3utDlxzxYrUo=; h=Subject:To:Cc:From:Date:Message-ID:MIME-Version:Content-Type; b=pqCU7RPnop+AK3A98vNm/S5AmhiO1d7Tr9T58/k7gkL8cvUxxrBJbwdQAkSN9+/f+fEjNEKzzcuRvarjzgQ1noSbwahfKbN6K7+xDOIv7tAW8f9h5jvtey+hnkQ//yBNo9fuJi2dP+eLrJQle8g1miUhO6Dc9HjxaHeyrEGvLck= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=HpjFYmGe; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="HpjFYmGe" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 17806C2BCB0; Tue, 12 May 2026 13:45:51 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1778593552; bh=DLkwUs2/AoTW8ztDC+LnQJR/o+BR7nV3utDlxzxYrUo=; h=Subject:To:Cc:From:Date:From; b=HpjFYmGespr8jxOaqbWJZagaHwGmxP2DoR37u1hrUzbaV2KAESj1h+CFGLN4n1L8Y b8A5M2WLncqwk5OT6coCfeqWalgHKoLwKWNgqvuPI/mIYYX+4V79Xv2ZjT9+3sKYZD IBkYKMH1bmx/7d/BAsfX0iuFIyp+r5EhE4tT6GYA= Subject: FAILED: patch "[PATCH] fbcon: Avoid OOB font access if console rotation fails" failed to apply to 5.10-stable tree To: tzimmermann@suse.de,deller@gmx.de Cc: From: Date: Tue, 12 May 2026 15:45:42 +0200 Message-ID: <2026051242-unused-clone-b894@gregkh> Precedence: bulk X-Mailing-List: stable@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=ANSI_X3.4-1968 Content-Transfer-Encoding: 8bit The patch below does not apply to the 5.10-stable tree. If someone wants it applied there, or to any other stable or longterm tree, then please email the backport, including the original git commit id to . To reproduce the conflict and resubmit, you may use the following commands: git fetch https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/ linux-5.10.y git checkout FETCH_HEAD git cherry-pick -x e4ef723d8975a2694cc90733a6b888a5e2841842 # git commit -s git send-email --to '' --in-reply-to '2026051242-unused-clone-b894@gregkh' --subject-prefix 'PATCH 5.10.y' HEAD^.. Possible dependencies: thanks, greg k-h ------------------ original commit in Linus's tree ------------------ >From e4ef723d8975a2694cc90733a6b888a5e2841842 Mon Sep 17 00:00:00 2001 From: Thomas Zimmermann Date: Tue, 7 Apr 2026 11:23:12 +0200 Subject: [PATCH] fbcon: Avoid OOB font access if console rotation fails Clear the font buffer if the reallocation during console rotation fails in fbcon_rotate_font(). The putcs implementations for the rotated buffer will return early in this case. See [1] for an example. Currently, fbcon_rotate_font() keeps the old buffer, which is too small for the rotated font. Printing to the rotated console with a high-enough character code will overflow the font buffer. v2: - fix typos in commit message Signed-off-by: Thomas Zimmermann Fixes: 6cc50e1c5b57 ("[PATCH] fbcon: Console Rotation - Add support to rotate font bitmap") Cc: stable@vger.kernel.org # v2.6.15+ Link: https://elixir.bootlin.com/linux/v6.19/source/drivers/video/fbdev/core/fbcon_ccw.c#L144 # [1] Signed-off-by: Helge Deller diff --git a/drivers/video/fbdev/core/fbcon_rotate.c b/drivers/video/fbdev/core/fbcon_rotate.c index 1562a8f20b4f..5348f6c6f57c 100644 --- a/drivers/video/fbdev/core/fbcon_rotate.c +++ b/drivers/video/fbdev/core/fbcon_rotate.c @@ -46,6 +46,10 @@ int fbcon_rotate_font(struct fb_info *info, struct vc_data *vc) info->fbops->fb_sync(info); if (par->fd_size < d_cellsize * len) { + kfree(par->fontbuffer); + par->fontbuffer = NULL; + par->fd_size = 0; + dst = kmalloc_array(len, d_cellsize, GFP_KERNEL); if (dst == NULL) { @@ -54,7 +58,6 @@ int fbcon_rotate_font(struct fb_info *info, struct vc_data *vc) } par->fd_size = d_cellsize * len; - kfree(par->fontbuffer); par->fontbuffer = dst; }