| From: |
| Mark Salyzyn <salyzyn-AT-android.com> |
| To: |
| linux-kernel-AT-vger.kernel.org |
| Subject: |
| [PATCH 0/4 v2] random add rng-seed to command line option |
| Date: |
| Mon, 10 Feb 2020 06:45:01 -0800 |
| Message-ID: |
| <20200210144512.180348-1-salyzyn@android.com> |
| Cc: |
| kernel-team-AT-android.com, Mark Salyzyn <salyzyn-AT-android.com> |
| Archive-link: |
| Article |
A followup to commit 428826f5358c922dc378830a1717b682c0823160
("fdt: add support for rng-seed") to extend what was started
with Open Firmware (OF or Device Tree) parsing, but also add
it to the command line.
If CONFIG_RANDOM_TRUST_BOOTLOADER is set, then feed the rng-seed
command line option length as added trusted entropy.
Always erase all views of the rng-seed option, except early command
line parsing, to prevent leakage to applications or modules, to
eliminate any attack vector.
It is preferred to add rng-seed to the Device Tree, but some
platforms do not have this option, so this adds the ability to
provide some command-line-limited data to the entropy through this
alternate mechanism. Expect on average 6 bits of useful entropy
per character.
Mark Salyzyn (4):
init: move string constants to __initconst section
init: boot_command_line can be truncated
random: rng-seed source is utf-8
random: add rng-seed= command line option
---
v2
- Split into four bite sized patches.
- Correct spelling in commit message.
- rng-seed is assumed to be utf-8, so correct both to 6 bits/character
of collected entropy.
- Move entropy collection to a static __always_inline helper function.
drivers/char/random.c | 10 +++-
include/linux/random.h | 5 ++
init/main.c | 115 ++++++++++++++++++++++++++++++-----------
3 files changed, 100 insertions(+), 30 deletions(-)
--
2.25.0.341.g760bfbb309-goog