Received: by 2002:a25:e74b:0:0:0:0:0 with SMTP id e72csp278470ybh; Sun, 12 Jul 2020 06:10:24 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwagv4uKVgrtPrz5j4zZKZoZ/lFspG/zsaGTf/2w/J8SdI3409909Z3hrkvgcVR6zG4Ib0W X-Received: by 2002:a50:8f83:: with SMTP id y3mr45009663edy.257.1594559424610; Sun, 12 Jul 2020 06:10:24 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1594559424; cv=none; d=google.com; s=arc-20160816; b=rAzMc6W346AcMZuOcqlYCfgIyI5UmeKeCgcUYCEg0IX3UnQ8itSfU50Mq2o5D7g0Ng mg8YtTyKB8HN3Gk7EHovGQQdTKKSCkum+OtpNIwnPNWGQ36vogtYcRyU3j8o83y9ryg7 HAzOLjq4vwDXzjphFG4Dke5IWGItd5TZmrtbsjmo3sP9WsDWzYwNtjxcadex2ajMntHx nzfwhfQzVw5rZrjPzL4Qaro/Qfyb9xiG3jFIP3bsFfDHV6bG0DBj12ikiOGFKHICAD5D w89fuybe/yOP/pEcEAQqaCkS5gRCKhXp9yWHsrvH9sEevXQNC7L5HZIGZ7dP7GN3wXwh lXAw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject:dkim-signature:dkim-filter; bh=DhxKjXp9j9Y+OP7wZRkqCMpDWKtGRRwN1/eUrDQnlI8=; b=hxsdpVs6YFL8JE61QHmBnUUSReA7hNnoO2hTwJjlYes06AP0ZnywG8ChoYUlUHTgfg YMszEoSfj5yTOWdN7Ocyws8cUXFMXj+zgGB2XMEb/UCotyVmECrVdAxtJNvvH6nuNxDS qt49SHo4YmPlgxrlTF46ooDe8mWKQbt0uGvgUI2bF2SoCJZxJ8Sl5+H+B5lZ+2vQoueM 4BqqiCIPaxH4qpDtv7/dwg3bw8TZzP1o3lIJu4qIilpyBRo8wT8MxxfxUeR0hMMkMhc3 GSF3LBrM7aka1B38leFhvpl2zf64ANYZRGCaN7WdP1JKFwX+xBZzvQ/FnkU8qrKLgp+9 IG9Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@zytor.com header.s=2020062301 header.b=WKLLzGtA; 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=zytor.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id lj8si7501293ejb.60.2020.07.12.06.09.59; Sun, 12 Jul 2020 06:10:24 -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=@zytor.com header.s=2020062301 header.b=WKLLzGtA; 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=zytor.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728786AbgGLNJc (ORCPT + 99 others); Sun, 12 Jul 2020 09:09:32 -0400 Received: from terminus.zytor.com ([198.137.202.136]:49995 "EHLO mail.zytor.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728686AbgGLNJb (ORCPT ); Sun, 12 Jul 2020 09:09:31 -0400 Received: from carbon-x1.hos.anvin.org ([IPv6:2601:646:8600:3281:e7ea:4585:74bd:2ff0]) (authenticated bits=0) by mail.zytor.com (8.15.2/8.15.2) with ESMTPSA id 06CD9KIY950515 (version=TLSv1.3 cipher=TLS_AES_128_GCM_SHA256 bits=128 verify=NO); Sun, 12 Jul 2020 06:09:21 -0700 DKIM-Filter: OpenDKIM Filter v2.11.0 mail.zytor.com 06CD9KIY950515 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=zytor.com; s=2020062301; t=1594559361; bh=DhxKjXp9j9Y+OP7wZRkqCMpDWKtGRRwN1/eUrDQnlI8=; h=Subject:To:Cc:References:From:Date:In-Reply-To:From; b=WKLLzGtAO5g2GMPmtY6lS1CTgbOzhjV3m5L2/acFl6QDxOTyosmNC90B6XvkuewMb PAuFw/HKQi/AZpvid2yAJk9IjthOv8k674kf6sE0sUAUYaqt0IcbLy+CIvImqS2mA8 p51fRKaLqVA1FuIpsFFySaFLm2/dGns33TP2mpWj9VHIh6fuRsCablAIG1WSWLVhdR RANZ2LZbVmuJhBoH2Mb5N8KnVUcMlqmYtxAsR0+F/c6aHhr5jrrmNEBQwOO39kx02G svzSbowQgl+jSkUQAWnkRHh1zj5Slwq5RWubEo8RpJa8isCobD7o4HWJJAP9rX/nff 6oX/vRpIn6qHA== Subject: Re: [PATCH] decompress_bunzip2: fix sizeof type in start_bunzip To: trix@redhat.com, alain@knaff.lu Cc: linux-kernel@vger.kernel.org, stable@vger.kernel.org References: <20200712125952.8809-1-trix@redhat.com> From: "H. Peter Anvin" Message-ID: <639c8ef5-2755-7172-fbb8-ce45c8637feb@zytor.com> Date: Sun, 12 Jul 2020 06:09:15 -0700 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.9.0 MIME-Version: 1.0 In-Reply-To: <20200712125952.8809-1-trix@redhat.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 2020-07-12 05:59, trix@redhat.com wrote: > From: Tom Rix > > clang static analysis flags this error > > lib/decompress_bunzip2.c:671:13: warning: Result of 'malloc' is converted > to a pointer of type 'unsigned int', which is incompatible with sizeof > operand type 'int' [unix.MallocSizeof] > bd->dbuf = large_malloc(bd->dbufSize * sizeof(int)); > ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ > > Reviewing the bunzip_data structure, the element dbuf is type > > /* Intermediate buffer and its size (in bytes) */ > unsigned int *dbuf, dbufSize; > > So change the type in sizeof to 'unsigned int' > You must be kidding. If you want to change it, change it to sizeof(bd->dbuf) instead, but this flag is at least in my opinion a total joke. For sizeof(int) != sizeof(unsigned int) is beyond bizarre, no matter how stupid the platform. -hpa