forked from linuxboot/heads
-
-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
WiP: config/coreboot* : activate trust_cpu, let system defined proper…
… jitter entropy but set settings for high mem - jitterentropy_rng.kcapi=1 was missing to activate jitter - random.trust_cpu=1 is needed so the kernel trusts the CPU's hardware random number generator and use it as one of the sources of entropy for its pseudo-random number generator. - kernel.jitterentropy.ll and kernel.jitterentropy.ml The default values are 0 and 0, which means that the jitterentropy library will use a variable number of loop iterations based on the CPU speed. - kernel.jitterentropy.bs and kernel.jitterentropy.bc to use more RAM in the memory access loop. The default values are 64 and 16, which means that the memory access loop will use a buffer size of 64 bytes and a cache line size of 16 bytes. However, you can set them to larger values, such as 256 and 64, or even higher, such as 1024 and 256. This will make the memory access loop consume more memory, but may also generate more noise and entropy - kernel.jitterentropy.bs and kernel.jitterentropy.bc to use more RAM in the memory access loop. The default values are 64 and 16, which means that the memory access loop will use a buffer size of 64 bytes and a cache line size of 16 bytes. However, setting them to larger values, such as 256 and 64, or even higher, such as 1024 and 256 will make the memory access loop consume more memory, but may also generate more noise and entropy Test guidelines: - To see the test points for jitter, you can run `dmesg | grep -i jitter`. You should see something like this: ``` [ 0.000000] Linux version 5.14.0-arch1-1 (linux@archlinux) (gcc (GCC) 11.1.0, GNU ld (GNU Binutils) 2.36.1) #1 SMP PREEMPT Sun, 29 Aug 2021 12:50:37 +0000 [ 0.000000] Command line: BOOT_IMAGE=/boot/vmlinuz-linux root=UUID=... rw random.trust_cpu=1 kernel.jitterentropy.ll=100 kernel.jitterentropy.ml=100 kernel.jitterentropy.bs=256 kernel.jitterentropy.bc=64 rng_core.default_quality=500 jitterentropy_rng.kcapi=1 [ 0.000000] Kernel command line: BOOT_IMAGE=/boot/vmlinuz-linux root=UUID=... rw random.trust_cpu=1 kernel.jitterentropy.ll=100 kernel.jitterentropy.ml=100 kernel.jitterentropy.bs=256 kernel.jitterentropy.bc=64 rng_core.default_quality=500 jitterentropy_rng.kcapi=1 [ 0.000000] x86/fpu: Supporting XSAVE feature 0x001: 'x87 floating point registers' [ 0.000000] x86/fpu: Supporting XSAVE feature 0x002: 'SSE registers' [ 0.000000] x86/fpu: Supporting XSAVE feature 0x004: 'AVX registers' [ 0.000000] x86/fpu: xstate_offset[2]: 576, xstate_sizes[2]: 256 [ 0.000000] x86/fpu: Enabled xstate features 0x7, context size is 832 bytes, using 'compacted' format. ... [ 3.123456] jitterentropy_rng: Jitter RNG initialized with kcapi hash ¹ ... ``` This shows that the jitter entropy generator is enabled and initialized with the kcapi hash option, which uses the kernel crypto API to perform the hashing operation ². The jitter entropy generator will inject entropy into the kernel's random pool using the RNDADDENTROPY ioctl ³. - To see the test points for cpu extension, you can run `dmesg | grep -i rdrand`. You should see something like this: ``` [ 0.000000] Linux version 5.14.0-arch1-1 (linux@archlinux) (gcc (GCC) 11.1.0, GNU ld (GNU Binutils) 2.36.1) #1 SMP PREEMPT Sun, 29 Aug 2021 12:50:37 +0000 [ 0.000000] Command line: BOOT_IMAGE=/boot/vmlinuz-linux root=UUID=... rw random.trust_cpu=1 kernel.jitterentropy.ll=100 kernel.jitterentropy.ml=100 kernel.jitterentropy.bs=256 kernel.jitterentropy.bc=64 rng_core.default_quality=500 jitterentropy_rng.kcapi=1 [ 0.000000] Kernel command line: BOOT_IMAGE=/boot/vmlinuz-linux root=UUID=... rw random.trust_cpu=1 kernel.jitterentropy.ll=100 kernel.jitterentropy.ml=100 kernel.jitterentropy.bs=256 kernel.jitterentropy.bc=64 rng_core.default_quality=500 jitterentropy_rng.kcapi=1 [ 0.000000] x86/fpu: Supporting XSAVE feature 0x001: 'x87 floating point registers' [ 0.000000] x86/fpu: Supporting XSAVE feature 0x002: 'SSE registers' [ 0.000000] x86/fpu: Supporting XSAVE feature 0x004: 'AVX registers' [ 0.000000] x86/fpu: xstate_offset[2]: 576, xstate_sizes[2]: 256 [ 0.000000] x86/fpu: Enabled xstate features 0x7, context size is 832 bytes, using 'compacted' format. ... [ 3.456789] random: crng done (trusting CPU's manufacturer) ⁴ ... ``` This shows that the rdrand instruction is enabled and trusted as a source of entropy for the kernel's PRNG . The kernel will use rdrand to improve the entropy of its PRNG, by xor'ing the values received from rdrand with other sources of randomness . - To see the test points for tpm, you can run `dmesg | grep -i tpm`. You should see something like this: ``` [ 0.000000] Linux version 5.14.0-arch1-1 (linux@archlinux) (gcc (GCC) 11.1.0, GNU ld (GNU Binutils) 2.36.1) #1 SMP PREEMPT Sun, 29 Aug 2021 12:50:37 +0000 [ 0.000000] Command line: BOOT_IMAGE=/boot/vmlinuz-linux root=UUID=... rw random.trust_cpu=1 kernel.jitterentropy.ll=100 kernel.jitterentropy.ml=100 kernel.jitterentropy.bs=256 kernel.jitterentropy.bc=64 rng_core.default_quality=500 jitterentropy_rng.kcapi=1 [ 0.000000] Kernel command line: BOOT_IMAGE=/boot/vmlinuz-linux root=UUID=... rw random.trust_cpu=1 kernel.jitterentropy.ll=100 kernel.jitterentropy.ml=100 kernel.jitterentropy.bs=256 kernel.jitterentropy.bc=64 rng_core.default_quality=500 jitterentropy_rng.kcapi=1 [ 0.000000] x86/fpu: Supporting XSAVE feature 0x001: 'x87 floating point registers' [ 0.000000] x86/fpu: Supporting XSAVE feature 0x002: 'SSE registers' [ 0.000000] x86/fpu: Supporting XSAVE feature 0x004: 'AVX registers' [ 0.000000] x86/fpu: xstate_offset[2]: 576, xstate_sizes[2]: 256 [ 0.000000] x86/fpu: Enabled xstate features 0x7, context size is 832 bytes, using 'compacted' format. ... [ 3.789012] tpm_tis MSFT0101:00: [Firmware Bug]: ACPI region does not cover the entire command/response buffer. [mem 0xfed40000-0xfed4087f flags 0x200] vs fed40080 f80 [ 3.789012] tpm_tis MSFT0101:00: [Firmware Bug]: ACPI region does not cover the entire command/response buffer. [mem 0xfed40000-0xfed4087f flags 0x200] vs fed40080 f80 [ 3.789012] tpm_tis MSFT0101:00: TPM2 command buffer too small! Adjusting to minimum size [ 3.789012] tpm_tis MSFT0101:00: TPM2 command buffer too small! Adjusting to minimum size [ 3.789012] tpm_tis MSFT0101:00: [Firmware Bug]: TPM interrupt not working, polling instead [ 3.789012] tpm_tis MSFT0101:00: [Firmware Bug]: TPM interrupt not working, polling instead ... ``` This shows that the tpm device is detected and initialized by the kernel, but with some firmware bugs that affect its functionality . The tpm device can provide random numbers through its Get Random command . The kernel can use the tpm device as an entropy source for its PRNG, by reading from /dev/tpm0 or /dev/tpmrm0 .
- Loading branch information
Showing
36 changed files
with
38 additions
and
39 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.