Received: by 2002:a05:6a10:5bc5:0:0:0:0 with SMTP id os5csp3038853pxb; Mon, 18 Oct 2021 07:06:14 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzAM7FddxfTuqea0pR8ZI7u1bhH/MeHcPBZXTzCFuANT8KFVmB8fW1Bm5WHqhsv3eqTLej3 X-Received: by 2002:a05:6000:1289:: with SMTP id f9mr36325865wrx.192.1634565974025; Mon, 18 Oct 2021 07:06:14 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1634565974; cv=none; d=google.com; s=arc-20160816; b=BO1GgKBQPi2CcKiB7i4tbAPq+73AxlqxbzSsNC9Owce3MG2KyhgzyhcWTOZfV0s3/L j2okqCMq3CzAJBbcFShscEXfbUsRz6sr0uK/68u6LSfoZkWe8E1+pWsPmykD+XH4UulY NjnbSudKjuF0CYG8dRL/A6b1srDpAgW2GbMKobIb/EaABT+0KbC9u9vZ1xe4x35nte4Y l8Xa0palzCjv8pI9EgevEvLpSSGQmcpm9OR1vO4up8wdx1IgEKw6FpRHRdERKR9pg0Fb gv8rtdpVoK42X/PTX3gOxvr1bGiyMRvYHp2rNHtpmH9/LmwaU4SI/YqA/Bp5uLCyousX 6T7g== 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 :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=ZdYQq0mrIe1aL3SVFCIP12mlYKbP4vKNxefZnGOaPE8=; b=lDGJHy+DRNMeJcvbKEj7Kz7LLG4MSUOT2NxODDeuLJAB7H4KrqZUQ3zwTvN8RcvVwE XtOznyx1ADotRzQl6n+DmJZJS+Ogjp1iv1J/SwGw/m4MdQw/a+De7U716P3Q4G1YJtzl sgPeSw8Sjd0u+4GCuq7wxEjlG7ZmnLTcvkjFf7HZCaQc2iaoBpvXNSc5G7q3bEysdOOV N1oa0ZCKHdEDPRtlsAd59x4ae8nrOLICGBwbLSqQNreT7x1gODp4Mc4dMXR1cFa4Y9vH vKu2sysbpx/Veo+OJ3wroeQjKQVWdt/IzE3JD+10aokxb2QVyPftbS0wj1gPyR6LqRqz QQdg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=HPDJc5Ck; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id j5si19580010edr.343.2021.10.18.07.05.48; Mon, 18 Oct 2021 07:06:14 -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; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=HPDJc5Ck; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231991AbhJROFP (ORCPT + 99 others); Mon, 18 Oct 2021 10:05:15 -0400 Received: from mail.kernel.org ([198.145.29.99]:38668 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234669AbhJROAu (ORCPT ); Mon, 18 Oct 2021 10:00:50 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id BC4E661A56; Mon, 18 Oct 2021 13:42:23 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1634564544; bh=ZtJ20s/9+j39b3SSz+vdhbHiPI4MdJdL8D2IJFg57Ds=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=HPDJc5CkD8FSaihievEuQ67zgPDia+z8gdRJo01ju60m+aNSen4WZKf7kIhd9f+hB KTsX47kj3UaI0GWnAyigkdVdZWkUB6n5AxkZUfebdDzn3Af3cWT+PnpTZ+btE2MK7U r0aP+xyRvPymFlrSd/b6Ta3e9JB5s42nbq3jYjkc= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Arnd Bergmann , Stephen Boyd , Rob Clark Subject: [PATCH 5.14 129/151] drm/msm/submit: fix overflow check on 64-bit architectures Date: Mon, 18 Oct 2021 15:25:08 +0200 Message-Id: <20211018132344.859780737@linuxfoundation.org> X-Mailer: git-send-email 2.33.1 In-Reply-To: <20211018132340.682786018@linuxfoundation.org> References: <20211018132340.682786018@linuxfoundation.org> User-Agent: quilt/0.66 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 From: Arnd Bergmann commit 95c58291ee709424557996891926a05a32c5b13a upstream. The overflow check does causes a warning from clang-14 when 'sz' is a type that is smaller than size_t: drivers/gpu/drm/msm/msm_gem_submit.c:217:10: error: result of comparison of constant 18446744073709551615 with expression of type 'unsigned int' is always false [-Werror,-Wtautological-constant-out-of-range-compare] if (sz == SIZE_MAX) { Change the type accordingly. Fixes: 20224d715a88 ("drm/msm/submit: Move copy_from_user ahead of locking bos") Signed-off-by: Arnd Bergmann Reviewed-by: Stephen Boyd Link: https://lore.kernel.org/r/20210927113632.3849987-1-arnd@kernel.org Signed-off-by: Rob Clark Signed-off-by: Greg Kroah-Hartman --- drivers/gpu/drm/msm/msm_gem_submit.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) --- a/drivers/gpu/drm/msm/msm_gem_submit.c +++ b/drivers/gpu/drm/msm/msm_gem_submit.c @@ -161,7 +161,8 @@ out: static int submit_lookup_cmds(struct msm_gem_submit *submit, struct drm_msm_gem_submit *args, struct drm_file *file) { - unsigned i, sz; + unsigned i; + size_t sz; int ret = 0; for (i = 0; i < args->nr_cmds; i++) {