Received: by 2002:a5d:925a:0:0:0:0:0 with SMTP id e26csp718012iol; Thu, 9 Jun 2022 12:24:02 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwn267ctZeHuw6p345EGkKLS892tSTtkTT1Qg5A3Q41MiyGiTuuiLLTeJGUxfNGEWSQ8EnC X-Received: by 2002:a17:90b:4d0e:b0:1e2:bcd7:c68c with SMTP id mw14-20020a17090b4d0e00b001e2bcd7c68cmr4875575pjb.74.1654802641903; Thu, 09 Jun 2022 12:24:01 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1654802641; cv=pass; d=google.com; s=arc-20160816; b=0LhHcUdlqxggHBd/dhqNSzd9T5CZM392ajxATWvRRqTzUSqAnek1rLrOJpdYecsdLM dVuQJyaSYpqv4IbVd1qVWaJfNP2z+xG2U4jEGjPT2OyxJ6ovztvOI9MyXw2kRP016fdu 5LppCiR3A9Wr0r7zFEt7wUDjuPXY7kGxwk6XZWZLMLdjfqmuTMU+3g93HmSqVayusQiG Fg1ztDceYjDRFUcKvrFxfqaQXXYJRS8fDYJ6CRLIF/bk3XPDFlCadFyEHxuDcGlg24wq /zj4wzdlbTqJMYCEAZmgqxJlfqjBAT/i0Epr363zAXu4L+zYqNq10nJK5hQbEQMts10/ goIg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:content-transfer-encoding :message-id:date:subject:cc:to:from:dkim-signature; bh=4YZpG014oFJ+pMggv6gDxuHyDI8q0SkeapmeW8x8Tp4=; b=F12ozorUPahld7iDNEcJ+Q95fNZG6O19U6RwPMfSlIbJSnjMTZtR0gBV77GZBkH8IX /sVNQDjbAjfyLx0NJnpZVQDks6SiMr9Baf0Qtpty58wOE2s2I5jJj7pK4xqQpS4QxRNU yGS6WzgmgHD7TuBuE509zcMraSQFQoqFUqymwxQUThIEwZgy3v/orHhLXXMH/FPgg8p5 zzIG6/ClvYYHuWb/VEc7Cyb+TkirljAbsvu/RnTaIk9eLQYzorXD4/QEoTVzDQpKyqfn OfjwJAghikb+nPJ/xvsZCadx/Yf8tql5NmY2uP0OWAo9KoYokwjuFPX6NP9Pn46xAV7t kFMw== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@hotmail.com header.s=selector1 header.b=SP3ap3dy; arc=pass (i=1); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=hotmail.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id 82-20020a630555000000b003fc6682b1ebsi8609014pgf.223.2022.06.09.12.23.49; Thu, 09 Jun 2022 12:24:01 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@hotmail.com header.s=selector1 header.b=SP3ap3dy; arc=pass (i=1); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=hotmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1344979AbiFISvD (ORCPT + 99 others); Thu, 9 Jun 2022 14:51:03 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43566 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1345489AbiFISu4 (ORCPT ); Thu, 9 Jun 2022 14:50:56 -0400 Received: from EUR01-HE1-obe.outbound.protection.outlook.com (mail-oln040092065080.outbound.protection.outlook.com [40.92.65.80]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3525387A18 for ; Thu, 9 Jun 2022 11:50:55 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=H/U1k+ocvFadfcuMcHAQTE64Er3aA2eKtWHm7Tbsirm/55BOHYrKRGQoJI/qBGM8aT7pSVACh7rCPAfE++N8UNZc9SE/vv3HUI1isObhyMNe1rGQvBrXMn03xjvqRxF0jiG43q94iBiYyQ5xnN5dyeN4tCT60HdFbKNvAnwkiHLKtwLc4JddIXzSQ9Qd9e3OVPe+S3sVXgoFDcTBtgdt/cByimNdi9tYaSch1a3tlqpHjayY/Q3E4BmzZYQbdraCK7E0TDyJdmQPRbK+RVkh23/95rb6SPSz1j1JRbn6ILNHLSqjFfpi/KxEFXCTTIcOK/wT8rVSDLqpIMVunDaVZQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=4YZpG014oFJ+pMggv6gDxuHyDI8q0SkeapmeW8x8Tp4=; b=LTELKKeXd2wceYKqsZ1Sv8x8QnXyErylqVzbS/sRB68xQr//06YG6TfLppvo8sjn4SuFUdavyfExpQd5DpcerF0aRtva/61/6MovvNLNrtkxV6KYugUlHPIsL5a3O8HMloOOrp7RmgBp9Iy07GgFrfBuTVyi4KsVsnObYjNj3A+cLlp7gfH3uJtiaTsLb4SiNbpIHaNGGvehtb8XXNFnuwjdmbNzKFKBrlGo6vT2MXQWbc3XY/ysR8r+3f3mL7tZVBUMqNY4XcRnYDm1Yjh9obwHYhqzsUe2lqvNe0yFuLvNR5G/3Pyz35FtF7P6YUKz8/C97wdI1SdF4c3rY08aMw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=none; dmarc=none; dkim=none; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=hotmail.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=4YZpG014oFJ+pMggv6gDxuHyDI8q0SkeapmeW8x8Tp4=; b=SP3ap3dyEIOw4Yz6i5tEQZdgjLU7JFdiS9w+wS5i43wsipoay2IzDaAD3Lp2rF1GcUdRtyT+zjIdg1yRS7kZNl/f4tKCa2URcrmnGb+utitEyYg7ciFguDVDwE5fgWEyK64OStA3/xcV62TLYPdxhP0pfi2JJm4Lj3AZF6KruE8g9TmXQdMd7Ni/XW3KMSH1UquN0tZ62VjrhnB6/TrsNqRiRYzOMlnx2M/Xw5ZoaX93K1OX2nWva1fpc3ok2p8KU41XJO+xsPqvUyzncwAzuPBPS8aIT84+N60CqhC+a1NWfWv7NUNOi+YOx5GEk01fwYv/gjlelhxxWx2D/NNi4g== Received: from PA4P189MB1421.EURP189.PROD.OUTLOOK.COM (2603:10a6:102:c2::10) by GV2P189MB2283.EURP189.PROD.OUTLOOK.COM (2603:10a6:150:77::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5314.19; Thu, 9 Jun 2022 18:50:52 +0000 Received: from PA4P189MB1421.EURP189.PROD.OUTLOOK.COM ([fe80::5ae:1a99:f05c:b75d]) by PA4P189MB1421.EURP189.PROD.OUTLOOK.COM ([fe80::5ae:1a99:f05c:b75d%5]) with mapi id 15.20.5332.012; Thu, 9 Jun 2022 18:50:52 +0000 From: Saud Farooqui To: emma@anholt.net, mripard@kernel.org, airlied@linux.ie, daniel@ffwll.ch, dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org Cc: Saud Farooqui Subject: [PATCH] drm/vc4: hdmi: Fixed possible integer overflow Date: Thu, 9 Jun 2022 23:50:31 +0500 Message-ID: X-Mailer: git-send-email 2.25.1 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-TMN: [E/wOZ4BXRHu1nex+rOgwLFsP7G9Lzk+c] X-ClientProxiedBy: MN2PR12CA0032.namprd12.prod.outlook.com (2603:10b6:208:a8::45) To PA4P189MB1421.EURP189.PROD.OUTLOOK.COM (2603:10a6:102:c2::10) X-Microsoft-Original-Message-ID: <20220609185031.1218731-1-farooqui_saud@hotmail.com> MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 5a9a49f4-549e-49e4-e899-08da4a48fa15 X-MS-Exchange-SLBlob-MailProps: 3UeWkQkuiJMknb89wdP9bRejgndTi7hZQntzzyKwHa0oqL9lY+96MloLhFSvix5OvZbpJmWBEOcAd98zoMJWIrrd14PPiN62RCmHP/4P/Wj7RuQyQnvBeIqvTm9OChxCld8pXcU4VseBm+zMirwCoWLLicx5TuTlMzeLjCrVxS2ZTphEoPq7V6UyHz2JP2SSFhfyy+PdNhquCdZqZZVMEzL22bp0QzjNZDdo1ajMVGy0xVO8KSWAhfogtEhZ3cIdASV67HocaicIdjJUCWphiH5+Ov8iZhNUvokJvFG+sd3rgSTxZbrUvP1g4jv1AyO8HW2aXugw9m1OTbHGVRqgA6OXazOKn1hU8IsDTBbqQ+osJk6Zy6nlWAMlmognIOdx/Tk5pSxRZ671IH+MtU8ve2gAFnZHHmgz5LUEaVGaPBvxkWe3yvo6wzpzcNthG3UmlWk1Km+wSXBxB4lVy9IENwWBtPQs4wlt+aOqtbRLII+rfXzLV3VmP+6aRtUIwLmdyaJpLzjbDcWF4WQXtEBAqD0j5S22o6li17bXZobaDuzspFdyjKiaDMo5bhXnsdOln0QKexJGwVAgbb/FEIizuK/df85UOyEhdBb+QRx0uyGxTwBkO1CmRcL8/p2xp0EF74jan2Hv0qX0m14EWSoPlcWwfJoZsxLRrdQZjwe5c5KDjUm3t+d3v1tL2tgoAq/jU9CC6BD/xRgdowGlnIKCfttYO3RAEqpjZRF8dGlrPauCf/xN+smwwA== X-MS-TrafficTypeDiagnostic: GV2P189MB2283:EE_ X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: pman93e0BuXIsDqzB/M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hAPpeJxbU8g+Re9VFZrOiB2mIs7bSFgGsrTV?= =?us-ascii?Q?s2CXYDK0I6zGLUGjxQJy9W1INDJMyBJCcfz8daF07eIvLRYBWRpACqlkCXnZ?= =?us-ascii?Q?mPCWgUUNfn/u69dxtoJQBM9y4VQcARqs1rU1TLzRkbZSbygoH38TViopw9Dx?= =?us-ascii?Q?XUJ08ojERluTF2Ztmf8HgTw5BLHH7okxmUwxxxEQXeh9Bc1e531ql3DjF4pH?= =?us-ascii?Q?tpFfXQDzBjI=3D?= X-OriginatorOrg: sct-15-20-4734-24-msonline-outlook-c54b5.templateTenant X-MS-Exchange-CrossTenant-Network-Message-Id: 5a9a49f4-549e-49e4-e899-08da4a48fa15 X-MS-Exchange-CrossTenant-AuthSource: PA4P189MB1421.EURP189.PROD.OUTLOOK.COM X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 09 Jun 2022 18:50:52.4717 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 84df9e7f-e9f6-40af-b435-aaaaaaaaaaaa X-MS-Exchange-CrossTenant-RMS-PersistedConsumerOrg: 00000000-0000-0000-0000-000000000000 X-MS-Exchange-Transport-CrossTenantHeadersStamped: GV2P189MB2283 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM, RCVD_IN_DNSWL_NONE,SPF_HELO_PASS,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Multiplying ints and saving it in unsigned long long could lead to integer overflow before being type casted to unsigned long long. Addresses-Coverity: 1505113: Unintentional integer overflow. Signed-off-by: Saud Farooqui --- drivers/gpu/drm/vc4/vc4_hdmi.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/gpu/drm/vc4/vc4_hdmi.c b/drivers/gpu/drm/vc4/vc4_hdmi.c index 823d812f4982..ce9d16666d91 100644 --- a/drivers/gpu/drm/vc4/vc4_hdmi.c +++ b/drivers/gpu/drm/vc4/vc4_hdmi.c @@ -1481,7 +1481,7 @@ vc4_hdmi_encoder_compute_mode_clock(const struct drm_display_mode *mode, unsigned int bpc, enum vc4_hdmi_output_format fmt) { - unsigned long long clock = mode->clock * 1000; + unsigned long long clock = mode->clock * 1000ULL; if (mode->flags & DRM_MODE_FLAG_DBLCLK) clock = clock * 2; -- 2.25.1