Kernel-hardening Archive on
 help / color / Atom feed
From: Kees Cook <>
Cc: Emese Revfy <>
Subject: [kernel-hardening] [PATCH] latent_entropy: provide userspace visibility
Date: Sat, 18 Jun 2016 11:03:20 -0700
Message-ID: <> (raw)

This is just a toy to look at the latent_entropy value as it changes
from userspace. Not intended for actual use...

Signed-off-by: Kees Cook <>
 kernel/ksysfs.c | 12 ++++++++++++
 1 file changed, 12 insertions(+)

diff --git a/kernel/ksysfs.c b/kernel/ksysfs.c
index 152da4a48867..64aed735098a 100644
--- a/kernel/ksysfs.c
+++ b/kernel/ksysfs.c
@@ -180,6 +180,15 @@ static ssize_t rcu_normal_store(struct kobject *kobj,
 #endif /* #ifndef CONFIG_TINY_RCU */
+static ssize_t latent_entropy_show(struct kobject *kobj,
+				   struct kobj_attribute *attr, char *buf)
+	return sprintf(buf, "0x%08llx\n", latent_entropy);
  * Make /sys/kernel/notes give the raw contents of our kernel .notes section.
@@ -225,6 +234,9 @@ static struct attribute * kernel_attrs[] = {
+	&latent_entropy_attr.attr,

Kees Cook
Chrome OS & Brillo Security

                 reply index

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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:

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

  git send-email \ \ \ \ \

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

Kernel-hardening Archive on

Archives are clonable:
	git clone --mirror kernel-hardening/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 kernel-hardening kernel-hardening/ \
	public-inbox-index kernel-hardening

Example config snippet for mirrors

Newsgroup available over NNTP:

AGPL code for this site: git clone