Received: by 2002:a05:7412:a9a2:b0:e2:908c:2ebd with SMTP id o34csp2591762rdh; Mon, 30 Oct 2023 01:39:47 -0700 (PDT) X-Google-Smtp-Source: AGHT+IG9RxHRDnJm92/mvQMaowUtJRDQ7VJQnlYiGxldd8voyqtXNl7GESZidZYKOpEaqottqSw2 X-Received: by 2002:a17:903:2342:b0:1cc:4a70:1373 with SMTP id c2-20020a170903234200b001cc4a701373mr2038577plh.58.1698655186761; Mon, 30 Oct 2023 01:39:46 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1698655186; cv=none; d=google.com; s=arc-20160816; b=Qi0SftPIl53XSUVCuiyX+vsQruL6Tmg62Pr3aBrilGSkltiXOZ1AMHeG3ucFvPPB8O 8u0tt5+6+7sncJQ2JoM6ebzDt92KKvFQNgYimc2Tv2bHnbyyd72eHWUMTU2A9HLhHKNV bYtAQX09A1/nrKnmwlZBJtvvDUU8mFljIm3WJLxrudWY17p09/Z+v+8OEGXzxDjP6bjc yTTqibK/8I/cLz0AXsDlW10/nqvqfmvrr37mf4xBD9Oubz/jbrXooD9miFivlFekS05v s7T/XINSqoItCaAbdL0D/vQ7moVKGjliVwlD4Mk2kZGBq/7T5pQ+yde+Fc0Umk+fMsZh BerQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:content-language :in-reply-to:mime-version:user-agent:date:message-id:organization :from:references:cc:to:subject; bh=qo7crF9n6pic+H00JdmBsgJO0YKRACVmVIWM7Qfl7uA=; fh=tPdpM44qqiOfLOYu5qfu5DZkLWoGErY4Wx94u61uVaw=; b=jfLrYEjwUA3oBd2gzyCqaCEoHLhOQbHwxyQjK9ZhVmy/9Rh5nxUYFlA8aOcMifACe+ 17zuCWNFeAKOdpOJ/CXJIHLwsIJ/6Zgujxcz4GV/sz6gOKIpjzZWVns/ZeO26KoVH/NC sFl64n1AaLIuxaGUxQJVkEwYvb2dnE9E38BB51xOFOvWfPpJ/UxcoEjSQTT6+95jNR8z gFPQxwqGOq5qItuTxBASvNz+f7kWxkmKKmGa9eFywjrkRBnNAsQ1rEsYh42OV4+DnyAw Vc4iJCWLkCkxTl/VttTb0lnFhQCmveU8WlYPvpkapDcAYJLzfMPqEx8nohzhLrY4JV0J guuA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.35 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from groat.vger.email (groat.vger.email. [23.128.96.35]) by mx.google.com with ESMTPS id d6-20020a170902654600b001c724f997ffsi4779230pln.131.2023.10.30.01.39.46 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 30 Oct 2023 01:39:46 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.35 as permitted sender) client-ip=23.128.96.35; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.35 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by groat.vger.email (Postfix) with ESMTP id 27B338089E40; Mon, 30 Oct 2023 01:39:44 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at groat.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232177AbjJ3Ij2 (ORCPT + 99 others); Mon, 30 Oct 2023 04:39:28 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53114 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231741AbjJ3Ij1 (ORCPT ); Mon, 30 Oct 2023 04:39:27 -0400 Received: from mx01.omp.ru (mx01.omp.ru [90.154.21.10]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1E32BA7; Mon, 30 Oct 2023 01:39:24 -0700 (PDT) Received: from [192.168.1.103] (178.176.73.57) by msexch01.omp.ru (10.188.4.12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.2.1258.12; Mon, 30 Oct 2023 11:39:14 +0300 Subject: Re: [PATCH AUTOSEL 6.5 34/52] fbdev: core: cfbcopyarea: fix sloppy typing To: Sasha Levin , , CC: Helge Deller , , , References: <20231029225441.789781-1-sashal@kernel.org> <20231029225441.789781-34-sashal@kernel.org> From: Sergey Shtylyov Organization: Open Mobile Platform Message-ID: Date: Mon, 30 Oct 2023 11:39:14 +0300 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.10.1 MIME-Version: 1.0 In-Reply-To: <20231029225441.789781-34-sashal@kernel.org> Content-Type: text/plain; charset="utf-8" Content-Language: en-US Content-Transfer-Encoding: 7bit X-Originating-IP: [178.176.73.57] X-ClientProxiedBy: msexch01.omp.ru (10.188.4.12) To msexch01.omp.ru (10.188.4.12) X-KSE-ServerInfo: msexch01.omp.ru, 9 X-KSE-AntiSpam-Interceptor-Info: scan successful X-KSE-AntiSpam-Version: 6.0.0, Database issued on: 10/30/2023 08:22:09 X-KSE-AntiSpam-Status: KAS_STATUS_NOT_DETECTED X-KSE-AntiSpam-Method: none X-KSE-AntiSpam-Rate: 59 X-KSE-AntiSpam-Info: Lua profiles 180967 [Oct 30 2023] X-KSE-AntiSpam-Info: Version: 6.0.0.2 X-KSE-AntiSpam-Info: Envelope from: s.shtylyov@omp.ru X-KSE-AntiSpam-Info: LuaCore: 543 543 1e3516af5cdd92079dfeb0e292c8747a62cb1ee4 X-KSE-AntiSpam-Info: {rep_avail} X-KSE-AntiSpam-Info: {Tracking_from_domain_doesnt_match_to} X-KSE-AntiSpam-Info: {relay has no DNS name} X-KSE-AntiSpam-Info: {SMTP from is not routable} X-KSE-AntiSpam-Info: {Found in DNSBL: 178.176.73.57 in (user) b.barracudacentral.org} X-KSE-AntiSpam-Info: {Found in DNSBL: 178.176.73.57 in (user) dbl.spamhaus.org} X-KSE-AntiSpam-Info: omp.ru:7.1.1;127.0.0.199:7.1.2;d41d8cd98f00b204e9800998ecf8427e.com:7.1.1 X-KSE-AntiSpam-Info: ApMailHostAddress: 178.176.73.57 X-KSE-AntiSpam-Info: {DNS response errors} X-KSE-AntiSpam-Info: Rate: 59 X-KSE-AntiSpam-Info: Status: not_detected X-KSE-AntiSpam-Info: Method: none X-KSE-AntiSpam-Info: Auth:dmarc=temperror header.from=omp.ru;spf=temperror smtp.mailfrom=omp.ru;dkim=none X-KSE-Antiphishing-Info: Clean X-KSE-Antiphishing-ScanningType: Heuristic X-KSE-Antiphishing-Method: None X-KSE-Antiphishing-Bases: 10/30/2023 08:27:00 X-KSE-Antivirus-Interceptor-Info: scan successful X-KSE-Antivirus-Info: Clean, bases: 10/30/2023 2:39:00 AM X-KSE-Attachment-Filter-Triggered-Rules: Clean X-KSE-Attachment-Filter-Triggered-Filters: Clean X-KSE-BulkMessagesFiltering-Scan-Result: InTheLimit X-Spam-Status: No, score=-3.7 required=5.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,NICE_REPLY_A,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 groat.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 (groat.vger.email [0.0.0.0]); Mon, 30 Oct 2023 01:39:44 -0700 (PDT) Hello! On 10/30/23 1:53 AM, Sasha Levin wrote: > 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; I highly doubt this is necessary to pull that into stable. This was intended to be a cleanup originally. MBR, Sergey