From: David Rientjes <rientjes@google.com>
To: Andrew Morton <akpm@linux-foundation.org>
Cc: Fengguang Wu <fengguang.wu@intel.com>,
Jeff Liu <jeff.liu@oracle.com>, Kees Cook <keescook@chromium.org>,
linux-mm@kvack.org
Subject: [patch] binfmt_elf.c: use get_random_int() to fix entropy depleting fix
Date: Mon, 30 Jun 2014 15:52:05 -0700 (PDT) [thread overview]
Message-ID: <alpine.DEB.2.02.1406301549020.23648@chino.kir.corp.google.com> (raw)
In-Reply-To: <20140626074735.GA24582@localhost>
The type of size_t on am33 is unsigned int for gcc major versions >= 4.
Reported-by: Fengguang Wu <fengguang.wu@intel.com>
Signed-off-by: David Rientjes <rientjes@google.com>
---
fs/binfmt_elf.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/fs/binfmt_elf.c b/fs/binfmt_elf.c
--- a/fs/binfmt_elf.c
+++ b/fs/binfmt_elf.c
@@ -155,7 +155,7 @@ static void get_atrandom_bytes(unsigned char *buf, size_t nbytes)
while (nbytes) {
unsigned int random_variable;
- size_t chunk = min(nbytes, sizeof(random_variable));
+ size_t chunk = min(nbytes, (size_t)sizeof(random_variable));
random_variable = get_random_int();
memcpy(p, &random_variable, chunk);
--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org. For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>
next prev parent reply other threads:[~2014-06-30 22:52 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <53aa90d2.Yd3WgTmElIsuiwuV%fengguang.wu@intel.com>
2014-06-25 10:02 ` [next:master 156/212] fs/binfmt_elf.c:158:18: note: in expansion of macro 'min' Fengguang Wu
2014-06-25 11:30 ` Jeff Liu
2014-06-25 19:59 ` Andrew Morton
2014-06-26 1:45 ` Jeff Liu
2014-06-25 22:44 ` David Rientjes
2014-06-26 2:01 ` Jeff Liu
2014-06-26 6:19 ` David Rientjes
2014-06-26 6:33 ` Jeff Liu
2014-06-26 7:47 ` Fengguang Wu
2014-06-30 22:52 ` David Rientjes [this message]
2014-06-30 23:05 ` [patch] binfmt_elf.c: use get_random_int() to fix entropy depleting fix Kees Cook
2014-06-30 23:06 ` Andrew Morton
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=alpine.DEB.2.02.1406301549020.23648@chino.kir.corp.google.com \
--to=rientjes@google.com \
--cc=akpm@linux-foundation.org \
--cc=fengguang.wu@intel.com \
--cc=jeff.liu@oracle.com \
--cc=keescook@chromium.org \
--cc=linux-mm@kvack.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