Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp3534803imu; Mon, 7 Jan 2019 05:14:19 -0800 (PST) X-Google-Smtp-Source: ALg8bN7nA9jWQE3+9qbSAo1kFmia8jKUx+l1j9DpekXyJoDM5ZsoEoe/g4IrUbzU3kkBbTxWQBPl X-Received: by 2002:a17:902:e18c:: with SMTP id cd12mr58143407plb.279.1546866859524; Mon, 07 Jan 2019 05:14:19 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1546866859; cv=none; d=google.com; s=arc-20160816; b=SOUfOqlhlx1w1VFH4sELPQQZs55eQTnOqThWtrIfVR/OdAUNrftG5qR2V9oWtP1Crk Cd93yGOCCHtzKK+U8zP5fQVkk+wrBlIMz0xx+pGmWqbLTFCdv7E5T4ZPS4MKTfMeVjLK B1m+PQOaWk15eDMWGdwDmhk0I4C4KseaB2CjUaykBN7ddmPDEMtNKryVZr+MtR7XiKJd vH/QeghE69qsYnx/ewq9EkU31PnbUOJNwTOjeUI/O0BfNeudFecTWwj3p1wGxNCw8ybr W/Rd/VugYz8u9xQZNOjNY9MGKtDMyZhzo90z/8fHwyPPuh4P+/GuiwLslL1ey7S7DXp5 pFVw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=89vIqkKUNa2JUpLmaxwVHHqiLAeYzzMoFY3ZWHeKRMs=; b=eZWUe5/1xtZdIw3YRj/FkqzpEchrHo4Yf4D1NPrJ36CmT4VPh3Osq/LCKrp3TvXTsK xPRb+lWh/bo+/bkXx/hDPCwT+Q+hqodaJWnzm+C5XJIjBsMd366Bl6W1cPh4C3Ew0oRW juaNm+R8x4A187thTyxbZrYw2DUzxCD5ulYp+gkwa2+61bJpUpxjfKUNgkgp21KgJAIk QxCg4GGL+u99Er3SN1708yQ80xw7VtG4EEpZu7kHy0g890FGDXkyF3G22r6NBlXfeOHX RPmw9duaFS8aemDZBn7XIBT8VG9yvYPgQAANYQasWfoMDZQOuepty2Zcw75xozeML/N/ YBuA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=1j36HCZ8; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id q5si62174826pgg.204.2019.01.07.05.14.04; Mon, 07 Jan 2019 05:14:19 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=1j36HCZ8; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731602AbfAGNMX (ORCPT + 99 others); Mon, 7 Jan 2019 08:12:23 -0500 Received: from mail.kernel.org ([198.145.29.99]:52390 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730602AbfAGNEn (ORCPT ); Mon, 7 Jan 2019 08:04:43 -0500 Received: from localhost (5356596B.cm-6-7b.dynamic.ziggo.nl [83.86.89.107]) (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 4836021855; Mon, 7 Jan 2019 13:04:42 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1546866282; bh=zK+AYwJmVpysIuJ2lwppN+trx9FLy/0R2hjWuo8xexA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=1j36HCZ8UHN1YOkr/nAho1HSqgIBtncvEDgivHCQ3EuFJRXFq+UwJx/JZj6YZZx5e SIdCi2MVBxk0hun1WLAAsFRnex49xwMzF3/GnEMba6dMyqP95LBhLSTClXoPcj+uao cMr8gwopVL6bMswf2v0pQUArzojlthB9huH2sTVU= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Hans Verkuil , syzbot+ccf0a61ed12f2a7313ee@syzkaller.appspotmail.com, Mauro Carvalho Chehab Subject: [PATCH 4.14 088/101] media: v4l2-tpg: array index could become negative Date: Mon, 7 Jan 2019 13:33:16 +0100 Message-Id: <20190107105337.702427111@linuxfoundation.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190107105330.372621917@linuxfoundation.org> References: <20190107105330.372621917@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review X-Patchwork-Hint: ignore MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 4.14-stable review patch. If anyone has any objections, please let me know. ------------------ From: Hans Verkuil commit e5f71a27fa12c1a1b02ad478a568e76260f1815e upstream. text[s] is a signed char, so using that as index into the font8x16 array can result in negative indices. Cast it to u8 to be safe. Signed-off-by: Hans Verkuil Reported-by: syzbot+ccf0a61ed12f2a7313ee@syzkaller.appspotmail.com Cc: # for v4.7 and up Signed-off-by: Mauro Carvalho Chehab Signed-off-by: Greg Kroah-Hartman --- drivers/media/common/v4l2-tpg/v4l2-tpg-core.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) --- a/drivers/media/common/v4l2-tpg/v4l2-tpg-core.c +++ b/drivers/media/common/v4l2-tpg/v4l2-tpg-core.c @@ -1733,7 +1733,7 @@ typedef struct { u16 __; u8 _; } __packe unsigned s; \ \ for (s = 0; s < len; s++) { \ - u8 chr = font8x16[text[s] * 16 + line]; \ + u8 chr = font8x16[(u8)text[s] * 16 + line]; \ \ if (hdiv == 2 && tpg->hflip) { \ pos[3] = (chr & (0x01 << 6) ? fg : bg); \