Received: by 2002:a05:7412:a9a2:b0:e2:908c:2ebd with SMTP id o34csp2434560rdh; Sun, 29 Oct 2023 16:33:57 -0700 (PDT) X-Google-Smtp-Source: AGHT+IE2wdB/79/t+Ku4Wl6UGoa+Z84mDtHgyheibmjyKBp2uWBOuEx9WTfgYg0sWZlEvhAhGy6I X-Received: by 2002:a17:903:1211:b0:1c7:245a:7fea with SMTP id l17-20020a170903121100b001c7245a7feamr11285326plh.58.1698622437148; Sun, 29 Oct 2023 16:33:57 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1698622437; cv=none; d=google.com; s=arc-20160816; b=G670ZqB4eU+olM5sE2PX6GeiC1GBT2kauYENqYsZsvIK54pAs/WJM/rNdVizRV3aUz Tb32M12DphgUTgBHURtl8A6BEm/IGzJWH7QMbNOjIvb4vwWYl9TZPRREmFVusIYC7Q8t 7O8q5p7WkZwcQk2NGXxFmIsu1PitwWhtBffaUQyswdDxdNmH3Gy6v2lj0tBrUl7rxKRS 8vIjb180ODBzwK/zv5KlFzrYI54Ascsbuxxco/m0JTURmKKrSJd1NbT2PIIDcf3vZoZc zS3VoZ6gX8bpQvzZ0ZD1v0/yvStiYtpMWkLh98ChYHJdownjMUpBW7IEc1Allt1uh1bF tysA== 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 :dkim-signature; bh=0Bu3f6morr5RuZuSqcndTwtwzFOHsSOY73siOxV4QnA=; fh=+stHDcRFGRF0IvBvJqE2PklSr1Su+mSlXZveFLe5su4=; b=lM409wIcIQR++jS8Fa85v/DBXWAwFToMWjx/WJWWXUC6cktCmDLt9ZBHlkPP2Gy/KB GGZjfiI/YQpoiCTyED0ZLJlo5O3dpp0XKTT1C5LXczQxcRPN7H2TBKS5jqMVHINtpix6 FhGNDMiw7c88qa0/YrZjcLrdtD5aoo8As+4jsRSdse4u3QtN+ySX/DOdKTNVKRCq17oS V+sGybgpsjfcIO42tTXxUTKAe82f7S+iYuXiyFkyonxFfbQpwCR1H8QngUB7rJrR+LUu wVNGa6tdM7Rqm1yHr6OkpOxCGWTGIYrbzco8Yc+muSCi6W5iTtwBnLO0uFe/OiOnQ+lQ fM3w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=oqBwVvpZ; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:8 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from fry.vger.email (fry.vger.email. [2620:137:e000::3:8]) by mx.google.com with ESMTPS id lc11-20020a170902fa8b00b001bb8a57d518si4192852plb.379.2023.10.29.16.33.56 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 29 Oct 2023 16:33:57 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:8 as permitted sender) client-ip=2620:137:e000::3:8; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=oqBwVvpZ; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:8 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by fry.vger.email (Postfix) with ESMTP id 1CB41808EF6A; Sun, 29 Oct 2023 16:33:50 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at fry.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231945AbjJ2Xd0 (ORCPT + 99 others); Sun, 29 Oct 2023 19:33:26 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33746 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231132AbjJ2XdM (ORCPT ); Sun, 29 Oct 2023 19:33:12 -0400 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 185FB10A; Sun, 29 Oct 2023 15:56:05 -0700 (PDT) Received: by smtp.kernel.org (Postfix) with ESMTPSA id BD44EC4167E; Sun, 29 Oct 2023 22:56:04 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1698620165; bh=V3MW3HlJw0Dv/VdEsrQyNiXGgZkXx8rL2UAla9DTeeg=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=oqBwVvpZMCYX4+blhwUcP51ZYf8OxNu6QpklHq+3UnuKJBwP99m52uTNaC2zrEh6N mkZa1HOvzBFRrStjMmLJwQHXQIoKSI/dC3lEidSBWyaS56sPQ5iOHdh7XkL9FUnXhq +n5oflVx7GqXXZa/R70I2Kz1ud1g/heqQ0YKBzp4kWGQ/yjnH+iEXU46/T8ZbMSkrY KIeL6TPgDNl275dctD/NAcQ/v4GbBhsYNAEuOW5VbVnpim3K79Gyj+1mtX0LBJKs1U liwyOsG6BOQiXWRNoc9+Llptfu4DR8zsPoQfkAe2/h0M4z14n3uGSSs0rbVmTzvhg9 qfdKH6Wp3DW7g== From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: Sergey Shtylyov , Helge Deller , Sasha Levin , daniel@ffwll.ch, linux-fbdev@vger.kernel.org, dri-devel@lists.freedesktop.org Subject: [PATCH AUTOSEL 6.5 35/52] fbdev: core: syscopyarea: fix sloppy typing Date: Sun, 29 Oct 2023 18:53:22 -0400 Message-ID: <20231029225441.789781-35-sashal@kernel.org> X-Mailer: git-send-email 2.42.0 In-Reply-To: <20231029225441.789781-1-sashal@kernel.org> References: <20231029225441.789781-1-sashal@kernel.org> MIME-Version: 1.0 X-stable: review X-Patchwork-Hint: Ignore X-stable-base: Linux 6.5.9 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-1.7 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on fry.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (fry.vger.email [0.0.0.0]); Sun, 29 Oct 2023 16:33:50 -0700 (PDT) From: Sergey Shtylyov [ Upstream commit e8e4a470b677511f9d1ad4f3cef32adc1d9a60ca ] In sys_copyarea(), the local variable bits_per_line is needlessly typed as *unsigned long* -- which is a 32-bit type on the 32-bit arches and a 64-bit type on the 64-bit arches; that variable's value is derived from the __u32 typed fb_fix_screeninfo::line_length field (multiplied by 8u) and a 32-bit *unsigned int* type should still be enough to store the # of bits per line. Found by Linux Verification Center (linuxtesting.org) with the Svace static analysis tool. Signed-off-by: Sergey Shtylyov Signed-off-by: Helge Deller Signed-off-by: Sasha Levin --- drivers/video/fbdev/core/syscopyarea.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/video/fbdev/core/syscopyarea.c b/drivers/video/fbdev/core/syscopyarea.c index c1eda31909682..7b8bd3a2bedc5 100644 --- a/drivers/video/fbdev/core/syscopyarea.c +++ b/drivers/video/fbdev/core/syscopyarea.c @@ -316,7 +316,7 @@ void sys_copyarea(struct fb_info *p, const struct fb_copyarea *area) { u32 dx = area->dx, dy = area->dy, sx = area->sx, sy = area->sy; u32 height = area->height, width = area->width; - unsigned long const bits_per_line = p->fix.line_length*8u; + unsigned int const bits_per_line = p->fix.line_length * 8u; unsigned long *base = NULL; int bits = BITS_PER_LONG, bytes = bits >> 3; unsigned dst_idx = 0, src_idx = 0, rev_copy = 0; -- 2.42.0