From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-19.0 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 91E78C4361A for ; Wed, 24 Feb 2021 13:22:17 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 575FB64ED4 for ; Wed, 24 Feb 2021 13:22:17 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236409AbhBXNU2 (ORCPT ); Wed, 24 Feb 2021 08:20:28 -0500 Received: from mail.kernel.org ([198.145.29.99]:51028 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235492AbhBXM5c (ORCPT ); Wed, 24 Feb 2021 07:57:32 -0500 Received: by mail.kernel.org (Postfix) with ESMTPSA id 4BAEA64F34; Wed, 24 Feb 2021 12:52:17 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1614171137; bh=gwmJfJHFQMZb4stTcDvb2N/nTiB+EB5lnMu0KDT1AWc=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=E164AVxZgFWtJfMVNDm1U0PeVP8BD1LDcoVE+uP3S2aZMEtbBJkAI+Y530ZLb+7lj ZHN+3b5KRbksVrCfAvEgZhAhrnt4aOsyXNwPjkFrYqDvpvYPJYDdWPfFD86NLTzTsr RFKWWDte7cnnu35CtAmL9CiSGw1jp3a8v+aPVG8RQ9g0SlojXn/rNz4smaHF6UkatF lgGjS44ZwhOuipssoUyy8OGlSg5o3xpB+mOqTiEmMAN3do0SSGhUUBj9z/YzQnEWZp I+CxFD5tASHtWHW9/KLjNPcjHI9rZe46yzA2+PW2BlKrRIBobmTz3zU9dv2yBdYbkx cDr3cIDJfUxkA== From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: Jiri Slaby , Greg Kroah-Hartman , Sasha Levin Subject: [PATCH AUTOSEL 5.10 04/56] vt/consolemap: do font sum unsigned Date: Wed, 24 Feb 2021 07:51:20 -0500 Message-Id: <20210224125212.482485-4-sashal@kernel.org> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20210224125212.482485-1-sashal@kernel.org> References: <20210224125212.482485-1-sashal@kernel.org> MIME-Version: 1.0 X-stable: review X-Patchwork-Hint: Ignore Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Jiri Slaby [ Upstream commit 9777f8e60e718f7b022a94f2524f967d8def1931 ] The constant 20 makes the font sum computation signed which can lead to sign extensions and signed wraps. It's not much of a problem as we build with -fno-strict-overflow. But if we ever decide not to, be ready, so switch the constant to unsigned. Signed-off-by: Jiri Slaby Link: https://lore.kernel.org/r/20210105120239.28031-7-jslaby@suse.cz Signed-off-by: Greg Kroah-Hartman Signed-off-by: Sasha Levin --- drivers/tty/vt/consolemap.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/tty/vt/consolemap.c b/drivers/tty/vt/consolemap.c index 5d778c0aa0091..8ba0dc51a1f17 100644 --- a/drivers/tty/vt/consolemap.c +++ b/drivers/tty/vt/consolemap.c @@ -495,7 +495,7 @@ con_insert_unipair(struct uni_pagedir *p, u_short unicode, u_short fontpos) p2[unicode & 0x3f] = fontpos; - p->sum += (fontpos << 20) + unicode; + p->sum += (fontpos << 20U) + unicode; return 0; } -- 2.27.0