From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id F126DC38A02 for ; Sat, 29 Oct 2022 22:22:49 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229783AbiJ2WWp (ORCPT ); Sat, 29 Oct 2022 18:22:45 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43586 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229441AbiJ2WWn (ORCPT ); Sat, 29 Oct 2022 18:22:43 -0400 Received: from mga02.intel.com (mga02.intel.com [134.134.136.20]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E622133850; Sat, 29 Oct 2022 15:22:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1667082162; x=1698618162; h=date:from:to:cc:subject:message-id:references: mime-version:in-reply-to; bh=zArReFz0K4WZAU7MHhzMeJpctz+eoMR8V6T85As7MO8=; b=eY8yrce/snCPALglB7j634xvg7ux8g4LBxwVRKEXxf4ltOsKFNjP0/NN eLCcquL5Ib0k1LIfYxs5cbM3cwMvvrO0FPcbHufRKd9Upe7my0CTUg3sr s9VlXoHAoT59JLLkuu/h+RffiFGLoNrYY5THcJy8b2qRgtp3WWIPHoU+U Kt+famGlZrClthSq9dQfpEtbH+zQxids7hI4swDYGL9o9rU0N2BzwhqCH 3loHzo18v54u41bQMu0uEGMCMFE+zSsdozrHiv4b/R0kJnPAmAHQFXVFA Nal1c7jdH172pDNCTJAG9ylIY6MqWUCOcEAfdjH2WBEzCZCOnhH2etd+W g==; X-IronPort-AV: E=McAfee;i="6500,9779,10515"; a="296105542" X-IronPort-AV: E=Sophos;i="5.95,224,1661842800"; d="scan'208";a="296105542" Received: from orsmga005.jf.intel.com ([10.7.209.41]) by orsmga101.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 29 Oct 2022 15:22:33 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6500,9779,10515"; a="808169545" X-IronPort-AV: E=Sophos;i="5.95,224,1661842800"; d="scan'208";a="808169545" Received: from ranerica-svr.sc.intel.com ([172.25.110.23]) by orsmga005.jf.intel.com with ESMTP; 29 Oct 2022 15:22:33 -0700 Date: Sat, 29 Oct 2022 15:29:36 -0700 From: Ricardo Neri To: "Rafael J. Wysocki" Cc: "Rafael J. Wysocki" , Ricardo Neri , "Ravi V. Shankar" , Daniel Lezcano , Amit Kucheria , Zhang Rui , Len Brown , Srinivas Pandruvada , Aubrey Li , Haowen Bai , linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] thermal: intel: hfi: Improve the type of hfi_features::nr_table_pages Message-ID: <20221029222936.GD24473@ranerica-svr.sc.intel.com> References: <20221018112240.25647-1-ricardo.neri-calderon@linux.intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.9.4 (2018-02-28) Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Oct 28, 2022 at 08:13:15PM +0200, Rafael J. Wysocki wrote: > On Tue, Oct 18, 2022 at 1:16 PM Ricardo Neri > wrote: > > > > A Coverity static code scan raised a potential overflow_before_widen > > warning when hfi_features::nr_table_pages is used as an argument to > > memcpy in intel_hfi_process_event(). > > > > Even though the overflow can never happen (the maximum number of pages of > > the HFI table is 0x10 and 0x10 << PAGE_SHIFT = 0x10000), using size_t as > > the data type of hfi_features::nr_table_pages makes Coverity happy and > > matches the data type of the argument 'size' of memcpy(). > > > > Cc: Daniel Lezcano > > Cc: Amit Kucheria > > Cc: Zhang Rui > > Cc: Len Brown > > Cc: Srinivas Pandruvada > > Cc: Aubrey Li > > Cc: Haowen Bai > > Cc: linux-pm@vger.kernel.org > > Cc: linux-kernel@vger.kernel.org > > Signed-off-by: Ricardo Neri > > --- > > drivers/thermal/intel/intel_hfi.c | 2 +- > > 1 file changed, 1 insertion(+), 1 deletion(-) > > > > diff --git a/drivers/thermal/intel/intel_hfi.c b/drivers/thermal/intel/intel_hfi.c > > index a0640f762dc5..239afe02e518 100644 > > --- a/drivers/thermal/intel/intel_hfi.c > > +++ b/drivers/thermal/intel/intel_hfi.c > > @@ -137,7 +137,7 @@ struct hfi_instance { > > * Parameters and supported features that are common to all HFI instances > > */ > > struct hfi_features { > > - unsigned int nr_table_pages; > > + size_t nr_table_pages; > > unsigned int cpu_stride; > > unsigned int hdr_size; > > }; > > -- > > Applied as 6.2 material, thanks! Thank you Rafael!