initrd support broken in mips kernel 4.2

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hello,

Commit a6335fa11 (MIPS: bootmem: Don't use memory holes for page bitmap) 
crashes kernel with a initramfs unpacking error when initrd is enabled. 

---- error message ----
Unpacking initramfs...
Initramfs unpacking failed: junk in compressed archive
BUG: Bad page state in process swapper  pfn:00261
page:81004c20 count:0 mapcount:-127 mapping:  (null) index:0x2
flags: 0x0()
page dumped because: nonzero mapcount
CPU: 0 PID: 1 Comm: swapper Not tainted 4.2.0+ #1782
-----------------------

The modified logic in bootmem_init does not guarantee mapstart to be placed 
after initrd_end. mapstart is set to the maximum of reserved_end and
start. In case initrd_end is greater than reserved_end, mapstart is placed
before initrd_end, and causes initramfs unpacking error.

----- bootmem_init ---
                if (end <= reserved_end)
                        continue;
+#ifdef CONFIG_BLK_DEV_INITRD
+               /* mapstart should be after initrd_end */
+               if (initrd_end && end <= (unsigned long)PFN_UP(__pa(initrd_end)))
+                       continue;
+#endif
                if (start >= mapstart)
                        continue;
                mapstart = max(reserved_end, start);
-----------------------

Thanks,
Tony





[Index of Archives]     [Linux MIPS Home]     [LKML Archive]     [Linux ARM Kernel]     [Linux ARM]     [Linux]     [Git]     [Yosemite News]     [Linux SCSI]     [Linux Hams]

  Powered by Linux