public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Sasha Levin <sashal@kernel.org>
To: linux-kernel@vger.kernel.org, stable@vger.kernel.org
Cc: Jiri Slaby <jslaby@suse.cz>,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	Sasha Levin <sashal@kernel.org>
Subject: [PATCH AUTOSEL 4.14 03/16] vt/consolemap: do font sum unsigned
Date: Wed, 24 Feb 2021 07:55:00 -0500	[thread overview]
Message-ID: <20210224125514.483935-3-sashal@kernel.org> (raw)
In-Reply-To: <20210224125514.483935-1-sashal@kernel.org>

From: Jiri Slaby <jslaby@suse.cz>

[ 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 <jslaby@suse.cz>
Link: https://lore.kernel.org/r/20210105120239.28031-7-jslaby@suse.cz
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 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


  parent reply	other threads:[~2021-02-24 14:17 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-02-24 12:54 [PATCH AUTOSEL 4.14 01/16] staging: fwserial: Fix error handling in fwserial_create Sasha Levin
2021-02-24 12:54 ` [PATCH AUTOSEL 4.14 02/16] x86/reboot: Add Zotac ZBOX CI327 nano PCI reboot quirk Sasha Levin
2021-02-24 12:55 ` Sasha Levin [this message]
2021-02-24 12:55 ` [PATCH AUTOSEL 4.14 04/16] wlcore: Fix command execute failure 19 for wl12xx Sasha Levin
2021-02-24 12:55 ` [PATCH AUTOSEL 4.14 05/16] pktgen: fix misuse of BUG_ON() in pktgen_thread_worker() Sasha Levin
2021-02-24 12:55 ` [PATCH AUTOSEL 4.14 06/16] ath10k: fix wmi mgmt tx queue full due to race condition Sasha Levin
2021-02-24 12:55 ` [PATCH AUTOSEL 4.14 07/16] x86/build: Treat R_386_PLT32 relocation as R_386_PC32 Sasha Levin
2021-02-24 12:55 ` [PATCH AUTOSEL 4.14 08/16] Bluetooth: Fix null pointer dereference in amp_read_loc_assoc_final_data Sasha Levin
2021-02-24 12:55 ` [PATCH AUTOSEL 4.14 09/16] staging: most: sound: add sanity check for function argument Sasha Levin
2021-02-24 12:55 ` [PATCH AUTOSEL 4.14 10/16] media: mceusb: sanity check for prescaler value Sasha Levin
2021-02-24 12:55 ` [PATCH AUTOSEL 4.14 11/16] media: uvcvideo: Allow entities with no pads Sasha Levin
2021-02-24 12:55 ` [PATCH AUTOSEL 4.14 12/16] f2fs: handle unallocated section and zone on pinned/atgc Sasha Levin
2021-02-24 12:55 ` [PATCH AUTOSEL 4.14 13/16] tomoyo: ignore data race while checking quota Sasha Levin
2021-02-24 12:55 ` [PATCH AUTOSEL 4.14 14/16] smackfs: restrict bytes count in smackfs write functions Sasha Levin
2021-02-24 12:55 ` [PATCH AUTOSEL 4.14 15/16] Drivers: hv: vmbus: Resolve race condition in vmbus_onoffer_rescind() Sasha Levin
2021-02-24 13:22   ` Andrea Parri
2021-02-24 12:55 ` [PATCH AUTOSEL 4.14 16/16] parisc: Bump 64-bit IRQ stack size to 64 KB Sasha Levin

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20210224125514.483935-3-sashal@kernel.org \
    --to=sashal@kernel.org \
    --cc=gregkh@linuxfoundation.org \
    --cc=jslaby@suse.cz \
    --cc=linux-kernel@vger.kernel.org \
    --cc=stable@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox