From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-dy2-f5.google.com (mail-dy2-f5.google.com [74.125.229.5]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 2146B4AA031 for ; Mon, 19 Oct 2026 09:44:00 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=74.125.229.5 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1792403041; cv=none; b=ZCIVMl1KrtcNlKzCdDYqiEfOb+nStEPRGmI2Bmm9/OQmpB2LRC9XWTBqmEAIB87WnOFP9hw3gz3KDBlaUVdwwmnsz18/xzu91HGYgYbj9XGbk6JWO4IKS8Gc4wRo/EreKwhZZC5w0RuovZwYQdcpDnzPTl1ZRNMsUNvUnOOuVKM= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1792403041; c=relaxed/simple; bh=eF9ybIO73BvXJx/tfM15TxxY0Adrd/pDfCRrQG6zpJs=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=BrYMZEJNzGPU0BZykg9j8swT3Qr3lRN3A1ruk8pZdTTht2gBm0rGm41YCNMalwhPmD29hnKzgxkVfOW1o+OJEem9ZMPRGGYoidm04m46X+7GJTMX9xO1fNnbHC8wZf9PB98cs9L87ZEcH1MGyfl8CVHUsw8bnVRNX4lPI9u6y2I= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=CZLHAr+5; arc=none smtp.client-ip=74.125.229.5 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="CZLHAr+5" Received: by mail-dy2-f5.google.com with SMTP id 5a478bee46e88-3535a54c09bso1862535eec.0 for ; Mon, 19 Oct 2026 02:44:00 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1792403039; x=1793007839; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to:content-type; bh=SS9kJ1jH1xG6CLAUi3XRMYbxFYxyeHVEus5/yx1itww=; b=CZLHAr+5SX+9O1+UKYUHozqaxF2RfMchhttSCgzxcKinJil1RdzUOe07aDVb89Dfsi ONyShNKWZhj4smiq1Cm8hyyN5E2sRgdpHp0mln5BucMZtPhbmILte6x1yK9sLQQvIIe7 Q8IRR+fb+Gqe2GB9lwtoYS4DpAbIDF5dlOH6iUKoNfS0JWxeqYlCTCjE06kH8lcAZl8O r1BOSBW5oqmyA67DDa/5yX5gkDGmdj4sqAKc4CmCNycam4OvLSudgfllbg3LiEnjhWIS XqIJOI3m2k6YEPrQYQ2mZVbp7tuchL7XHn1XavSIEX7Qq5mUgic/Dz19Mq1OtiyHvFTM 9Rew== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20260707; t=1792403039; x=1793007839; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to:content-type; bh=SS9kJ1jH1xG6CLAUi3XRMYbxFYxyeHVEus5/yx1itww=; b=TqDPvuy0BFcxVGHw1Wo1xVxgfFqZKhUE/tyiOHntf18rHLeXUHXJ3CQILxwOCkC9av 2nMmUvZAcddDc8qVEN2rxiRW3slPNpXrf/JtaO466Eq303bGKwpRGqq59GO4OeVJBIhM b7ZjH2+pNzaV0ybxcsA5SGTRvpj4Bl+XizaDh9GED/osNiQjpLhFdzbNkb1vaeYTB2sb +2sT1nBH7SO4PE0yw0T03cbPnP4rQcB9tTy8tryQQxUGT5h4mexSQ2un60TQaI5XjCM9 FLLvjmQzkSMf8+cJaNLabu1P6LumFw8qcCoqyka/AksJTlir52XGNx3JaPwbDO5ygtkA XxZQ== X-Forwarded-Encrypted: i=1; AKwUvByFpVQOqytKAdYGe7uvL2zN9bdALTiWSC3SmnqYdWaq7DD63YKWFWi7k70QEPobMor93CoUUTdUBsgl0do=@vger.kernel.org X-Gm-Message-State: AFq9FYIkkwmY7ko5fcRgJGRSHvH6Au7J1jAbmcojYv31aSge+2LA6zrT IL25GZiIJrDKU3DNDEwwtxOweS/eNuwLbmBhaGvmysEq64D7dRQxiaS7 X-Gm-Gg: AYBFou3ScTIehk/sxsrgbt5JwvqfSwCL4OZV36KgHNftfuC7obw8JeyFf0DGxD+mle1 /do60Y+2LhBt1pUUpyKdvtqeM7sazshLoeFxZstBG+uTQXGSHd6fSNwcTALAKADZDebWaPIvTze 1jp/+oBO5Zf1H5L3ncBboo7J+R8hMll7rm3e3a5+h1dsJxPzu52N84eAJU0k9g3QWft3gVBUQ/a cPDqvBwU98xdnZDvaeMySOSOYpfU4lCuhVKYieMvCgRf7M2pl0+Tu3rYlmoOKZkBoESB/VOdT7Y 54/qcMYEJZSnm7ao8e1U8NtMi03Pe9IYuCIkgUuh6p4QRgWfMoTRls1XHqbwHwWFRzrnJgt9ZGC /aAWZ9i618FSYZmL60qUv0O7lssRHOenkynFIzul7yoZcQejQwTcLaQjeyVyxTbByD4R6+CO91H cfAtsOGejLvKVjEwnuYNFebRMNuL7Y2gU/ISAB79zADfDbHAMEt0jhTWkjKNcw0oCLusSjLTNdE z5DbqHd/Pb9qXbWgiDY+qWSRfyTzc66TGk= X-Received: by 2002:a05:7301:6404:b0:360:f13a:ff0e with SMTP id 5a478bee46e88-361a1b539f1mr10748987eec.23.1792403039178; Mon, 19 Oct 2026 02:43:59 -0700 (PDT) Received: from blue.tailcc13ef.ts.net (104.194.64.109.16clouds.com. [104.194.64.109]) by smtp.gmail.com with ESMTPSA id 5a478bee46e88-3607bc950f9sm34370074eec.0.2026.10.19.02.43.56 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 19 Oct 2026 02:43:58 -0700 (PDT) From: Yao Yiqi To: deller@gmx.de, tzimmermann@suse.de, simona@ffwll.ch Cc: dri-devel@lists.freedesktop.org, linux-fbdev@vger.kernel.org, linux-kernel@vger.kernel.org, yaoyiqi3@huawei.com, Yao Yiqi , stable@vger.kernel.org Subject: [PATCH v5 3/3] fbcon: Retry rotated font allocation after failure Date: Mon, 19 Oct 2026 17:43:31 +0800 Message-ID: <20261019094331.1128871-4-yyaqia@gmail.com> X-Mailer: git-send-email 2.56.0 In-Reply-To: <20261019094331.1128871-1-yyaqia@gmail.com> References: <20261019094331.1128871-1-yyaqia@gmail.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit From: Yao Yiqi fbcon_rotate_font() records the font, its geometry and the rotation in par->rotated before calling font_data_rotate(). If the allocation fails, the error path clears par->rotated.buf, but the recorded key already looks up to date, so the next call takes the early-out and never retries. The rotated putcs/cursor ops keep returning early on the NULL buffer, and the console stays blank even after memory is available again. Also test par->rotated.buf in the early-out, so a failed allocation is retried on the next call: at the next fbcon_switch(), fbcon_modechanged() or font change. Fixes: e4ef723d8975 ("fbcon: Avoid OOB font access if console rotation fails") Cc: stable@vger.kernel.org Signed-off-by: Yao Yiqi --- drivers/video/fbdev/core/fbcon_rotate.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/video/fbdev/core/fbcon_rotate.c b/drivers/video/fbdev/core/fbcon_rotate.c index 660a3fa81bae..7afd63dcee7b 100644 --- a/drivers/video/fbdev/core/fbcon_rotate.c +++ b/drivers/video/fbdev/core/fbcon_rotate.c @@ -25,7 +25,8 @@ int fbcon_rotate_font(struct fb_info *info, struct vc_data *vc) par->rotate == par->rotated.buf_rotate && vc->vc_font.width == par->rotated.buf_width && vc->vc_font.height == par->rotated.buf_height && - vc->vc_font.charcount == par->rotated.buf_charcount) + vc->vc_font.charcount == par->rotated.buf_charcount && + par->rotated.buf) return 0; par->rotated.fontdata = par->p->fontdata; -- 2.56.0