Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp782945pxb; Wed, 24 Feb 2021 15:12:18 -0800 (PST) X-Google-Smtp-Source: ABdhPJxBk0EEp+KQ0fXhUCvLh6hWZ8EUazDrwpw0eN1vg7+8X5UEVK7f1rBV7k5rkDev/87JoyDM X-Received: by 2002:aa7:d8da:: with SMTP id k26mr175038eds.364.1614208338147; Wed, 24 Feb 2021 15:12:18 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1614208338; cv=none; d=google.com; s=arc-20160816; b=M0EXMWOAYIEqlEko7C4KzN3lE59XmVn9COqDWTyv2X2w28rTeW11CsUgeOJzF1Wqkv 1m6G2/4j2RC8TKfopvRdKf66IF9gPh26PdM1I3olUVFJov/eje0TURE6frbx75YLg5+d h0LdAxtb5U0OytFPavsFWj14+EHVRaPGQXbRCG8VPmvo/4d1NGRaFk/HufcMt5jCEnN0 wV4DOg+GxWN36i/P6f9i87a2tBdL2CF0KPcV78JCV4kymgvlz4RPa/jwELDzQP8Sch9h Hnd4MKyb0SF3MpeylFKFvh1JPbBRavlOF4w3zaYafrAdjSEzNA0EbO25Ce/XhGm1baT1 eyMg== 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=4NA+b3mjVQG1CrzNEjgd+95neauSUOuIM2oURkrC4rY=; b=qS27iUYsh+tLYJ/Oc1DvjuBT0whuA1ozYIcGBwb8elNgelUATIvG9yVCsyUsYBfqNf 83ym3LHw0JPrQFoxiZzjFhC1CqZTRkoN1YbjmKbuX4ziMfGir7lWCQJS5IRM2rVWq901 7jGx0imqFujxOFBul6ZDvhzUVH00EPGuY7cD8T5DJgF7yyjOD/4S4kPU3P8w6nCzYtaf ZaBSdP8f++oLyBnC1dn5gD+1aQ5m4NyhY/X3ntQXWZhka5V6V9+u3Urwbz3o61Rk+WGV iNvdrpgYynOKN1eSeTBjvDBdPAw36wiWqpkCAV9+aslQQWN0x9JxlQ1HVJZgIvIghjpj DnEQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=AxBV5KvW; 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 s22si2113181edd.456.2021.02.24.15.11.55; Wed, 24 Feb 2021 15:12:18 -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=AxBV5KvW; 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 S237419AbhBXNkO (ORCPT + 99 others); Wed, 24 Feb 2021 08:40:14 -0500 Received: from mail.kernel.org ([198.145.29.99]:55808 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235589AbhBXND3 (ORCPT ); Wed, 24 Feb 2021 08:03:29 -0500 Received: by mail.kernel.org (Postfix) with ESMTPSA id EE39964F6D; Wed, 24 Feb 2021 12:53:43 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1614171224; bh=RAoTi5Dprf/uf0+U4QNMVYiDmLtb4puaDr//W+I7JZQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=AxBV5KvWnwLl6AWXGFzeidYq6h2HxMjcL5yd0OQyJolbLCa5ms+lDUWQRZItuhn8Z tAqfT8P+nOK+3qIsPGGQyITCWLuZYJlR4CY1xyZlRC0mUJ4ri5o0FrbLxr4Kvg06Vq eXrnP3CIQFMnKaPj0Q6FxdJa/AO5Iu2e+OD1qa/3j/h2uvLwubgHv2smrxLX2JjTny CuenJZ1bcgn6s1PrDr8COvYrNzp1ru707b86yHOCkxoG+p7l9YIsucE2XmcUnUr33J D+gxAHgRMRviJ2XJ4pHniQMIiyJY87A9p6qXnnkjw5wdHiOQTgOPkN4yE4GR68pSRt pNG+48kF2zG4A== 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.4 03/40] vt/consolemap: do font sum unsigned Date: Wed, 24 Feb 2021 07:53:03 -0500 Message-Id: <20210224125340.483162-3-sashal@kernel.org> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20210224125340.483162-1-sashal@kernel.org> References: <20210224125340.483162-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 b28aa0d289f89..251c02af1fc3e 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