Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp644575pxj; Fri, 28 May 2021 11:59:01 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzoKwCIkXEZ0adwfcs3Tucus/1h7ZBwV0k6akdfg6IABXkZJDy03cwNsbccVZBqGV+4QgoJ X-Received: by 2002:a5e:9515:: with SMTP id r21mr8271612ioj.19.1622228341830; Fri, 28 May 2021 11:59:01 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1622228341; cv=none; d=google.com; s=arc-20160816; b=VQBn/b0IRqNq5wHcjhAioi+wPHGV/fKiBtvKW/gTHpj2UKPz1X1ykbQEgtBoETHCDQ /ZXJbEz7k0y0vwEqIKoay2ca0nXVlVa97KAR0jSHQA1qtp3LAdF+3xC78ecxB1ImoWl0 9WkNQaFucCMiFqx5NN2q7yJxTycrVvPwMzewyNDAVxSPb/kupnubSag+s1A37eUS3T1N IV5GAXdOqe/+68P3+Tek9jRbA/JNfNCUaWA1CCO199B5b+qTrzcpf3t9UwaZa+fG2/tp oQlzwODDuAMqsxCZ6r+BIA8Od9j5BHkuRSZ80bOO1i+KEw7oZUz4SdJP2+7H04rRub7I A1tg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from; bh=nSoTa9X68Z+d7zHCnjECCSCCTOHLhav7q8Spulio8s8=; b=xPTLT9v3ajqYktkFM6U2Vdk4RahQv5YgHgEgY1uRpS9Xy8QuKodY81EPJv990omTvS IJow28U5B2QpmjxPw4wjBnYaGnrrsC1o7WKau2Z8qwYBFJAHl/Y3G7ddCHfRfYJrVz41 AU4N8v8HQUCoo/WR9ycnKVd+VOKSsG801angRNft2Jh5CeFpmUtrHhmXfTrPd4b45PHM dZbiGvyehsEg/AxKfLYHXptOBSOwhf23HlMYxjb9kCl4NSJKT65uZ9Cp9/g2n6qmMoqJ VF0N/Cumg6yaWN7ogyDJrCvwJTwb1ID+2PjCwUbid/69IfL/TI/wPQqFtYeplWVyKwYo sIrw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id y10si6046980jak.112.2021.05.28.11.58.48; Fri, 28 May 2021 11:59:01 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229581AbhE1S5k (ORCPT + 99 others); Fri, 28 May 2021 14:57:40 -0400 Received: from gloria.sntech.de ([185.11.138.130]:45104 "EHLO gloria.sntech.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229571AbhE1S5f (ORCPT ); Fri, 28 May 2021 14:57:35 -0400 Received: from ip5f5aa64a.dynamic.kabel-deutschland.de ([95.90.166.74] helo=phil.lan) by gloria.sntech.de with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1lmheG-0006hU-Lv; Fri, 28 May 2021 20:55:56 +0200 From: Heiko Stuebner To: Colin King , Chris Zhong , Daniel Vetter , Sandy Huang , linux-arm-kernel@lists.infradead.org, Guenter Roeck , Sean Paul , David Airlie , dri-devel@lists.freedesktop.org, linux-rockchip@lists.infradead.org Cc: Heiko Stuebner , kernel-janitors@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] drm/rockchip: cdn-dp: fix sign extension on an int multiply for a u64 result Date: Fri, 28 May 2021 20:55:53 +0200 Message-Id: <162222814865.2904787.9681017201633439176.b4-ty@sntech.de> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20200915162049.36434-1-colin.king@canonical.com> References: <20200915162049.36434-1-colin.king@canonical.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, 15 Sep 2020 17:20:49 +0100, Colin King wrote: > The variable bit_per_pix is a u8 and is promoted in the multiplication > to an int type and then sign extended to a u64. If the result of the > int multiplication is greater than 0x7fffffff then the upper 32 bits will > be set to 1 as a result of the sign extension. Avoid this by casting > tu_size_reg to u64 to avoid sign extension and also a potential overflow. Applied, thanks! [1/1] drm/rockchip: cdn-dp: fix sign extension on an int multiply for a u64 result commit: ce0cb93a5adb283f577cd4661f511047b5e39028 Best regards, -- Heiko Stuebner