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: <20230823110739.4oqyhjca7ratf5sx@viti.kaiser.cx>
Date:   Wed, 23 Aug 2023 13:07:39 +0200
From:   Martin Kaiser <martin@...ser.cx>
To:     Alexander Stein <alexander.stein@...tq-group.com>
Cc:     Herbert Xu <herbert@...dor.apana.org.au>,
        linux-arm-kernel@...ts.infradead.org, linux-crypto@...r.kernel.org,
        linux-kernel@...r.kernel.org
Subject: Re: [PATCH 1/3] hwrng: imx-rngc - use polling to detect end of self
 test

Hi Alexander,

thanks for reviewing the patches.

Alexander Stein (alexander.stein@...tq-group.com) wrote:

> Am Dienstag, 22. August 2023, 17:25:51 CEST schrieb Martin Kaiser:
> > Use polling to detect the end of the rngc self test. This is much simpler
> > than using an interrupt and a completion.

> > Active waiting is no disadvantage here. The self test is run during
> > probe, there's nothing we could do in parallel at this time.

> If this driver is built-in you are stalling the boot process while
> polling, no?

According to the manual, "The self test takes approximately 29,000
cycles to complete." On my system, the rngb peripheral clock runs at
66.5MHz, i.e. the self test takes 436us.

A poll interval of 480us and a timeout of 1.5ms are more appropriate
than the current values (1ms poll interval, 3sec timeout). I'll fix this
in v2.

If it is unacceptable for a probe function to run for 1.5ms, we could
probably move the self test to the init function. It's called when the
rng is selected as the active rng.

> Unless probe_type = PROBE_PREFER_ASYNCHRONOUS is set of
> course.

This does not work for drivers that use module_platform_driver_probe.

We could switch to module_platform_driver. I'd prefer fixing the timing
or moving the self test to init, though.

Best regards,
Martin

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ