提交 e22a5398 编写于 作者: R Rusty Russell

lguest: allow booting guest with CONFIG_RELOCATABLE=y

The CONFIG_RELOCATABLE code tries to align the unpack destination to
the value of 'kernel_alignment' in the setup_hdr.  If that's 0, it
tries to unpack to address 0, which in fact causes the gunzip code
to call 'error("Out of memory while allocating output buffer")'.

The bootloader (ie. the lguest Launcher in this case) should be doing
setting this field; the normal bzImage is 16M, we can use the same.
Reported-by: NStefanos Geraggelos <sgerag@cslab.ece.ntua.gr>
Signed-off-by: NRusty Russell <rusty@rustcorp.com.au>
Cc: stable@kernel.org
上级 c3c53a07
...@@ -1996,6 +1996,9 @@ int main(int argc, char *argv[]) ...@@ -1996,6 +1996,9 @@ int main(int argc, char *argv[])
/* We use a simple helper to copy the arguments separated by spaces. */ /* We use a simple helper to copy the arguments separated by spaces. */
concat((char *)(boot + 1), argv+optind+2); concat((char *)(boot + 1), argv+optind+2);
/* Set kernel alignment to 16M (CONFIG_PHYSICAL_ALIGN) */
boot->hdr.kernel_alignment = 0x1000000;
/* Boot protocol version: 2.07 supports the fields for lguest. */ /* Boot protocol version: 2.07 supports the fields for lguest. */
boot->hdr.version = 0x207; boot->hdr.version = 0x207;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册