[prev in list] [next in list] [prev in thread] [next in thread] 

List:       git-commits-head
Subject:    ARM: initrd: disable initrd if passed address overlaps reserved region
From:       Linux Kernel Mailing List <linux-kernel () vger ! kernel ! org>
Date:       2011-01-31 22:59:52
Message-ID: 201101312259.p0VMxqR8004642 () hera ! kernel ! org
[Download RAW message or body]

Gitweb:     http://git.kernel.org/linus/b0a2679d27408d97ce31e5f800b44227d3388b84
Commit:     b0a2679d27408d97ce31e5f800b44227d3388b84
Parent:     5f2c1b30c7f60670c8b9d1cb1ea7c818b9c743a6
Author:     Russell King <rmk+kernel@arm.linux.org.uk>
AuthorDate: Sun Jan 30 11:21:05 2011 +0000
Committer:  Russell King <rmk+kernel@arm.linux.org.uk>
CommitDate: Mon Jan 31 10:53:41 2011 +0000

    ARM: initrd: disable initrd if passed address overlaps reserved region
    
    Disable the initrd if the passed address already overlaps the reserved
    region.  This avoids oopses on Netwinders when NeTTrom tells the kernel
    that an initrd is located at mem+4MB, but this overlaps the BSS,
    resulting in the kernels in-use BSS being freed.
    
    This should be applied to v2.6.37-stable.
    
    Cc: <stable@kernel.org>
    Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
---
 arch/arm/mm/init.c |    6 ++++++
 1 files changed, 6 insertions(+), 0 deletions(-)

diff --git a/arch/arm/mm/init.c b/arch/arm/mm/init.c
index 5164069..cddd684 100644
--- a/arch/arm/mm/init.c
+++ b/arch/arm/mm/init.c
@@ -297,6 +297,12 @@ void __init arm_memblock_init(struct meminfo *mi, struct machine_desc *mdesc)
 	memblock_reserve(__pa(_stext), _end - _stext);
 #endif
 #ifdef CONFIG_BLK_DEV_INITRD
+	if (phys_initrd_size &&
+	    memblock_is_region_reserved(phys_initrd_start, phys_initrd_size)) {
+		pr_err("INITRD: 0x%08lx+0x%08lx overlaps in-use memory region - disabling initrd\n",
+		       phys_initrd_start, phys_initrd_size);
+		phys_initrd_start = phys_initrd_size = 0;
+	}
 	if (phys_initrd_size) {
 		memblock_reserve(phys_initrd_start, phys_initrd_size);
 
--
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic