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] [thread-next>] [day] [month] [year] [list]
Message-ID: <ZWi3iN3HDc92eMFO@pluto>
Date:   Thu, 30 Nov 2023 16:25:44 +0000
From:   Cristian Marussi <cristian.marussi@....com>
To:     Sudeep Holla <sudeep.holla@....com>
Cc:     Sibi Sankar <quic_sibis@...cinc.com>,
        linux-arm-msm@...r.kernel.org, linux-kernel@...r.kernel.org,
        quic_mdtipton@...cinc.com, linux-arm-kernel@...ts.infradead.org,
        quic_asartor@...cinc.com, quic_lingutla@...cinc.com
Subject: Re: [PATCH 2/3] firmware: arm_scmi: Fix freq/power truncation in the
 perf protocol

On Thu, Nov 30, 2023 at 01:56:56PM +0000, Sudeep Holla wrote:
> On Thu, Nov 30, 2023 at 12:49:42PM +0000, Cristian Marussi wrote:
> > On Thu, Nov 30, 2023 at 12:05:06PM +0000, Sudeep Holla wrote:
> > > On Wed, Nov 29, 2023 at 12:27:47PM +0530, Sibi Sankar wrote:
> > > > Fix frequency and power truncation seen in the performance protocol by
> > > > casting it with the correct type.
> > > >
> > > 
> > > While I always remembered to handle this when reviewing the spec, seem to
> > > have forgotten when it came to handling in the implementation :(. Thanks
> > > for spotting this.
> > > 
> > > However I don't like the ugly type casting. I think we can do better. Also
> > > looking at the code around the recently added level index mode, I think we
> > > can simplify things like below patch.
> > > 
> > > Cristian,
> > > What do you think ?
> > > 
> > 
> > Hi
> > 
> > the cleanup seems nice in general to compact the mult_factor multipliers
> > in one place, and regarding addressing the problem of truncation without
> > the need of the explicit casting, should not be enough to change to
> > additionally also change mult_factor to be an u64 ?
> >
> 
> I started exactly with that, but when I completed the patch, there was no
> explicit need for it, so dropped it again. I can bump mult_factor to be
> u64 but do you see any other place that would need it apart from having
> single statement that does multiplication and assignment ? I am exploiting
> the conditional based on level_indexing_mode here but I agree it may help
> in backporting if I make mult_factor u64.
> 

Ah right

   freq *= dom->multi_fact;

does the trick..but cannot this by itself (under unplausibl conds)
overflow and does not fit into a u32 mult_factor ?

 dom_info->mult_factor =
 	(dom_info->sustained_freq_khz * 1000UL)
	/ dom_info->sustained_perf_level;


Thanks,
Cristian

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ