Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp3472554imu; Sun, 11 Nov 2018 15:54:19 -0800 (PST) X-Google-Smtp-Source: AJdET5fD2c4o/Mw/bReti7KXG1psaMBPNyPsBEmg/ykH8cEv8FODZMyhXHBdGfw/CVKrWZ9bHkOd X-Received: by 2002:a17:902:6b88:: with SMTP id p8-v6mr17152638plk.19.1541980459333; Sun, 11 Nov 2018 15:54:19 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1541980459; cv=none; d=google.com; s=arc-20160816; b=i68D0ccJ3QqX1F5fXAK4lN/m9zfPX2h+YujOKkz+copyruTSb/E0e5xcVrmPgScQNH M30YZENGwB70z57oetfiYHF9w8BYG60fxBjwg/QFBXM5HnwGLWMl7/YsCIH48+SSeiyj h3qwkfVjKXf1ET02mq4k0qqnz5ZmquHqp/A6hxl0Kyfx9oVYFcLsPW/49J0/gFqCTqe7 AxzZNJ4UzKdH9jsVGfrUHqeM4NCOYNv135ezl8RMGC3DstJakeB8bEkrXU4xk+JgkLOC c1SslOqgicyDovjs8uH2NKwcYWzTSxJsT5LQ7IxRLdm2Jqi7jCBq1XuB8+4i0SmK1UVE lzNg== 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=R7Z0SqVJC8A7uSdG4cWZeMGoSTqtwAQigV2Udfvgv2M=; b=xhzSt/Wdvvj7LAEIHO9ROXvHgZisG/4BiX2/xSNMoH9Hl+gE2wyUuhrpeYTrQ0j4js DxSKBiYWGT5GSNP4qeAs6WXFf8TSw4dUAXm3GDILRgxxEffA1h9hoc+01jk7qBzsdA0p Z/ksWqHPSJ2OQ82vUm1b7CLRxXCR7AR/ZamJwIfAbkj0Oa88l7ryBAKJ4fLXsCHiYmO+ Gaj0SxEbUwRqBs2AJSlc4mZCDzf6hzSvlOdCmNzuBDItXW4PcSy8uTKrzBr3un8Oymf+ uaAi0cuZ6Y4IpX/2WqxPAGFrco3YjeFBrwW1c8myt7XHYrmlEHzdm5CATcUCwIoR1Wbd Wdag== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=GRwcpjx9; 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 d2-v6si15172724plh.168.2018.11.11.15.54.04; Sun, 11 Nov 2018 15:54: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=GRwcpjx9; 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 S1733106AbeKLJmv (ORCPT + 99 others); Mon, 12 Nov 2018 04:42:51 -0500 Received: from mail.kernel.org ([198.145.29.99]:37584 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1732817AbeKLIS2 (ORCPT ); Mon, 12 Nov 2018 03:18:28 -0500 Received: from localhost (unknown [206.108.79.134]) (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 E94082175B; Sun, 11 Nov 2018 22:28:31 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1541975312; bh=uqT9+m7CCWmamkRtOC5T79akFOcjvXOpzUKXKtJwb7U=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=GRwcpjx994L/BPgJ15HhxiYvI2/n2HkEdDqumKUIwqfT62C3QutaDL3StbdHmWX4q rPB9EiXyoGNH5Yr7I5ubNV+8ZSf4bE9pwR9ISd7ZMXB3e2lHaMQ5NkUgXj2/UoOjql MNLQdREq09KKrfKU0bfZpDsSA0P8eg1FljZikgcM= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Hans Verkuil , Mauro Carvalho Chehab Subject: [PATCH 4.19 293/361] media: v4l2-tpg: fix kernel oops when enabling HFLIP and OSD Date: Sun, 11 Nov 2018 14:20:40 -0800 Message-Id: <20181111221656.858224392@linuxfoundation.org> X-Mailer: git-send-email 2.19.1 In-Reply-To: <20181111221619.915519183@linuxfoundation.org> References: <20181111221619.915519183@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review 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.19-stable review patch. If anyone has any objections, please let me know. ------------------ From: Hans Verkuil commit 250854eed5d45a73d81e4137dfd85180af6f2ec3 upstream. When the OSD is on (i.e. vivid displays text on top of the test pattern), and you enable hflip, then the driver crashes. The cause turned out to be a division of a negative number by an unsigned value. You expect that -8 / 2U would be -4, but in reality it is 2147483644 :-( Fixes: 3e14e7a82c1ef ("vivid-tpg: add hor/vert downsampling support to tpg_gen_text") Signed-off-by: Hans Verkuil Reported-by: Mauro Carvalho Chehab Cc: # for v4.1 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 @@ -1770,7 +1770,7 @@ typedef struct { u16 __; u8 _; } __packe pos[7] = (chr & (0x01 << 0) ? fg : bg); \ } \ \ - pos += (tpg->hflip ? -8 : 8) / hdiv; \ + pos += (tpg->hflip ? -8 : 8) / (int)hdiv; \ } \ } \ } while (0)