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: <yforvmqwgvkuulicbkbzf4htlcssvo5pz4s6ieksa57whj4smi@lgdnfo2svceq>
Date: Wed, 3 Jul 2024 23:36:14 +0200
From: Uwe Kleine-König <u.kleine-koenig@...libre.com>
To: Andrew Morton <akpm@...ux-foundation.org>
Cc: Nicolas Pitre <nico@...xnic.net>, linux-kernel@...r.kernel.org, 
	Biju Das <biju.das.jz@...renesas.com>
Subject: Re: [PATCH v2 2/2] mul_u64_u64_div_u64: basic sanity test

Hello Andrew,

On Wed, Jul 03, 2024 at 01:47:10PM -0400, Nicolas Pitre wrote:
> On Wed, 3 Jul 2024, Andrew Morton wrote:
> 
> > On Tue,  2 Jul 2024 23:34:09 -0400 Nicolas Pitre <nico@...xnic.net> wrote:
> > 
> > > Verify that edge cases produce proper results, and some more.
> > 
> > Awesome, thanks.
> > 
> > Do you know of any situations in which the present implementation
> > causes issues?
> 
> Uwe could probably elaborate further, but the example given in the 
> first commit log is causing trouble for a driver he's working on.

Actually the example was a constructed one. I became aware of
mul_u64_u64_div_u64() being only an approximation while reviewing a pwm
driver by Biju Das:

https://lore.kernel.org/linux-pwm/TYCPR01MB1126992DD51F714AEDADF0A4F868DA@TYCPR01MB11269.jpnprd01.prod.outlook.com

mul_u64_u64_div_u64 is used in various pwm drivers, but in practise the
periods used are small enough to not be problematic for the status quo
implementation since commit 8c86fb68ffcb ("mul_u64_u64_div_u64: increase
precision by conditionally swapping a and b"). At least I think Biju
(added to Cc:) only hit this problem during testing, and not in a real
world application.

I intend to do a performance test of Nico's code. I hope I get to that
tomorrow.

Best regards
Uwe

Download attachment "signature.asc" of type "application/pgp-signature" (489 bytes)

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ