From: "tip-bot for H. Peter Anvin" <hpa@linux.intel.com>
To: linux-tip-commits@vger.kernel.org
Cc: linux-kernel@vger.kernel.org, hpa@zytor.com, mingo@redhat.com,
yinhai@kernel.org, suresh.b.siddha@intel.com, tglx@linutronix.de,
hpa@linux.intel.com
Subject: [tip:x86/alternatives] x86, alternatives: BUG on encountering an invalid CPU feature number
Date: Wed, 14 Jul 2010 00:54:59 GMT [thread overview]
Message-ID: <tip-3b770a2128423a687e6e9c57184a584fb4ba4c77@git.kernel.org> (raw)
In-Reply-To: <tip-df378ccfc4dd04e263426ad805516915874774aa@git.kernel.org>
Commit-ID: 3b770a2128423a687e6e9c57184a584fb4ba4c77
Gitweb: http://git.kernel.org/tip/3b770a2128423a687e6e9c57184a584fb4ba4c77
Author: H. Peter Anvin <hpa@linux.intel.com>
AuthorDate: Tue, 13 Jul 2010 14:57:50 -0700
Committer: H. Peter Anvin <hpa@linux.intel.com>
CommitDate: Tue, 13 Jul 2010 14:57:50 -0700
x86, alternatives: BUG on encountering an invalid CPU feature number
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 <hpa@linux.intel.com>
Cc: Yinghai Lu <yinhai@kernel.org>
Cc: Suresh Siddha <suresh.b.siddha@intel.com>
LKML-Reference: <tip-df378ccfc4dd04e263426ad805516915874774aa@git.kernel.org>
---
arch/x86/kernel/alternative.c | 1 +
1 files changed, 1 insertions(+), 0 deletions(-)
diff --git a/arch/x86/kernel/alternative.c b/arch/x86/kernel/alternative.c
index 7023773..f65ab8b 100644
--- 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
next prev parent reply other threads:[~2010-07-14 0:55 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-07-13 2:59 tip/master broken with x2apic and kexec Yinghai Lu
2010-07-13 3:29 ` Yinghai Lu
2010-07-13 6:40 ` H. Peter Anvin
2010-07-14 0:54 ` [tip:x86/alternatives] x86, alternatives: Fix one more open-coded 8-bit alternative number tip-bot for H. Peter Anvin
2010-07-14 0:54 ` tip-bot for H. Peter Anvin [this message]
2010-07-13 22:00 ` tip/master broken with x2apic and kexec H. Peter Anvin
2010-07-13 23:27 ` Yinghai Lu
2010-07-14 20:35 ` Yinghai Lu
2010-07-14 21:05 ` Don Zickus
2010-07-14 22:07 ` Yinghai Lu
2010-07-14 21:23 ` Yinghai Lu
2010-07-14 22:57 ` Yinghai Lu
2010-07-15 0:03 ` Suresh Siddha
2010-07-15 2:01 ` Yinghai Lu
2010-07-15 7:00 ` [PATCH] x86: fix x2apic preenabled system with kexec Yinghai Lu
2010-07-15 18:16 ` Suresh Siddha
2010-07-15 20:10 ` Yinghai Lu
2010-07-15 20:40 ` Yinghai Lu
2010-07-17 0:48 ` [tip:x86/urgent] x86: Fix " tip-bot for Yinghai Lu
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=tip-3b770a2128423a687e6e9c57184a584fb4ba4c77@git.kernel.org \
--to=hpa@linux.intel.com \
--cc=hpa@zytor.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-tip-commits@vger.kernel.org \
--cc=mingo@redhat.com \
--cc=suresh.b.siddha@intel.com \
--cc=tglx@linutronix.de \
--cc=yinhai@kernel.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;
as well as URLs for NNTP newsgroup(s).