Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1460627
| From | Dave Hansen <dave.hansen@intel.com> |
|---|---|
| Newsgroups | linux.kernel |
| Subject | Re: [PATCH] mm: Add the ram_latent_entropy kernel parameter |
| Date | 2016-08-11 17:50 +0200 |
| Message-ID | <s50p4-5GR-37@gated-at.bofh.it> (permalink) |
| References | <s4KaC-2JP-19@gated-at.bofh.it> |
| Organization | linux.* mail to news gateway |
On 08/10/2016 03:28 PM, Kees Cook wrote:
> + if (ram_latent_entropy && !PageHighMem(page) &&
> + page_to_pfn(page) < 0x100000) {
> + u64 hash = 0;
> + size_t index, end = PAGE_SIZE * nr_pages / sizeof(hash);
> + const u64 *data = lowmem_page_address(page);
> +
> + for (index = 0; index < end; index++)
> + hash ^= hash + data[index];
> + add_device_randomness((const void *)&hash, sizeof(hash));
> + }
When I was first reading this, I thought it was using the _addresses_ of
the freed memory for entropy. But it's actually using the _contents_.
The description could probably use a wee bit of sprucing up.
It might also be nice to say in the patch description (and the
Documentation/) what you expect to be in this memory. It will obviously
be zeros for the vast majority of the space, but I do wonder what else
ends up in there in practice.
Why is it limited to 4GB? Just so it doesn't go and try to XOR the
contents of a multi-TB system if it got turned on there? :)
Back to linux.kernel | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
[PATCH] mm: Add the ram_latent_entropy kernel parameter Kees Cook <keescook@chromium.org> - 2016-08-11 00:30 +0200 Re: [PATCH] mm: Add the ram_latent_entropy kernel parameter Dave Hansen <dave.hansen@intel.com> - 2016-08-11 17:50 +0200 Re: [PATCH] mm: Add the ram_latent_entropy kernel parameter Balbir Singh <bsingharora@gmail.com> - 2016-08-12 06:00 +0200
csiph-web