lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20221029222936.GD24473@ranerica-svr.sc.intel.com>
Date:   Sat, 29 Oct 2022 15:29:36 -0700
From:   Ricardo Neri <ricardo.neri-calderon@...ux.intel.com>
To:     "Rafael J. Wysocki" <rafael@...nel.org>
Cc:     "Rafael J. Wysocki" <rafael.j.wysocki@...el.com>,
        Ricardo Neri <ricardo.neri@...el.com>,
        "Ravi V. Shankar" <ravi.v.shankar@...el.com>,
        Daniel Lezcano <daniel.lezcano@...aro.org>,
        Amit Kucheria <amitk@...nel.org>,
        Zhang Rui <rui.zhang@...el.com>,
        Len Brown <len.brown@...el.com>,
        Srinivas Pandruvada <srinivas.pandruvada@...ux.intel.com>,
        Aubrey Li <aubrey.li@...ux.intel.com>,
        Haowen Bai <baihaowen@...zu.com>, linux-pm@...r.kernel.org,
        linux-kernel@...r.kernel.org
Subject: Re: [PATCH] thermal: intel: hfi: Improve the type of
 hfi_features::nr_table_pages

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
> <ricardo.neri-calderon@...ux.intel.com> 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 <daniel.lezcano@...aro.org>
> > Cc: Amit Kucheria <amitk@...nel.org>
> > Cc: Zhang Rui <rui.zhang@...el.com>
> > Cc: Len Brown <len.brown@...el.com>
> > Cc: Srinivas Pandruvada <srinivas.pandruvada@...ux.intel.com>
> > Cc: Aubrey Li <aubrey.li@...ux.intel.com>
> > Cc: Haowen Bai <baihaowen@...zu.com>
> > Cc: linux-pm@...r.kernel.org
> > Cc: linux-kernel@...r.kernel.org
> > Signed-off-by: Ricardo Neri <ricardo.neri-calderon@...ux.intel.com>
> > ---
> >  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!

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ