projects
/
platform
/
kernel
/
linux-exynos.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
d86623a
)
x86: change size if e820_update/remove_range
author
Yinghai Lu
<yhlu.kernel@gmail.com>
Tue, 24 Jun 2008 21:58:38 +0000
(14:58 -0700)
committer
Ingo Molnar
<mingo@elte.hu>
Tue, 8 Jul 2008 11:10:36 +0000
(13:10 +0200)
in case someone using crazy parameter while calling them.
Signed-off-by: Yinghai Lu <yhlu.kernel@gmail.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
arch/x86/kernel/e820.c
patch
|
blob
|
history
diff --git
a/arch/x86/kernel/e820.c
b/arch/x86/kernel/e820.c
index
15b4393
..
1b76b25
100644
(file)
--- a/
arch/x86/kernel/e820.c
+++ b/
arch/x86/kernel/e820.c
@@
-405,6
+405,9
@@
u64 __init e820_update_range(u64 start, u64 size, unsigned old_type,
BUG_ON(old_type == new_type);
+ if (size > (ULLONG_MAX - start))
+ size = ULLONG_MAX - start;
+
for (i = 0; i < e820.nr_map; i++) {
struct e820entry *ei = &e820.map[i];
u64 final_start, final_end;
@@
-441,6
+444,9
@@
u64 __init e820_remove_range(u64 start, u64 size, unsigned old_type,
int i;
u64 real_removed_size = 0;
+ if (size > (ULLONG_MAX - start))
+ size = ULLONG_MAX - start;
+
for (i = 0; i < e820.nr_map; i++) {
struct e820entry *ei = &e820.map[i];
u64 final_start, final_end;