[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <tip-9016875df408fc5db6a94a3c5f5f5503c916cf81@git.kernel.org>
Date: Tue, 19 Apr 2016 02:33:17 -0700
From: tip-bot for Kees Cook <tipbot@...or.com>
To: linux-tip-commits@...r.kernel.org
Cc: yinghai@...nel.org, aryabinin@...tuozzo.com, bhe@...hat.com,
hjl.tools@...il.com, dvyukov@...gle.com, dvlasenk@...hat.com,
brgerst@...il.com, luto@...nel.org, bp@...en8.de,
peterz@...radead.org, mingo@...nel.org, hpa@...or.com, bp@...e.de,
jpoimboe@...hat.com, tglx@...utronix.de, luto@...capital.net,
torvalds@...ux-foundation.org, linux-kernel@...r.kernel.org,
keescook@...omium.org, akpm@...ux-foundation.org
Subject: [tip:x86/boot] x86/KASLR: Rename "random" to "random_addr"
Commit-ID: 9016875df408fc5db6a94a3c5f5f5503c916cf81
Gitweb: http://git.kernel.org/tip/9016875df408fc5db6a94a3c5f5f5503c916cf81
Author: Kees Cook <keescook@...omium.org>
AuthorDate: Mon, 18 Apr 2016 09:42:15 -0700
Committer: Ingo Molnar <mingo@...nel.org>
CommitDate: Tue, 19 Apr 2016 10:30:51 +0200
x86/KASLR: Rename "random" to "random_addr"
The variable "random" is also the name of a libc function. It's better
coding style to avoid overloading such things, so rename it to the more
accurate "random_addr".
Suggested-by: Ingo Molnar <mingo@...nel.org>
Signed-off-by: Kees Cook <keescook@...omium.org>
Cc: Andrew Morton <akpm@...ux-foundation.org>
Cc: Andrey Ryabinin <aryabinin@...tuozzo.com>
Cc: Andy Lutomirski <luto@...capital.net>
Cc: Andy Lutomirski <luto@...nel.org>
Cc: Baoquan He <bhe@...hat.com>
Cc: Borislav Petkov <bp@...en8.de>
Cc: Borislav Petkov <bp@...e.de>
Cc: Brian Gerst <brgerst@...il.com>
Cc: Denys Vlasenko <dvlasenk@...hat.com>
Cc: Dmitry Vyukov <dvyukov@...gle.com>
Cc: H. Peter Anvin <hpa@...or.com>
Cc: H.J. Lu <hjl.tools@...il.com>
Cc: Josh Poimboeuf <jpoimboe@...hat.com>
Cc: Linus Torvalds <torvalds@...ux-foundation.org>
Cc: Peter Zijlstra <peterz@...radead.org>
Cc: Thomas Gleixner <tglx@...utronix.de>
Cc: Yinghai Lu <yinghai@...nel.org>
Link: http://lkml.kernel.org/r/1460997735-24785-7-git-send-email-keescook@chromium.org
Signed-off-by: Ingo Molnar <mingo@...nel.org>
---
arch/x86/boot/compressed/kaslr.c | 10 +++++-----
1 file changed, 5 insertions(+), 5 deletions(-)
diff --git a/arch/x86/boot/compressed/kaslr.c b/arch/x86/boot/compressed/kaslr.c
index 9e03190..9c29e78 100644
--- a/arch/x86/boot/compressed/kaslr.c
+++ b/arch/x86/boot/compressed/kaslr.c
@@ -312,7 +312,7 @@ unsigned char *choose_random_location(unsigned char *input,
unsigned long output_size)
{
unsigned long choice = (unsigned long)output;
- unsigned long random;
+ unsigned long random_addr;
#ifdef CONFIG_HIBERNATION
if (!cmdline_find_option_bool("kaslr")) {
@@ -333,17 +333,17 @@ unsigned char *choose_random_location(unsigned char *input,
(unsigned long)output, output_size);
/* Walk e820 and find a random address. */
- random = find_random_addr(choice, output_size);
- if (!random) {
+ random_addr = find_random_addr(choice, output_size);
+ if (!random_addr) {
debug_putstr("KASLR could not find suitable E820 region...\n");
goto out;
}
/* Always enforce the minimum. */
- if (random < choice)
+ if (random_addr < choice)
goto out;
- choice = random;
+ choice = random_addr;
out:
return (unsigned char *)choice;
}
Powered by blists - more mailing lists