Received: by 2002:a05:7412:a9a2:b0:e2:908c:2ebd with SMTP id o34csp2592280rdh; Mon, 30 Oct 2023 01:41:21 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHLI7i5v8EVoLHkmsqm37t9gzdFM/mlthxLwf1GgsmFaGgtBCRhrMGe320hvecymDgcO9ok X-Received: by 2002:a05:6a20:7289:b0:17a:fa76:8062 with SMTP id o9-20020a056a20728900b0017afa768062mr8910143pzk.19.1698655281575; Mon, 30 Oct 2023 01:41:21 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1698655281; cv=none; d=google.com; s=arc-20160816; b=V1O0C++cacDqTdp10D7qBjvQxwjhY1CJBFNVJfoAZIM9m68+5DQRX8PEUa81T3Len/ 4RyiKtRH/lC31EmA1qGa29UAKwslfiInq4q2O4/sbbnADwXQ4hvPFMWFAO7uGnioZPTb OkMb4bBi7+QsvVV7/8PI0TLDvSnd9MdOCantG9JJMqWbdf3Es7qGEoJu/eFzilaNh3Zn ixaY43x9WN7JsJyBl7fDSBbUZjtD0jYyyec59J6/YrHlIhtS6lZWMehBzTBaYUtEaIMZ SnFmRKQrz9YZkAZJKXDcck6VRwfkRfMOUgqeF4zWM2SWHJHlJmAmQadgiVE92PP3ZNpU Q7Wg== 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=ABm2opYmNqPAmPKCFR7Z23vTzh0qIx73OxkE23MJNmo=; fh=tPdpM44qqiOfLOYu5qfu5DZkLWoGErY4Wx94u61uVaw=; b=Rp8+hZYbY0kdm0e3mtKRaOO22UvKBeYuTwAdTudEJ0UHRPGLfGzTNplcruDvX8NsBz fa+x4i5Cfg3Y+I47fe6drtiEP724tGmRaBCIQeV5S9XOO8iZBslFPv2iaJkGILrzfLPM eaE/Kr7e1ldUMakbeneU9L8243s2QH84lQq6jeMO+JqbF4DSCQJt5xBtiIwGBpFCq7qw xIl2fkQp+C14Q87MLcRSq0u1O5leppmz0pHxN9L5M4fvpT8EDf6jZakMYBlM/yt9M1Ny Mf2zbw//kQt4q17azapENg60N7CuAnZ5VfGX+0NuNuJq7CbJryHTz5UDWGZXo8zxkH8m x4NQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:6 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from pete.vger.email (pete.vger.email. [2620:137:e000::3:6]) by mx.google.com with ESMTPS id d8-20020a056a0010c800b00690dbd360basi4616402pfu.152.2023.10.30.01.41.20 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 30 Oct 2023 01:41:21 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:6 as permitted sender) client-ip=2620:137:e000::3:6; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:6 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 pete.vger.email (Postfix) with ESMTP id EABFA8065E27; Mon, 30 Oct 2023 01:41:02 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at pete.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231289AbjJ3Iku (ORCPT + 99 others); Mon, 30 Oct 2023 04:40:50 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42620 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231741AbjJ3Iks (ORCPT ); Mon, 30 Oct 2023 04:40:48 -0400 Received: from mx01.omp.ru (mx01.omp.ru [90.154.21.10]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8436BB7; Mon, 30 Oct 2023 01:40:45 -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:40:38 +0300 Subject: Re: [PATCH AUTOSEL 6.5 35/52] fbdev: core: syscopyarea: fix sloppy typing To: Sasha Levin , , CC: Helge Deller , , , References: <20231029225441.789781-1-sashal@kernel.org> <20231029225441.789781-35-sashal@kernel.org> From: Sergey Shtylyov Organization: Open Mobile Platform Message-ID: Date: Mon, 30 Oct 2023 11:40:37 +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-35-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:31:24 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: d41d8cd98f00b204e9800998ecf8427e.com:7.1.1;127.0.0.199:7.1.2;omp.ru: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:36: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 pete.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 (pete.vger.email [0.0.0.0]); Mon, 30 Oct 2023 01:41:03 -0700 (PDT) On 10/30/23 1:53 AM, Sasha Levin wrote: > 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; This one doesn't seem necessary in the stable kernels too... MBR, Sergey