<feed xmlns='http://www.w3.org/2005/Atom'>
<title>kernel.git/arch/x86/boot, branch linux-3.17.y</title>
<subtitle>Hosts the 0x221E linux distro kernel.
</subtitle>
<id>https://git.0xinfinity.dev/distro/kernel.git/atom?h=linux-3.17.y</id>
<link rel='self' href='https://git.0xinfinity.dev/distro/kernel.git/atom?h=linux-3.17.y'/>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/'/>
<updated>2014-12-16T17:37:08Z</updated>
<entry>
<title>x86: Use $(OBJDUMP) instead of plain objdump</title>
<updated>2014-12-16T17:37:08Z</updated>
<author>
<name>Chris Clayton</name>
</author>
<published>2014-11-22T09:51:10Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=adac476a1983459b0351903430c2f45e8d542570'/>
<id>urn:sha1:adac476a1983459b0351903430c2f45e8d542570</id>
<content type='text'>
commit e2e68ae688b0a3766cd75aedf4ed4e39be402009 upstream.

commit e6023367d779 'x86, kaslr: Prevent .bss from overlaping initrd'
broke the cross compile of x86. It added a objdump invocation, which
invokes the host native objdump and ignores an active cross tool
chain.

Use $(OBJDUMP) instead which takes the CROSS_COMPILE prefix into
account.

[ tglx: Massage changelog and use $(OBJDUMP) ]

Fixes: e6023367d779 'x86, kaslr: Prevent .bss from overlaping initrd'
Signed-off-by: Chris Clayton &lt;chris2553@googlemail.com&gt;
Acked-by: Kees Cook &lt;keescook@chromium.org&gt;
Acked-by: Borislav Petkov &lt;bp@suse.de&gt;
Cc: Junjie Mao &lt;eternal.n08@gmail.com&gt;
Cc: Ingo Molnar &lt;mingo@kernel.org&gt;
Cc: H. Peter Anvin &lt;hpa@linux.intel.com&gt;
Link: http://lkml.kernel.org/r/54705C8E.1080400@googlemail.com
Signed-off-by: Thomas Gleixner &lt;tglx@linutronix.de&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</content>
</entry>
<entry>
<title>x86, kaslr: Prevent .bss from overlaping initrd</title>
<updated>2014-11-21T17:23:13Z</updated>
<author>
<name>Junjie Mao</name>
</author>
<published>2014-10-31T13:40:38Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=664653016626d15d3e898aabd0785f1b785f6400'/>
<id>urn:sha1:664653016626d15d3e898aabd0785f1b785f6400</id>
<content type='text'>
commit e6023367d779060fddc9a52d1f474085b2b36298 upstream.

When choosing a random address, the current implementation does not take into
account the reversed space for .bss and .brk sections. Thus the relocated kernel
may overlap other components in memory. Here is an example of the overlap from a
x86_64 kernel in qemu (the ranges of physical addresses are presented):

 Physical Address

    0x0fe00000                  --+--------------------+  &lt;-- randomized base
                               /  |  relocated kernel  |
                   vmlinux.bin    | (from vmlinux.bin) |
    0x1336d000    (an ELF file)   +--------------------+--
                               \  |                    |  \
    0x1376d870                  --+--------------------+   |
                                  |    relocs table    |   |
    0x13c1c2a8                    +--------------------+   .bss and .brk
                                  |                    |   |
    0x13ce6000                    +--------------------+   |
                                  |                    |  /
    0x13f77000                    |       initrd       |--
                                  |                    |
    0x13fef374                    +--------------------+

The initrd image will then be overwritten by the memset during early
initialization:

[    1.655204] Unpacking initramfs...
[    1.662831] Initramfs unpacking failed: junk in compressed archive

This patch prevents the above situation by requiring a larger space when looking
for a random kernel base, so that existing logic can effectively avoids the
overlap.

[kees: switched to perl to avoid hex translation pain in mawk vs gawk]
[kees: calculated overlap without relocs table]

Fixes: 82fa9637a2 ("x86, kaslr: Select random position from e820 maps")
Reported-by: Fengguang Wu &lt;fengguang.wu@intel.com&gt;
Signed-off-by: Junjie Mao &lt;eternal.n08@gmail.com&gt;
Signed-off-by: Kees Cook &lt;keescook@chromium.org&gt;
Cc: Josh Triplett &lt;josh@joshtriplett.org&gt;
Cc: Matt Fleming &lt;matt.fleming@intel.com&gt;
Cc: Ard Biesheuvel &lt;ard.biesheuvel@linaro.org&gt;
Cc: Vivek Goyal &lt;vgoyal@redhat.com&gt;
Cc: Andi Kleen &lt;ak@linux.intel.com&gt;
Link: http://lkml.kernel.org/r/1414762838-13067-1-git-send-email-eternal.n08@gmail.com
Signed-off-by: Thomas Gleixner &lt;tglx@linutronix.de&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</content>
</entry>
<entry>
<title>Merge branch 'x86-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip</title>
<updated>2014-09-27T21:23:13Z</updated>
<author>
<name>Linus Torvalds</name>
</author>
<published>2014-09-27T21:23:13Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=cd40fab6dbf4173c1617557be720dcec89657866'/>
<id>urn:sha1:cd40fab6dbf4173c1617557be720dcec89657866</id>
<content type='text'>
Pull x86 fixes from Ingo Molnar:
 "This has:

   - EFI revert to fix a boot regression
   - early_ioremap() fix for boot failure
   - KASLR fix for possible boot failures
   - EFI fix for corrupted string printing
   - remove a misleading EFI bootup 'failed!' error message

  Unfortunately it's all rather close to the merge window"

* 'x86-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
  x86/efi: Truncate 64-bit values when calling 32-bit OutputString()
  x86/efi: Delete misleading efi_printk() error message
  Revert "efi/x86: efistub: Move shared dependencies to &lt;asm/efi.h&gt;"
  x86/kaslr: Avoid the setup_data area when picking location
  x86 early_ioremap: Increase FIX_BTMAPS_SLOTS to 8
</content>
</entry>
<entry>
<title>Merge tag 'efi-urgent' of git://git.kernel.org/pub/scm/linux/kernel/git/mfleming/efi into x86/urgent</title>
<updated>2014-09-25T14:40:08Z</updated>
<author>
<name>Ingo Molnar</name>
</author>
<published>2014-09-25T14:40:08Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=29282ac0bd6c0b0c4c893fe2c31863e50fea69f8'/>
<id>urn:sha1:29282ac0bd6c0b0c4c893fe2c31863e50fea69f8</id>
<content type='text'>
Pull EFI fixes from Matt Fleming:

  * Revert the static library changes from the merge window since they're
    causing issues for Macbooks and Fedora + Grub2 (Matt Fleming)

  * Delete the misleading "setup_efi_pci() failed!" message which some
    people are seeing when booting EFI (Matt Fleming)

  * Fix printing strings from the 32-bit EFI boot stub by only passing
    32-bit addresses to the firmware (Matt Fleming)

Signed-off-by: Ingo Molnar &lt;mingo@kernel.org&gt;
</content>
</entry>
<entry>
<title>x86/efi: Truncate 64-bit values when calling 32-bit OutputString()</title>
<updated>2014-09-24T20:56:46Z</updated>
<author>
<name>Matt Fleming</name>
</author>
<published>2014-09-24T10:56:10Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=115c6628a59044958c205f8468a1b3ba3d539e61'/>
<id>urn:sha1:115c6628a59044958c205f8468a1b3ba3d539e61</id>
<content type='text'>
If we're executing the 32-bit efi_char16_printk() code path (i.e.
running on top of 32-bit firmware) we know that efi_early-&gt;text_output
will be a 32-bit value, even though -&gt;text_output has type u64.

Unfortunately, we currently pass -&gt;text_output directly to
efi_early-&gt;call() so for CONFIG_X86_32 the compiler will push a 64-bit
value onto the stack, causing the other parameters to be misaligned.

The way we handle this in the rest of the EFI boot stub is to pass
pointers as arguments to efi_early-&gt;call(), which automatically do the
right thing (pointers are 32-bit on CONFIG_X86_32, and we simply ignore
the upper 32-bits of the argument register if running in 64-bit mode
with 32-bit firmware).

This fixes a corruption bug when printing strings from the 32-bit EFI
boot stub.

Link: https://bugzilla.kernel.org/show_bug.cgi?id=84241
Signed-off-by: Matt Fleming &lt;matt.fleming@intel.com&gt;
</content>
</entry>
<entry>
<title>x86/efi: Delete misleading efi_printk() error message</title>
<updated>2014-09-24T11:46:59Z</updated>
<author>
<name>Matt Fleming</name>
</author>
<published>2014-09-11T08:04:25Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=56394ab8c26893bbaef02da04a06cc5ae71ccc5c'/>
<id>urn:sha1:56394ab8c26893bbaef02da04a06cc5ae71ccc5c</id>
<content type='text'>
A number of people are reporting seeing the "setup_efi_pci() failed!"
error message in what used to be a quiet boot,

  https://bugzilla.kernel.org/show_bug.cgi?id=81891

The message isn't all that helpful because setup_efi_pci() can return a
non-success error code for a variety of reasons, not all of them fatal.

Let's drop the return code from setup_efi_pci*() altogether, since
there's no way to process it in any meaningful way outside of the inner
__setup_efi_pci*() functions.

Reported-by: Darren Hart &lt;dvhart@linux.intel.com&gt;
Reported-by: Josh Boyer &lt;jwboyer@fedoraproject.org&gt;
Cc: Ulf Winkelvos &lt;ulf@winkelvos.de&gt;
Cc: Andre Müller &lt;andre.muller@web.de&gt;
Cc: Ingo Molnar &lt;mingo@kernel.org&gt;
Cc: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
Signed-off-by: Matt Fleming &lt;matt.fleming@intel.com&gt;
</content>
</entry>
<entry>
<title>Revert "efi/x86: efistub: Move shared dependencies to &lt;asm/efi.h&gt;"</title>
<updated>2014-09-23T21:01:55Z</updated>
<author>
<name>Matt Fleming</name>
</author>
<published>2014-09-23T09:37:43Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=84be880560fbbd0b6a6ef973bee85dbd4ca52198'/>
<id>urn:sha1:84be880560fbbd0b6a6ef973bee85dbd4ca52198</id>
<content type='text'>
This reverts commit f23cf8bd5c1f ("efi/x86: efistub: Move shared
dependencies to &lt;asm/efi.h&gt;") as well as the x86 parts of commit
f4f75ad5741f ("efi: efistub: Convert into static library").

The road leading to these two reverts is long and winding.

The above two commits were merged during the v3.17 merge window and
turned the common EFI boot stub code into a static library. This
necessitated making some symbols global in the x86 boot stub which
introduced new entries into the early boot GOT.

The problem was that we weren't fixing up the newly created GOT entries
before invoking the EFI boot stub, which sometimes resulted in hangs or
resets. This failure was reported by Maarten on his Macbook pro.

The proposed fix was commit 9cb0e394234d ("x86/efi: Fixup GOT in all
boot code paths"). However, that caused issues for Linus when booting
his Sony Vaio Pro 11. It was subsequently reverted in commit
f3670394c29f.

So that leaves us back with Maarten's Macbook pro not booting.

At this stage in the release cycle the least risky option is to revert
the x86 EFI boot stub to the pre-merge window code structure where we
explicitly #include efi-stub-helper.c instead of linking with the static
library. The arm64 code remains unaffected.

We can take another swing at the x86 parts for v3.18.

Conflicts:
	arch/x86/include/asm/efi.h

Tested-by: Josh Boyer &lt;jwboyer@fedoraproject.org&gt;
Tested-by: Maarten Lankhorst &lt;maarten.lankhorst@canonical.com&gt;
Tested-by: Leif Lindholm &lt;leif.lindholm@linaro.org&gt; [arm64]
Tested-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
Cc: H. Peter Anvin &lt;hpa@zytor.com&gt;
Cc: Ard Biesheuvel &lt;ard.biesheuvel@linaro.org&gt;,
Cc: Ingo Molnar &lt;mingo@kernel.org&gt;
Signed-off-by: Matt Fleming &lt;matt.fleming@intel.com&gt;
</content>
</entry>
<entry>
<title>Revert "x86/efi: Fixup GOT in all boot code paths"</title>
<updated>2014-09-23T06:05:49Z</updated>
<author>
<name>Linus Torvalds</name>
</author>
<published>2014-09-23T06:05:49Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=f3670394c29ff3730638762c1760fd2f624e6d7b'/>
<id>urn:sha1:f3670394c29ff3730638762c1760fd2f624e6d7b</id>
<content type='text'>
This reverts commit 9cb0e394234d244fe5a97e743ec9dd7ddff7e64b.

It causes my Sony Vaio Pro 11 to immediately reboot at startup.

Acked-by: Ingo Molnar &lt;mingo@kernel.org&gt;
Cc: Peter Anvin &lt;hpa@zytor.com&gt;
Cc: Maarten Lankhorst &lt;maarten.lankhorst@canonical.com&gt;
Cc: Ard Biesheuvel &lt;ard.biesheuvel@linaro.org&gt;
Cc: Matt Fleming &lt;matt.fleming@intel.com&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
</content>
</entry>
<entry>
<title>x86/kaslr: Avoid the setup_data area when picking location</title>
<updated>2014-09-19T11:04:29Z</updated>
<author>
<name>Kees Cook</name>
</author>
<published>2014-09-11T16:19:31Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=0cacbfbeb5077b63d5d3cf6df88b14ac12ad584b'/>
<id>urn:sha1:0cacbfbeb5077b63d5d3cf6df88b14ac12ad584b</id>
<content type='text'>
The KASLR location-choosing logic needs to avoid the setup_data
list memory areas as well. Without this, it would be possible to
have the ASLR position stomp on the memory, ultimately causing
the boot to fail.

Signed-off-by: Kees Cook &lt;keescook@chromium.org&gt;
Tested-by: Baoquan He &lt;bhe@redhat.com&gt;
Cc: stable@vger.kernel.org
Cc: Vivek Goyal &lt;vgoyal@redhat.com&gt;
Cc: Rafael J. Wysocki &lt;rafael.j.wysocki@intel.com&gt;
Cc: Wei Yongjun &lt;yongjun_wei@trendmicro.com.cn&gt;
Cc: Pavel Machek &lt;pavel@ucw.cz&gt;
Cc: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
Link: http://lkml.kernel.org/r/20140911161931.GA12001@www.outflux.net
Signed-off-by: Ingo Molnar &lt;mingo@kernel.org&gt;
</content>
</entry>
<entry>
<title>x86/efi: Fixup GOT in all boot code paths</title>
<updated>2014-09-08T19:52:02Z</updated>
<author>
<name>Matt Fleming</name>
</author>
<published>2014-09-05T13:52:26Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=9cb0e394234d244fe5a97e743ec9dd7ddff7e64b'/>
<id>urn:sha1:9cb0e394234d244fe5a97e743ec9dd7ddff7e64b</id>
<content type='text'>
Maarten reported that his Macbook pro 8.2 stopped booting after commit
f23cf8bd5c1f49 ("efi/x86: efistub: Move shared dependencies to
&lt;asm/efi.h&gt;"), the main feature of which is changing the visibility of
symbol 'efi_early' from local to global.

By making 'efi_early' global we end up requiring an entry in the Global
Offset Table. Unfortunately, while we do include code to fixup GOT
entries in the early boot code, it's only called after we've executed
the EFI boot stub.

What this amounts to is that references to 'efi_early' in the EFI boot
stub don't point to the correct place.

Since we've got multiple boot entry points we need to be prepared to
fixup the GOT in multiple places, while ensuring that we never do it
more than once, otherwise the GOT entries will still point to the wrong
place.

Reported-by: Maarten Lankhorst &lt;maarten.lankhorst@canonical.com&gt;
Tested-by: Maarten Lankhorst &lt;maarten.lankhorst@canonical.com&gt;
Cc: Ard Biesheuvel &lt;ard.biesheuvel@linaro.org&gt;
Signed-off-by: Matt Fleming &lt;matt.fleming@intel.com&gt;
</content>
</entry>
</feed>
