linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Fengguang Wu <fengguang.wu@intel.com>
To: Kees Cook <keescook@chromium.org>
Cc: "H. Peter Anvin" <hpa@linux.intel.com>,
	LKML <linux-kernel@vger.kernel.org>
Subject: Re: [x86, kaslr] BUG: kernel boot hang
Date: Wed, 15 Jan 2014 20:37:19 +0800	[thread overview]
Message-ID: <20140115123719.GB16708@localhost> (raw)
In-Reply-To: <CAGXu5j+uBnEJ2qddoec0Y2z3=yzAYwKE_GjMRhXzc4XRw_Se_g@mail.gmail.com>

On Tue, Jan 14, 2014 at 02:33:15PM -0800, Kees Cook wrote:
> On Tue, Jan 14, 2014 at 5:31 AM, Fengguang Wu <fengguang.wu@intel.com> wrote:
> > Greetings,
> >
> > I got the below dmesg and the first bad commit is
> >
> > commit 82fa9637a2ba285bcc7c5050c73010b2c1b3d803
> > Author:     Kees Cook <keescook@chromium.org>
> > AuthorDate: Thu Oct 10 17:18:16 2013 -0700
> > Commit:     H. Peter Anvin <hpa@linux.intel.com>
> > CommitDate: Sun Oct 13 03:12:19 2013 -0700
> >
> >     x86, kaslr: Select random position from e820 maps
> >
> >     Counts available alignment positions across all e820 maps, and chooses
> >     one randomly for the new kernel base address, making sure not to collide
> >     with unsafe memory areas.
> >
> >     Signed-off-by: Kees Cook <keescook@chromium.org>
> >     Link: http://lkml.kernel.org/r/1381450698-28710-5-git-send-email-keescook@chromium.org
> >     Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
> >
> > Note that there are many other warning/errors and it's not very
> > reproducible, so this report might be wrong.
> >
> > ===================================================
> > PARENT COMMIT NOT CLEAN. LOOK OUT FOR WRONG BISECT!
> > ===================================================
> >
> > +-----------------------------------------------------------+--------------+--------------+
> > |                                                           | 5bfce5ef55cb | 1955a14a5ba6 |
> > +-----------------------------------------------------------+--------------+--------------+
> > | boot_successes                                            | 3948         | 0            |
> > | boot_failures                                             | 52           | 89           |
> > | page_allocation_failure:order:,mode                       | 48           | 2            |
> > | Out_of_memory:Kill_process                                | 7            |              |
> > | BUG:kernel_early_hang_without_any_printk_output           | 1            |              |
> > | BUG:soft_lockup-CPU_stuck_for_s                           | 1            |              |
> > | WARNING:CPU:PID:at_kernel/locking/lockdep.c:check_flags() | 0            | 85           |
> > | general_protection_fault:SMP_SMP                          | 0            | 1            |
> > | RIP:__lock_acquire                                        | 0            | 1            |
> > | Kernel_panic-not_syncing:Fatal_exception                  | 0            | 1            |
> > | BUG:kernel_boot_hang                                      | 0            | 2            |
> > | BUG:kernel_boot_crashed                                   | 0            | 1            |
> > +-----------------------------------------------------------+--------------+--------------+
> >
> > The last dmesg is
> >
> > [    0.803796] Initramfs unpacking failed: junk in compressed archive
> 
> Can you tell me how the initrd for quantal-core-x86_64.cgz was built
> in the qemu instances you're using? It seems like all the failures
> point to a problem with how kASLR is interacting with the initrd.

That Initramfs unpacking error is much harder to reproduce, but
anyway here's how I create the image file:

quantal-core-x86_64.cgz is based on the ubuntu-core images files:

http://cdimage.ubuntu.com/ubuntu-core/releases/quantal/release/

Download one image and extract files to quantal-core-x86_64/ and run
the below script in parent dir

        ./create-cpio.sh quantal-core-x86_64

#!/bin/bash

core=$1

[[ $1 ]] || exit
cd $core || exit

[[ -d ../addon ]] && cp -a ../addon/* .

mkdir initrd
ln -s sbin/init init

find . |
grep -v -e usr/doc				\
        -e usr/man				\
	-e usr/info				\
	-e sbin/modprobe			\
	-e usr/share/doc			\
	-e usr/share/man			\
	-e usr/share/info			\
	-e usr/share/i18n			\
	-e usr/share/locales			\
	-e usr/lib/x86_64-linux-gnu/gconv	\
	-e var/lib/apt/lists			\
	-e var/lib/dpkg/info			\
	-e var/cache/apt/archives		|
cpio -o -H newc | gzip -n -9 > ../$core.cgz

      parent reply	other threads:[~2014-01-15 12:37 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-01-14 13:31 [x86, kaslr] BUG: kernel boot hang Fengguang Wu
2014-01-14 16:02 ` H. Peter Anvin
2014-01-14 18:32   ` Kees Cook
2014-01-14 19:19     ` H. Peter Anvin
2014-01-14 18:26 ` Kees Cook
2014-01-14 18:47   ` H. Peter Anvin
2014-01-15 12:10   ` Fengguang Wu
2014-01-14 22:33 ` Kees Cook
2014-01-14 23:23   ` H. Peter Anvin
2014-01-14 23:31     ` Kees Cook
2014-01-14 23:45       ` H. Peter Anvin
2014-01-15 12:37   ` Fengguang Wu [this message]

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=20140115123719.GB16708@localhost \
    --to=fengguang.wu@intel.com \
    --cc=hpa@linux.intel.com \
    --cc=keescook@chromium.org \
    --cc=linux-kernel@vger.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;
as well as URLs for NNTP newsgroup(s).