Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp439973pxb; Wed, 24 Feb 2021 06:20:54 -0800 (PST) X-Google-Smtp-Source: ABdhPJzD9GvbE6ppBCfq20ownYoA+RER23gp5d2+kD/0oRpyoA/SmEiu8TIlFdV7s6CjsV6IeP8H X-Received: by 2002:a17:907:3d8f:: with SMTP id he15mr30658705ejc.238.1614176454250; Wed, 24 Feb 2021 06:20:54 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1614176454; cv=none; d=google.com; s=arc-20160816; b=tW7VRa67GAJn6MKlWZllHdHBXpIhy5GUPP3P8EuJPeYfG/VzlGWbwC65QJy7+dPxNR 244hPUeHyk4/hKMcCZKVkTG2vVzvu2YnAEfOH9ubalERK/XsHld0hFb++3FU3MGgqMsj VGRNhGAObDRm8OtfPoAmR0rHbYaKIMVYtXAOizPBLGYSgjPwTv4DMIvUTWbw8/yEZV97 8j9ezugNXSRCVO/5rKa/DngkYeGRgwksQSmkUMT7Ek2uG6l7VixuIih9MJaRU08pV+Q3 oV+vfKypac6uqVdgYM+FRc4O0yEdDqcuisQjmGI80CvREtZq0y+GGK9UZ/nsSg6NhzEd JSsQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=QcbE9Rw7lR+609NW9S8dovMUL4Wri+qlnU660vPOm+I=; b=Gv+I+nKcwfagcXFHVaaIutHLdAaF+TTAwriPIg4ozxbEtj3+f5bQei1j6EuFHlNL+v eUjW+rXxeqB/DGJMbf4k0KTA+aES2g8bDmzb9jpQ3QRhK1ooijNGCsIqo7oceUJZ5awm pp/wd+rrjLLZeM1BeSIbf3DNbXZK2UNVBh9DwTqFoB5QMfbK2KezAc45M1w4JZ5siPrF jS3xwRx0Aq71ur1xyPiTHqCsvO4Iy0DCwh4MSN4rDVIL5LGRqWmGrMsBn0mK4+ldlZji 9HbHLP83kLdKP5KzpSPQsKpiPpWffpgGtEvDrkukOoT3lfpYTAagkdq3TThRXJP/uYLI XObg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=D7VwWLKX; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id i2si1416991ejp.556.2021.02.24.06.20.11; Wed, 24 Feb 2021 06:20:54 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=D7VwWLKX; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236177AbhBXOPt (ORCPT + 99 others); Wed, 24 Feb 2021 09:15:49 -0500 Received: from mail.kernel.org ([198.145.29.99]:59786 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232726AbhBXNKf (ORCPT ); Wed, 24 Feb 2021 08:10:35 -0500 Received: by mail.kernel.org (Postfix) with ESMTPSA id 9AE6264D8F; Wed, 24 Feb 2021 12:55:17 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1614171318; bh=Hodl3P/Z2rwYON5zwFKUkrcQzjWsue/ipAK5ILCslgs=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=D7VwWLKXvMhEi7yMvbVqzotUP8GuubbIOzFpWi/p8DpLG1eIhNm2oY6AruF/Rs2Zu K1tH07o9qdvrDG7QHj8cQpx3f8vv/x+/gPe1bStgqUcUrOLDgW6jj4cdvEFHzI9fPt whXKaKkke9ApshFIas46dGzY2zSNA8kCbX2V0p5iDHAGR/JBaLqFhs+MxTPJXObLCj ifwc17lnO2iO/jjnijb1ed0cfsqkRpq50ON9PiI8HB7lHL8AJwfWqNtxKoU20p6uNR KNh38puKT8aa6NPvjwaxL1VuL0KLqK1vGVkKR/Ss/O4oMHxW4DdN0+f4hPg7PNRrRt KEXIZy5h21HuQ== From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: Jiri Slaby , Greg Kroah-Hartman , Sasha Levin Subject: [PATCH AUTOSEL 4.14 03/16] vt/consolemap: do font sum unsigned Date: Wed, 24 Feb 2021 07:55:00 -0500 Message-Id: <20210224125514.483935-3-sashal@kernel.org> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20210224125514.483935-1-sashal@kernel.org> References: <20210224125514.483935-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 a5f88cf0f61d5..a2c1a02f04078 100644 --- a/drivers/tty/vt/consolemap.c +++ b/drivers/tty/vt/consolemap.c @@ -493,7 +493,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