projects
/
openwrt
/
staging
/
blogic.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
df378cc
)
x86, alternatives: BUG on encountering an invalid CPU feature number
author
H. Peter Anvin
<
[email protected]
>
Tue, 13 Jul 2010 21:57:50 +0000
(14:57 -0700)
committer
H. Peter Anvin
<
[email protected]
>
Tue, 13 Jul 2010 21:57:50 +0000
(14:57 -0700)
Make the alternatives-patching code BUG on encountering an invalid CPU
feature number. Should have done this a long time ago.
Signed-off-by: H. Peter Anvin <
[email protected]
>
Cc: Yinghai Lu <
[email protected]
>
Cc: Suresh Siddha <
[email protected]
>
LKML-Reference: <tip-
df378ccfc4dd04e263426ad805516915874774aa
@git.kernel.org>
arch/x86/kernel/alternative.c
patch
|
blob
|
history
diff --git
a/arch/x86/kernel/alternative.c
b/arch/x86/kernel/alternative.c
index 70237732a6c7c5f62f941d5df0594f7386ca6a10..f65ab8b014c4f42421d77200243c39c7fd252165 100644
(file)
--- a/
arch/x86/kernel/alternative.c
+++ b/
arch/x86/kernel/alternative.c
@@
-214,6
+214,7
@@
void __init_or_module apply_alternatives(struct alt_instr *start,
u8 *instr = a->instr;
BUG_ON(a->replacementlen > a->instrlen);
BUG_ON(a->instrlen > sizeof(insnbuf));
+ BUG_ON(a->cpuid >= NCAPINTS*32);
if (!boot_cpu_has(a->cpuid))
continue;
#ifdef CONFIG_X86_64