From: tip-bot for Cyrill Gorcunov <gorcunov@openvz.org>
To: linux-tip-commits@vger.kernel.org
Cc: linux-kernel@vger.kernel.org, hpa@zytor.com, mingo@redhat.com,
gorcunov@openvz.org, tglx@linutronix.de, mingo@elte.hu
Subject: [tip:x86/setup] x86, e820: Guard against array overflowed in __e820_add_region()
Date: Wed, 26 Aug 2009 06:22:42 GMT [thread overview]
Message-ID: <tip-5051fd69773d2d044734b78516317a04d3774871@git.kernel.org> (raw)
In-Reply-To: <20090824175551.146070377@openvz.org>
Commit-ID: 5051fd69773d2d044734b78516317a04d3774871
Gitweb: http://git.kernel.org/tip/5051fd69773d2d044734b78516317a04d3774871
Author: Cyrill Gorcunov <gorcunov@openvz.org>
AuthorDate: Mon, 24 Aug 2009 21:53:37 +0400
Committer: Ingo Molnar <mingo@elte.hu>
CommitDate: Wed, 26 Aug 2009 08:17:47 +0200
x86, e820: Guard against array overflowed in __e820_add_region()
Better to be paranoid against unpredicted nr_map modifications.
Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
LKML-Reference: <20090824175551.146070377@openvz.org>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
---
arch/x86/kernel/e820.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/arch/x86/kernel/e820.c b/arch/x86/kernel/e820.c
index 7271fa3..2e5e0fa 100644
--- a/arch/x86/kernel/e820.c
+++ b/arch/x86/kernel/e820.c
@@ -115,7 +115,7 @@ static void __init __e820_add_region(struct e820map *e820x, u64 start, u64 size,
{
int x = e820x->nr_map;
- if (x == ARRAY_SIZE(e820x->map)) {
+ if (x >= ARRAY_SIZE(e820x->map)) {
printk(KERN_ERR "Ooops! Too many entries in the memory map!\n");
return;
}
next prev parent reply other threads:[~2009-08-26 6:23 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-08-24 17:53 [rfc -tip 0/4] x86 apic,ioapic fixes Cyrill Gorcunov
2009-08-24 17:53 ` [rfc -tip 1/4] x86,ioapic: define IO_APIC_DEFAULT_PHYS_BASE constant Cyrill Gorcunov
2009-08-26 6:22 ` [tip:x86/apic] x86, ioapic: Define " tip-bot for Cyrill Gorcunov
2009-08-24 17:53 ` [rfc -tip 2/4] x86,e820: __e820_add_region -- guard against array overflowed Cyrill Gorcunov
2009-08-26 6:22 ` tip-bot for Cyrill Gorcunov [this message]
2009-08-24 17:53 ` [rfc -tip 3/4] x86,apic: fix missed handling of discrete apics Cyrill Gorcunov
2009-08-26 6:12 ` Ingo Molnar
2009-08-26 6:22 ` Cyrill Gorcunov
2009-08-26 16:49 ` Cyrill Gorcunov
2009-08-24 17:53 ` [rfc -tip 4/4] x86,ioapic: ioapic_setup_resources - get rid of needless check and simplify Cyrill Gorcunov
2009-08-26 6:22 ` [tip:x86/apic] x86, ioapic: Get rid of needless check and simplify ioapic_setup_resources() tip-bot for Cyrill Gorcunov
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-5051fd69773d2d044734b78516317a04d3774871@git.kernel.org \
--to=gorcunov@openvz.org \
--cc=hpa@zytor.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-tip-commits@vger.kernel.org \
--cc=mingo@elte.hu \
--cc=mingo@redhat.com \
--cc=tglx@linutronix.de \
/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
Powered by JetHome