Received: by 2002:a05:7412:a9a2:b0:e2:908c:2ebd with SMTP id o34csp2422769rdh; Sun, 29 Oct 2023 15:58:09 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGoOj1lH1VH3GTkxCaBZFYp7v/5KwszpkfyA4UpVMMX83LUrqhTDnymspQF2XSRRxtGbHy4 X-Received: by 2002:a05:6808:5d0:b0:3b2:e0fa:61e4 with SMTP id d16-20020a05680805d000b003b2e0fa61e4mr9581818oij.25.1698620289679; Sun, 29 Oct 2023 15:58:09 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1698620289; cv=none; d=google.com; s=arc-20160816; b=w2MV4WpL+tq/Fuqre52BNiELWoWTAOkxRc7NR953G4KQL9CnLAzuKLXP6bjA4enfVx Bs8gFcYqoa/V6Q42/oZo+vf6JK218X7Q6oYQPbebaAwXvsER4lgfOnkFGGWRHl2XQA6+ aVD9aHZVyF9p3KWCBIpHAZloZe290ZybO2LG45JAGrmWo8mldzsqFVGkZwTjcFjYav8N /tr9dVldpOnkQjUEnvifMbjvlJngGBbcxpGv49JglX3IInELs2AnZy9shOPp8mVrK+5n OEMILqxJHywli9DUDNrxohu1/A9ibSKScAIdx4Z2I2XJ2f4NAtkfFSQT4UJXRFk1toKG UklA== 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=mOyqkaW4hpwix4opxlkPdQUL3OeuMrcoqo+KFzT6g/Y=; fh=+stHDcRFGRF0IvBvJqE2PklSr1Su+mSlXZveFLe5su4=; b=qEoZKp5b3QcOyCEQO7t/X51WMkLkC5LMouUnGUsAmlbEktKHcBY6rvpGadJb4anjRb 9qDho9Ka0XX7WlsT9SZpPjt6YIWa1BDC8JeZa9T/om07yYh8a0iHJcmTvV7PF2cNefm/ qnOxpQuvSrv3hDGKC3oBd2yL9qdPX0Vco4Iun7HS+7s5Wg1GcaNq9fpnrJhAShX97a5i 9eIF/pfQWCT7UJEvVI8JOyKULECKs4U8LcZ2JxnnWMaYY9Q8N0TUV5VWxnmGLldNFgxH y7UgBxWqyF1hke3Fh/YI/Yv1iKqMIOFZorrP7hDZntWCJ2b5ZkpF2eTSF58nlKVnEwVB L6nA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=vFuZdiuA; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:3 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 lipwig.vger.email (lipwig.vger.email. [2620:137:e000::3:3]) by mx.google.com with ESMTPS id y30-20020aa79e1e000000b00690258a9766si4043186pfq.373.2023.10.29.15.58.09 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 29 Oct 2023 15:58:09 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:3 as permitted sender) client-ip=2620:137:e000::3:3; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=vFuZdiuA; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:3 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 lipwig.vger.email (Postfix) with ESMTP id 73F3A805D55E; Sun, 29 Oct 2023 15:58:07 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at lipwig.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230226AbjJ2W57 (ORCPT + 99 others); Sun, 29 Oct 2023 18:57:59 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33306 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231424AbjJ2W5l (ORCPT ); Sun, 29 Oct 2023 18:57:41 -0400 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9473F10E3; Sun, 29 Oct 2023 15:56:06 -0700 (PDT) Received: by smtp.kernel.org (Postfix) with ESMTPSA id B1DB1C433CD; Sun, 29 Oct 2023 22:55:59 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1698620160; bh=dOPID+WAHBe+1C/wlvaKW7GPyApeXN5OKVtbv1qYIlE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=vFuZdiuAz1Hq8npp/tH4kf8nmRYWDbNqDr8r9bk2prj6YiAbQJHyJpvnnxOynheIx SzPEAn1xOvL/7UP9N31bTWhq3bikvFR75GDalHPxTgPzsMU8O2PfHpqOOoFvuHyv9g fn+p9RwgCLjjzXMhANVh8E/ba8197MGv31Q9b0JL2iBDI2EAYYEMFOOQBX1B+3Dpvy TGIcvCQhfxVoTxmkDYsvkuJtbeptWO6QcatVYTLsWX68Va3kXCj5QuMKps97DOfzvS 1odL9ycYNu1CjjmPLCbbGTyZEy3eCC2Qew7wOALSgZhuJnrW2sFshWsOMEfru1MgrD hIYOop/UUk+Lw== 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 34/52] fbdev: core: cfbcopyarea: fix sloppy typing Date: Sun, 29 Oct 2023 18:53:21 -0400 Message-ID: <20231029225441.789781-34-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 lipwig.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 (lipwig.vger.email [0.0.0.0]); Sun, 29 Oct 2023 15:58:07 -0700 (PDT) From: Sergey Shtylyov [ Upstream commit 7f33df94cf0156f64eee9509bd9b4a178990f613 ] In cfb_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/cfbcopyarea.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/video/fbdev/core/cfbcopyarea.c b/drivers/video/fbdev/core/cfbcopyarea.c index 6d4bfeecee350..5b80bf3dae504 100644 --- a/drivers/video/fbdev/core/cfbcopyarea.c +++ b/drivers/video/fbdev/core/cfbcopyarea.c @@ -382,7 +382,7 @@ void cfb_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 __iomem *base = NULL; int bits = BITS_PER_LONG, bytes = bits >> 3; unsigned dst_idx = 0, src_idx = 0, rev_copy = 0; -- 2.42.0