Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp1977668pxb; Fri, 5 Mar 2021 04:37:07 -0800 (PST) X-Google-Smtp-Source: ABdhPJyOPSGMFIUYxnpLq479mB0rgQEbFNkG5YbptUZ+fkRTWAa2Mp1dhE2+VltjWVPM/mGhAAUH X-Received: by 2002:a17:906:32d1:: with SMTP id k17mr1560566ejk.94.1614947826820; Fri, 05 Mar 2021 04:37:06 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1614947826; cv=none; d=google.com; s=arc-20160816; b=QExW8kI1cLnnbj8+IKH4w0k73qLrDvN0+l7BStAvoldxU+Ctks4oUOMRS76yIMQWXL jq/X45Q4V8BI8OJz8/t3+fAjVkNdZH/2v/ZWxkbco5ioqU79YeVJtfGbv16la/lz6Xn+ 1zJ1kCRoXwTCMnbi657XElA51tWDnFnJOZVZmONek7QnmLmVWRvz8quaUFPxl9K6jNFL 454oFfknQ6faClxnmccvaddBU2P/FhruXEZPK7hgQyphH1h00lMfKIOTG5SjmJSciGsD aamInhsBsn7qaQH/VN9O0beGFWw2w+Cu9Q/1XSjNhZ+19OtJohiTGtcdoAgCeqpH26/D 6RtQ== 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 :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=dLwWbZgQhuEWM+yHA+bWB0c90Nx5036Fuv7QqUV/HvQ=; b=OddFgtTP4zCpBADrfz6CKp2Vn5Odiqf0n1qSFnlwary50rp7PXNDmFI7S+3jGjU/ct vVHGF0OzHsyAFAedWVo+g7nUmC6wVe0Khr8GULJaaNBzJrVHQD5FiLj2C4q+h0XyD/No dnLBaFSU+bBoBC/kPAU9P2FnBWhQrsANBTFVlgNT7p+1gZhRWD0EIicDFR4iUzG0o1Sv 1Y4lL5On/6QIR8H0TGBkNjntuPFxLqVZnh6r7UgAEMdcvyuGdJS1zZDEhSaQD7NRh2ye kc8Ony7EDys+SrgHa3zCOmbJFC/CSg6ZQqQzmkE2v9xVpQ6KJKeDFNrwKZolUe7HRK+6 2MAA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=OqKd3ZXP; 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=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id bo5si1352927edb.459.2021.03.05.04.36.43; Fri, 05 Mar 2021 04:37:06 -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=@linuxfoundation.org header.s=korg header.b=OqKd3ZXP; 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=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232816AbhCEMfv (ORCPT + 99 others); Fri, 5 Mar 2021 07:35:51 -0500 Received: from mail.kernel.org ([198.145.29.99]:47384 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232777AbhCEMfY (ORCPT ); Fri, 5 Mar 2021 07:35:24 -0500 Received: by mail.kernel.org (Postfix) with ESMTPSA id 2CDA365014; Fri, 5 Mar 2021 12:35:21 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1614947722; bh=PW2fa8qYx353il6tXa/TNNcw3cuoqbRPun42E3U8Gj0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=OqKd3ZXP4c5IAPlBc3oXCm6NFn8YrITWSuxB5JPOdGn35Mzp17mfdiqOx+DIacWbt 2I+xdMXsj+TErf+bU9yOKDsI/FCO74Abq03RRsIdN+xypqE3RaEucB8+wMpDAMMVZi VUoWVQBOw9GEir+TNxFih4UTIvJ/SIxM9aklo7uE= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Jiri Slaby , Sasha Levin Subject: [PATCH 5.4 30/72] vt/consolemap: do font sum unsigned Date: Fri, 5 Mar 2021 13:21:32 +0100 Message-Id: <20210305120858.813352606@linuxfoundation.org> X-Mailer: git-send-email 2.30.1 In-Reply-To: <20210305120857.341630346@linuxfoundation.org> References: <20210305120857.341630346@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 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 b28aa0d289f8..251c02af1fc3 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.30.1