From patchwork Mon Sep 21 16:27:39 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "gregkh@linuxfoundation.org" X-Patchwork-Id: 309302 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=-11.2 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI, SIGNED_OFF_BY,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 6E82DC4346B for ; Mon, 21 Sep 2020 17:04:49 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 2B4AF21D91 for ; Mon, 21 Sep 2020 17:04:49 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1600707889; bh=/6ABPznMbPJMPHwQ9dNfrnIj4B/bBpl7xDMTEHxTExI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=Z1dtpFbyJ9M5PCHSsBb9p5wt9aLxzykARwbwdN+qB8P7Zd9qYYvNmyLnaDHMdvcaa Ucimbj4o7Q2hHVZoXb5hdbXMzgWV1gMw/96TheEZztWTPDMXUGIl6L2k5HqqWvAhXr KDzbng7PsXvIRqjPJDWqslvkco4wssUOcsXTsuAM= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729805AbgIUREr (ORCPT ); Mon, 21 Sep 2020 13:04:47 -0400 Received: from mail.kernel.org ([198.145.29.99]:34172 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728829AbgIUQfG (ORCPT ); Mon, 21 Sep 2020 12:35:06 -0400 Received: from localhost (83-86-74-64.cable.dynamic.v4.ziggo.nl [83.86.74.64]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 94575239D3; Mon, 21 Sep 2020 16:34:58 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1600706099; bh=/6ABPznMbPJMPHwQ9dNfrnIj4B/bBpl7xDMTEHxTExI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=uj5XvRwlyklPYQhHQmjF45ss2yNmN8kel3E/ClQJ6lhHndLjhf8SM6EmGV2tDEUPl DBRiP9+cdKJ2NaQEvkC/77bDsY7kUVBWIHEJRBRKpvXA63EaVlrV3MZqu0LjwXDbx2 8OjMU7GIp0g2q0XeQZtGwiIjYVW7lI0frn1P2LiM= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, syzbot , Tetsuo Handa Subject: [PATCH 4.9 39/70] video: fbdev: fix OOB read in vga_8planes_imageblit() Date: Mon, 21 Sep 2020 18:27:39 +0200 Message-Id: <20200921162036.902193432@linuxfoundation.org> X-Mailer: git-send-email 2.28.0 In-Reply-To: <20200921162035.136047591@linuxfoundation.org> References: <20200921162035.136047591@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org From: Tetsuo Handa commit bd018a6a75cebb511bb55a0e7690024be975fe93 upstream. syzbot is reporting OOB read at vga_8planes_imageblit() [1], for "cdat[y] >> 4" can become a negative value due to "const char *cdat". [1] https://syzkaller.appspot.com/bug?id=0d7a0da1557dcd1989e00cb3692b26d4173b4132 Reported-by: syzbot Signed-off-by: Tetsuo Handa Cc: stable Link: https://lore.kernel.org/r/90b55ec3-d5b0-3307-9f7c-7ff5c5fd6ad3@i-love.sakura.ne.jp Signed-off-by: Greg Kroah-Hartman --- drivers/video/fbdev/vga16fb.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) --- a/drivers/video/fbdev/vga16fb.c +++ b/drivers/video/fbdev/vga16fb.c @@ -1122,7 +1122,7 @@ static void vga_8planes_imageblit(struct char oldop = setop(0); char oldsr = setsr(0); char oldmask = selectmask(); - const char *cdat = image->data; + const unsigned char *cdat = image->data; u32 dx = image->dx; char __iomem *where; int y;