From mboxrd@z Thu Jan 1 00:00:00 1970 From: Torsten Duwe Date: Fri, 18 Dec 2020 09:31:53 +0100 Subject: [PATCH v2 0/2] Use RNG to get random behaviour In-Reply-To: <20201216162807.10685-1-matthias.bgg@kernel.org> References: <20201216162807.10685-1-matthias.bgg@kernel.org> Message-ID: <20201218093153.1294099e@blackhole> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de On Wed, 16 Dec 2020 17:28:05 +0100 matthias.bgg at kernel.org wrote: > From: Matthias Brugger > > > For now bootp and uuid code use a weak seed for generating random > data. U-Boot as support for RNG devices now, so we should change to > code to use them if they are present. This will help mitigate issues > like seen in CVE-2019-11690. > > Changes in v2: > - fix dm_rng_read() parameters > - add missing include > - fix dm_rng_read() parameters > - add missing include file One more thing for both patches: https://www.kernel.org/doc/html/latest/process/coding-style.html#conditional-compilation If U-Boot also follows these, it should be if (IS_ENABLED(CONFIG_DM_RNG) ) { ... } Instead of #if defined(...). AFAICS, it's easy to see for the compiler that randv is constantly 0 if only the devp usage is made conditional. That would also be more readable. Torsten