linux-crypto.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Corentin LABBE <clabbe@baylibre.com>
To: Janpieter Sollie <janpieter.sollie@kabelmail.de>
Cc: linux.amoon@gmail.com, Jason@zx2c4.com, heiko@sntech.de,
	herbert@gondor.apana.org.au, hl@rock-chips.com,
	linux-crypto@vger.kernel.org, linux-kernel@vger.kernel.org,
	linux-rockchip@lists.infradead.org, mike.rudenko@gmail.com,
	robin.murphy@arm.com, shawn.lin@rock-chips.com,
	troy.lin@rock-chips.com, ty@wevs.org
Subject: Re: [PATCH] hw_random: rockchip: import driver from vendor tree
Date: Wed, 25 Sep 2024 17:01:42 +0200	[thread overview]
Message-ID: <ZvQl1i2TfA6JYUDH@Red> (raw)
In-Reply-To: <ef2f6e41-bf9e-470e-a416-fda7ce5d8a51@kabelmail.de>

Le Mon, Sep 23, 2024 at 09:48:54AM +0200, Janpieter Sollie a écrit :
> 
> Hi everybody,
> 
> Is there any chance this random driver will be upstreamed?
> I'm using it instead of the built-in crypto driver (rk3328-crypto), as this crypto driver showed 
> the following:
> 
> > [     9.270549] rk3288-crypto ff060000.crypto: will run requests pump with realtime priority
> > [     9.270687] rk3288-crypto ff060000.crypto: Register ecb(aes) as ecb-aes-rk
> > [     9.270808] rk3288-crypto ff060000.crypto: Register cbc(aes) as cbc-aes-rk
> > [     9.270831] rk3288-crypto ff060000.crypto: Register ecb(des) as ecb-des-rk
> > [     9.270848] rk3288-crypto ff060000.crypto: Register cbc(des) as cbc-des-rk
> > [     9.270864] rk3288-crypto ff060000.crypto: Register ecb(des3_ede) as ecb-des3-ede-rk
> > [     9.270880] rk3288-crypto ff060000.crypto: Register cbc(des3_ede) as cbc-des3-ede-rk
> > [     9.270896] rk3288-crypto ff060000.crypto: Register sha1 as rk-sha1
> > [     9.270915] rk3288-crypto ff060000.crypto: Register sha256 as rk-sha256
> > [     9.270932] rk3288-crypto ff060000.crypto: Register md5 as rk-md5
> 
> so the options here are pretty useless:
> standard tls / ssh (ktls anyone?) almost never uses ecb or cbc ciphers, and about des ... yeah, 
> won't dig into that one.
> I think a rk3328 device will actually benefit more from a entropy source (even if it's not 
> high-quality) than from sha1/256 which are almost always covered by armv8 crypto extensions.
> I tried this patch (and disabled the crypto device in dts), it works.
> Off course there are FIPS failures, but the user employing a rk3328 board probably knows this is 
> not a high-security device.
> 
> Any chances here? applying the patch on 6.6.48 (even with clang thinLTO) works flawlessly.
> 
> kind regards,
> 
> Janpieter Sollie

Did you test if it really works by testing entropy output QUALITY ?

I asked how the serie was tested and the sender never answered raising a big red flag.
If you check the thread, someone tested and the quality bringed by the vendor driver is really BAD.
This is due to the fact that their sample value was really too short.
So as-is, this serie is a security issue to the randomness quality.

I need to regrab some time finishing, my patch adding support for it on intree crypto driver.
I found an old tree that I push here https://github.com/montjoie/linux/tree/rk3288-trng
This is not a final patch, but it could help finding a correct value of sample via the debugfs.
I dont remember which value of sample was necessary to obtain a minimal quality. (perhaps 500 since it seems the default in my patch).

Unfortunatly, I cannot test it immediatly, as my CI controller got some HW issue, and I need to fix them.

Regards

      reply	other threads:[~2024-09-25 15:01 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-09-19 21:00 [PATCH] hw_random: rockchip: import driver from vendor tree Jason A. Donenfeld
2022-09-20  9:35 ` Robin Murphy
2022-09-20  9:49   ` Jason A. Donenfeld
2022-09-27 16:37   ` Aurelien Jarno
2022-09-27 19:46     ` LABBE Corentin
2022-09-27 21:39       ` Aurelien Jarno
2022-09-29  7:45         ` LABBE Corentin
2022-11-16 18:04           ` Mikhail Rudenko
2022-11-22 13:29             ` Corentin LABBE
2022-11-22 15:04               ` Mikhail Rudenko
2023-01-31 10:34   ` Corentin LABBE
2024-06-18 13:27     ` Anand Moon
2024-09-23  7:48       ` Janpieter Sollie
2024-09-25 15:01         ` Corentin LABBE [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=ZvQl1i2TfA6JYUDH@Red \
    --to=clabbe@baylibre.com \
    --cc=Jason@zx2c4.com \
    --cc=heiko@sntech.de \
    --cc=herbert@gondor.apana.org.au \
    --cc=hl@rock-chips.com \
    --cc=janpieter.sollie@kabelmail.de \
    --cc=linux-crypto@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-rockchip@lists.infradead.org \
    --cc=linux.amoon@gmail.com \
    --cc=mike.rudenko@gmail.com \
    --cc=robin.murphy@arm.com \
    --cc=shawn.lin@rock-chips.com \
    --cc=troy.lin@rock-chips.com \
    --cc=ty@wevs.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).