From: Cyrill Gorcunov <gorcunov@openvz.org>
To: x86@kernel.org
Cc: linux-kernel@vger.kernel.org, Cyrill Gorcunov <gorcunov@openvz.org>
Subject: [rfc -tip 2/4] x86,e820: __e820_add_region -- guard against array overflowed
Date: Mon, 24 Aug 2009 21:53:37 +0400 [thread overview]
Message-ID: <20090824175551.146070377@openvz.org> (raw)
In-Reply-To: <20090824175335.186713800@openvz.org>
[-- Attachment #1: x86-e820-array --]
[-- Type: text/plain, Size: 654 bytes --]
Better to be paranoid against unpredicted nr_map modifications.
Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
---
arch/x86/kernel/e820.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
Index: linux-2.6.git/arch/x86/kernel/e820.c
=====================================================================
--- linux-2.6.git.orig/arch/x86/kernel/e820.c
+++ linux-2.6.git/arch/x86/kernel/e820.c
@@ -115,7 +115,7 @@ static void __init __e820_add_region(str
{
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-24 17:55 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 ` Cyrill Gorcunov [this message]
2009-08-26 6:22 ` [tip:x86/setup] x86, e820: Guard against array overflowed in __e820_add_region() tip-bot for Cyrill Gorcunov
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=20090824175551.146070377@openvz.org \
--to=gorcunov@openvz.org \
--cc=linux-kernel@vger.kernel.org \
--cc=x86@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
all inboxes | Powered by JetHome®