On Thu, Apr 27, 2017 at 6:55 AM, Ard Biesheuvel
wrote:
> On 23 April 2017 at 02:45, Yinghai Lu wrote:
>>
>> looks like those two lines are reversed. you should use:
>> pcibios_resource_survey_bus(bus);
>> pci_assign_unassi
On Mon, Apr 10, 2017 at 06:29:27PM +0100, Ard Biesheuvel wrote:
> /*
> @@ -208,8 +208,8 @@ struct pci_bus *pci_acpi_scan_root(struct
> acpi_pci_root *root)
> if (!bus)
> return NULL;
>
> - pci_bus_size_bridges(bus);
> - pci_bus_assign_resources(bus);
> +
The copy will be in __initdata, and it is small.
We can use pointer to access the setup_data instead of using early_memmap
everywhere.
Cc: Matt Fleming
Cc: linux-efi@vger.kernel.org
Signed-off-by: Yinghai Lu
---
arch/x86/include/asm/efi.h | 2 +-
arch/x86/platform/efi/efi.c| 13
On Sun, Mar 22, 2015 at 8:25 PM, Baoquan He wrote:
>
> This may not be correct. In commit e602336
> runsize = offset(.bss) + size(.bss) + size(.brk), why this formula comes
> out can be checked from discussion between Kees and Junjie:
> https://lkml.org/lkml/2014/10/30/612
>
> And in my one kernel
size.
Fixes: e6023367d779 ("x86, kaslr: Prevent .bss from overlaping initrd")
Cc: Junjie Mao
Cc: Kees Cook
Cc: Josh Triplett
Cc: Matt Fleming
Cc: Andrew Morton
Signed-off-by: Yinghai Lu
---
arch/x86/boot/Makefile| 11 +--
arch/x86/boot/compressed/Makefile | 12 +++
From: Baoquan He
When process 32 bit relocation tables a local variable extended is
defined to calculate the physical address of relocs entry. However
it's type is int which is enough for i386, for x86_64 not enough.
That's why relocation can only be handled when kernel is loaded
below 2G, otherw
according to ELF headers.
The valid range should be VO [_text, __bss_start) loaded physical addresses.
In the patch, add export for __bss_start to voffset.h and use it to get
max_addr.
Signed-off-by: Yinghai Lu
---
arch/x86/boot/compressed/Makefile | 2 +-
arch/x86/boot/compressed/misc.c | 2
Now we are using output_size as parameter, actually we are passing
max(output_len, run_size).
Change it to output_run_size to make it less confusing.
Cc: Kees Cook
Signed-off-by: Yinghai Lu
---
arch/x86/boot/compressed/aslr.c | 10 +-
arch/x86/boot/compressed/misc.c | 6 --
arch
.
So 19 pages could make both paths happy.
Cc: Kees Cook
Cc: Jiri Kosina
Cc: Borislav Petkov
Cc: Matt Fleming
Signed-off-by: Yinghai Lu
---
arch/x86/boot/compressed/Makefile | 3 ++
arch/x86/boot/compressed/aslr.c | 14 ++
arch/x86/boot/compressed/head_64.S | 4 +-
arch/x86/boot
act.
Signed-off-by: Yinghai Lu
---
arch/x86/boot/compressed/misc.c | 14 +++---
arch/x86/boot/compressed/misc.h | 2 ++
arch/x86/boot/compressed/string.c | 28 ++--
3 files changed, 35 insertions(+), 9 deletions(-)
diff --git a/arch/x86/boot/compressed/misc.
o put boot_params into the mem_avoid too. As with 64bit
bootloader
could put it anywhere.
After those changes, we have all range needed to be avoided in mem_avoid array.
Cc: Kees Cook
Signed-off-by: Yinghai Lu
---
arch/x86/boot/compressed/aslr.c | 29 +
1 file change
We need to include that in boot::decompress_kernel stage to set new
ident mapping.
Also add checking for __pa/__va macro definition, as we need to override them
in boot::decompress_kernel stage.
Reviewed-by: Kees Cook
Signed-off-by: Yinghai Lu
---
arch/x86/include/asm/page.h | 5 +++
arch
From: Baoquan He
Add two functions mem_min_overlap() and store_slot_info() which will be
used later.
Given a memory region mem_min_overlap will iterate all avoid region to
find the first one which overlap with it.
store_slot_info() calculates the slot info of passed in region and
store it into
From: Baoquan He
In kaslr implementation mechanism, mainly process_e820_entry and
slots_fetch_random do the job. process_e820_entry is responsible
for storing the slot information. slots_fetch_random takes care
of fetching slot information. In this patch, for adding support
of kernel physical add
-0x13fa01cc7], output: [0x13e00-0x13f9ef81f], heap:
[0x13fa0b680-0x13fa1367f]
after patch:
kernel: [13e00,13fa15fff]
input: [0x13f3253b4-0x13f9f9cc7], output: [0x13e00-0x13f9ef81f], heap:
[0x13fa03680-0x13fa0b67f]
Signed-off-by: Yinghai Lu
---
arch/x86/boot/Makefile | 2
d to make use of this flag.
[ Always dump correct kaslr status when panicking from Boris]
-v2: fold in fix for using physical address as value -- Yinghai
split struct kaslr_setup_data definition to another file -- Yinghai
use real_mode directly instead of passing it around -- Yinghai
From: Baoquan He
On x86_64, in old kaslr implementaion only physical address of kernel
loading is randomized. Then calculate the delta of physical address
where vmlinux was linked to load and where it is finally loaded. If
delta is not equal to 0, namely there's a new physical address where
kerne
g
Cc: "H. Peter Anvin"
Cc: Matt Fleming
Cc: Kees Cook
Signed-off-by: Yinghai Lu
---
arch/x86/boot/Makefile | 2 +-
arch/x86/boot/compressed/head_32.S | 11 +--
arch/x86/boot/compressed/head_64.S | 8 ++--
arch/x86/boot/compressed/mkpiggy.c
From: Baoquan He
Kernel is expected to be randomly reloaded anywhere in the whole
physical memory area, it could be near 64T at most. In this case
there could be about 4*1024*1024 randomization slots. Hence the
old slot array will cost too much memory and also not efficient
to store the slot info
From: Baoquan He
Kaslr extended kernel text mapping region size from 512M to 1G,
namely CONFIG_RANDOMIZE_BASE_MAX_OFFSET. This means kernel text
can be mapped to below region:
[__START_KERNEL_map + LOAD_PHYSICAL_ADDR, __START_KERNEL_map + 1G]
Introduce a function find_random_virt_offset() to ge
e Mao
Signed-off-by: Yinghai Lu
---
arch/x86/boot/compressed/Makefile | 4 +---
arch/x86/boot/compressed/head_32.S | 3 +--
arch/x86/boot/compressed/head_64.S | 3 ---
arch/x86/boot/compressed/misc.c| 6 ++
arch/x86/boot/compressed/mkpiggy.c | 9 ++--
arch/x86/tools/calc
: [0x70c0-0x70e4e9bf]
[0.00] .init: [0x70e5-0x7120bfff]
[0.00].bss: [0x71219000-0x7234efff]
[0.00].brk: [0x7234f000-0x72374fff]
Signed-off-by: Yinghai Lu
---
arch/x86/boot/compressed/aslr.c | 10 --
1 file changed, 8 insertions(+), 2 deletions
From: Baoquan He
Several auxiliary functions and slots[] are not needed any more since
struct slot_area is used to store the slot info of kaslr now. Hence
remove them in this patch.
Signed-off-by: Baoquan He
---
arch/x86/boot/compressed/aslr.c | 24
1 file changed, 24
ysical and virtual address of kernel separately
x86, kaslr: Add support of kernel physical address randomization above 4G
x86, kaslr: Remove useless codes
Jiri Kosina (1):
x86, kaslr: Propagate base load address calculation v2
Yinghai Lu (11):
x86, boot: Make data from decompress_kernel
On Mon, Mar 16, 2015 at 6:56 AM, Jiri Kosina wrote:
> On Mon, 16 Mar 2015, Borislav Petkov wrote:
>> From: Borislav Petkov
>> Date: Mon, 16 Mar 2015 10:57:56 +0100
>> Subject: [PATCH] Revert "x86/mm/ASLR: Propagate base load address
>> calculation"
>>
>> This reverts commit f47233c2d34f243ecdaac
On Fri, Mar 13, 2015 at 5:27 AM, Ingo Molnar wrote:
>
> * Yinghai Lu wrote:
>
>> commit e6023367d779 ("x86, kaslr: Prevent .bss from overlaping initrd")
>> introduced one run_size for kaslr.
>> We should use real runtime size (include copy/decompress) aka i
bb3b4-0x13fe4c346], output: [0x13e00-0x13fe69fff], heap:
[0x13fe57080-0x13fe5f07f]
Signed-off-by: Yinghai Lu
---
Please apply after patcheset: [PATCH v3 0/7] x86, boot: clean up kaslr
---
arch/x86/boot/Makefile |2 +-
arch/x86/boot/compressed/misc.c|5 +
arch/x86
On Tue, Mar 10, 2015 at 8:48 AM, Borislav Petkov wrote:
> On Tue, Mar 10, 2015 at 08:42:40AM -0700, Yinghai Lu wrote:
>> In arch/x86/boot/header.S, we already use VO and ZO.
>> So please keep on using them, and don't introduce "kernel proper" etc.
>
> So you&
On Tue, Mar 10, 2015 at 8:21 AM, Borislav Petkov wrote:
> On Tue, Mar 10, 2015 at 08:17:01AM -0700, Yinghai Lu wrote:
>> Make it not confusing.
>>
>> ZO: arch/x86/boot/compressed/vmlinux
>> VO: vmlinux
>>
>> setup + ZO ==> bzImage.
>>
>> compr
On Tue, Mar 10, 2015 at 8:10 AM, Borislav Petkov wrote:
> On Tue, Mar 10, 2015 at 08:05:52AM -0700, Yinghai Lu wrote:
>> We need to keep VO and ZO here...
>
> Why?
Make it not confusing.
ZO: arch/x86/boot/compressed/vmlinux
VO: vmlinux
setup + ZO ==> bzImage.
compres
On Tue, Mar 10, 2015 at 1:00 AM, Borislav Petkov wrote:
> Final patch:
>
> ---
> From: Yinghai Lu
> Date: Sat, 7 Mar 2015 14:07:16 -0800
> Subject: [PATCH] x86/setup: Move compressed kernel to the end of the buffer
setup should only about arch/x86/boot/setup.ld related.
On Tue, Mar 10, 2015 at 2:34 AM, Borislav Petkov wrote:
> Final patch:
>
> ---
> From: Yinghai Lu
> Date: Sat, 7 Mar 2015 14:07:17 -0800
> Subject: [PATCH] x86/setup: Don't overlap vmlinux's brk with compressed
> kernel's data
We need to keep VO and
On Mon, Mar 9, 2015 at 6:14 PM, Yinghai Lu wrote:
>>>
>>> +#include "misc_pgt.c"
>>
>> Shouldn't this just be a normal built .o file that is linked together
>> in the Makefile, specifically tracking CONFIG_RANDOMIZE_BASE as aslr.o
>>
On Mon, Mar 9, 2015 at 6:09 PM, Kees Cook wrote:
> On Sat, Mar 7, 2015 at 2:07 PM, Yinghai Lu wrote:
>> First, aslr will support to put random VO above 4G, so we must set ident
>> mapping for the range even we come from startup_32 path.
>>
>> Second, when boot from 6
On Mon, Mar 9, 2015 at 6:00 PM, Kees Cook wrote:
> On Sat, Mar 7, 2015 at 2:07 PM, Yinghai Lu wrote:
>
> This may be a stupid question, but are boot_params being used outside
> of the compressed loader? If so, it might make sense to split that
> change into a separate patch to g
On Mon, Mar 9, 2015 at 5:54 PM, Kees Cook wrote:
> On Sat, Mar 7, 2015 at 2:07 PM, Yinghai Lu wrote:
>> Boris found data from boot stage can not be used kernel stage.
>
> "... be used during kernel stage."
>
> Also, can you give a specific example of this
On Mon, Mar 9, 2015 at 5:39 PM, Kees Cook wrote:
> On Sat, Mar 7, 2015 at 2:07 PM, Yinghai Lu wrote:
>> First 3 patches make ZO (arch/x86/boot/compressed/vmlinux) data region is not
>> overwritten by VO (vmlinux) after decompress. So could pass data from ZO to
>> VO.
>
On Mon, Mar 9, 2015 at 1:18 PM, Borislav Petkov wrote:
> On Mon, Mar 09, 2015 at 01:06:00PM -0700, Yinghai Lu wrote:
>> Yes. Just to emphasize that " We need to make sure [z_extra_offset,
>> init_size) will fit ZO"
>
> So you want to say:
>
> "We need
On Mon, Mar 9, 2015 at 1:00 PM, Borislav Petkov wrote:
> On Mon, Mar 09, 2015 at 12:35:25PM -0700, Yinghai Lu wrote:
>> Can you put back:
>> "
>> So need to make sure [z_extra_offset, init_size) will fit ZO, that means
>> init_size need to be adjusted according to
On Mon, Mar 9, 2015 at 5:49 AM, Borislav Petkov wrote:
> I ended up committing this. Anything I've missed?
>
> ---
> From: Yinghai Lu
> Date: Sat, 7 Mar 2015 14:07:15 -0800
> Subject: [PATCH] x86/setup: Use init_size instead of run_size
>
> Commit
>
> e602
On Sat, Mar 7, 2015 at 5:59 PM, David Rientjes wrote:
>
> Hmm, although the bug is reported for a 3.12 kernel, I assume this is for
> stable 3.10+? If so, it should apply fine with the exception of removing
> e820_reserve_setup_data() from setup_arch() rather than
> memblock_x86_reserve_range_set
So we could let kexec-tools to rebuild SETUP_PCI and pass it to
second kernel if needed.
Now kexec-tools already build SETUP_EFI and SETUP_E820EXT.
Cc: Bjorn Helgaas
Cc: linux-...@vger.kernel.org
Signed-off-by: Yinghai Lu
---
arch/x86/pci/common.c | 175
We will not reserve setup_data in generic code. Every handler need to
reserve and copy setup_data locally.
Current dtd handling already have code for copying, just add reserve code.
Also simplify code a bit by storing real dtb size.
Cc: Rob Herring
Cc: David Vrabel
Signed-off-by: Yinghai Lu
Cc: Matt Fleming
Signed-off-by: Yinghai Lu
---
arch/x86/kernel/kdebugfs.c | 142 -
arch/x86/kernel/setup.c| 17 --
2 files changed, 159 deletions(-)
diff --git a/arch/x86/kernel/kdebugfs.c b/arch/x86/kernel/kdebugfs.c
index dc1404b..c8ca86c
The copy will be in __initdata, and it is small.
We can use pointer to access the setup_data instead of using early_memmap
everywhere.
Cc: Matt Fleming
Cc: linux-efi@vger.kernel.org
Signed-off-by: Yinghai Lu
---
arch/x86/include/asm/efi.h | 2 +-
arch/x86/platform/efi/efi.c| 13
Let it reserve setup_data, and keep it's own list.
Also clear the hdr.setup_data, as all handler now handle or
reserve setup_data locally already.
Cc: Bjorn Helgaas
Cc: Matt Fleming
Cc: linux-...@vger.kernel.org
Signed-off-by: Yinghai Lu
---
arch/x86/include/asm/pci.h | 2 ++
arc
/show_bug.cgi?id=913885
Reported-by: "Lee, Chun-Yi"
Tested-by: "Lee, Chun-Yi"
Cc: "Lee, Chun-Yi"
Signed-off-by: Yinghai Lu
Cc: sta...@vger.kernel.org
---
arch/x86/include/uapi/asm/e820.h | 9 -
arch/x86/kernel/e820.c | 6 ++
arch/x8
As EFI stub code could put them high when on 32bit or with exactmap=
on 64bit conf.
Check if the range is mapped, otherwise allocate new one and have
the rom data copied. So we could access them directly.
Signed-off-by: Yinghai Lu
---
arch/x86/pci/common.c | 47
So we could avoid ioremap every time later.
Cc: Bjorn Helgaas
Cc: linux-...@vger.kernel.org
Signed-off-by: Yinghai Lu
---
arch/x86/include/asm/pci.h | 2 ++
arch/x86/kernel/setup.c| 1 +
arch/x86/pci/common.c | 77 +-
3 files changed, 65
Yinghai Lu
-v3: separated with kasl patches, and fix early_ioremap return checking.
Yinghai Lu (8):
x86: Kill E820_RESERVED_KERN
x86, efi: Copy SETUP_EFI data and access directly
x86, of: Let add_dtb reserve setup_data locally
x86, boot: Add add_pci handler for SETUP_PCI
x86: Kill not
The copy will be in __initdata, and it is small.
We can use pointer to access the setup_data instead of using early_memmap
everywhere.
Cc: Matt Fleming
Cc: linux-efi@vger.kernel.org
Signed-off-by: Yinghai Lu
---
arch/x86/include/asm/efi.h | 2 +-
arch/x86/platform/efi/efi.c| 13
/show_bug.cgi?id=913885
Reported-by: "Lee, Chun-Yi"
Tested-by: "Lee, Chun-Yi"
Cc: "Lee, Chun-Yi"
Signed-off-by: Yinghai Lu
Cc: sta...@vger.kernel.org
---
arch/x86/include/uapi/asm/e820.h | 9 -
arch/x86/kernel/e820.c | 6 ++
arch/x8
Yinghai Lu
-v3: separated with kasl patches, and fix early_ioremap return checking.
Yinghai Lu (8):
x86: Kill E820_RESERVED_KERN
x86, efi: Copy SETUP_EFI data and access directly
x86, of: Let add_dtb reserve setup_data locally
x86, boot: Add add_pci handler for SETUP_PCI
x86: Kill not
v
Cc: Matt Fleming
Signed-off-by: Yinghai Lu
---
arch/x86/boot/compressed/aslr.c | 21
arch/x86/boot/compressed/head_64.S | 4 +-
arch/x86/boot/compressed/misc_pgt.c | 98 +
arch/x86/include/asm/boot.h | 19 +++
4 files changed, 140 inser
: Jiri Kosina
Signed-off-by: Yinghai Lu
---
arch/x86/kernel/setup.c | 13 -
1 file changed, 12 insertions(+), 1 deletion(-)
diff --git a/arch/x86/kernel/setup.c b/arch/x86/kernel/setup.c
index 98dc931..912f124 100644
--- a/arch/x86/kernel/setup.c
+++ b/arch/x86/kernel/setup.c
@@ -429
dress calculation")
Cc: "H. Peter Anvin"
Cc: Matt Fleming
Cc: Kees Cook
Signed-off-by: Yinghai Lu
---
arch/x86/boot/Makefile | 2 +-
arch/x86/boot/compressed/vmlinux.lds.S | 1 +
arch/x86/boot/header.S | 7 +--
3 files changed, 7 insertions(+), 3 deleti
We need to include that in boot::decompress_kernel stage to set new
ident mapping.
Also add checking for __pa/__va macro definition, as we need to override them
in boot::decompress_kernel stage.
Signed-off-by: Yinghai Lu
---
arch/x86/include/asm/page.h | 5 +++
arch/x86/mm/ident_map.c
eming
Cc: Kees Cook
Signed-off-by: Yinghai Lu
---
arch/x86/boot/compressed/head_32.S | 11 +--
arch/x86/boot/compressed/head_64.S | 8 ++--
arch/x86/boot/compressed/mkpiggy.c | 7 ++-
arch/x86/boot/compressed/vmlinux.lds.S | 1 +
arch/x86/boot/header.S
rton
Cc: Ard Biesheuvel
Cc: Junjie Mao
Signed-off-by: Yinghai Lu
---
arch/x86/boot/compressed/Makefile | 4 +---
arch/x86/boot/compressed/head_32.S | 5 ++---
arch/x86/boot/compressed/head_64.S | 5 +
arch/x86/boot/compressed/misc.c| 15 +++---
arch/x86/boot/compressed/mkp
hanks
Yinghai Lu
Yinghai Lu (7):
x86, kaslr: Use init_size instead of run_size
x86, boot: Move ZO to end of buffer
x86, boot: Don't overlap VO with ZO data
x86, kaslr: Access the correct kaslr_enabled variable
x86, kaslr: Consolidate mem_avoid array filling
x86, b
ferring to init_size, as we pass init_size instead.
Cc: Kees Cook
Signed-off-by: Yinghai Lu
---
arch/x86/boot/compressed/aslr.c | 29 ++---
arch/x86/boot/compressed/misc.h | 4 ++--
2 files changed, 16 insertions(+), 17 deletions(-)
diff --git a/arch/x86/boot/compressed/aslr.c
On Sat, Mar 7, 2015 at 1:05 PM, Borislav Petkov wrote:
> On Fri, Mar 06, 2015 at 11:53:22AM -0800, Yinghai Lu wrote:
> ---
> Commit
>
> f47233c2d34f ("x86/mm/ASLR: Propagate base load address calculation")
>
> started passing KASLR status to kernel proper, but
On Fri, Mar 6, 2015 at 11:56 AM, Kees Cook wrote:
> On Fri, Mar 6, 2015 at 11:28 AM, Yinghai Lu wrote:
> Okay, I've proven this to myself now. :) I think it would be valuable
> to call out that brk and bss are included in the _end calculation. For
> others:
...
> So, _en
On Fri, Mar 6, 2015 at 11:50 AM, Yinghai Lu wrote:
> On Fri, Mar 6, 2015 at 5:33 AM, Borislav Petkov wrote:
>
>>
>> "However, the setup_data linked list and thus the element which contains
>> kaslr_enabled is chained together using physical addresses. At the
>
On Fri, Mar 6, 2015 at 5:33 AM, Borislav Petkov wrote:
>
> "However, the setup_data linked list and thus the element which contains
> kaslr_enabled is chained together using physical addresses. At the
> time when we access it in the kernel proper, we're already running
> with paging enabled and t
On Fri, Mar 6, 2015 at 10:55 AM, Kees Cook wrote:
> On Fri, Mar 6, 2015 at 10:44 AM, Yinghai Lu wrote:
>
> I don't see how bss and brk are related to these sizes. Can you
> explain how bss, brk, and initrd factor into these sizes? Those were
> what run_size was created t
On Fri, Mar 6, 2015 at 5:55 AM, Borislav Petkov wrote:
> On Wed, Mar 04, 2015 at 12:00:34AM -0800, Yinghai Lu wrote:
>> commit e6023367d779 ("x86, kaslr: Prevent .bss from overlaping initrd")
>>
>> introduced one run_size for kaslr.
>>
>> We do not
On Fri, Mar 6, 2015 at 5:33 AM, Borislav Petkov wrote:
> Please use checkpatch before submitting patches:
>
> WARNING: please, no spaces at the start of a line
> #71: FILE: arch/x86/kernel/setup.c:433:
> +unsigned char *data;$
>
> WARNING: please, no spaces at the start of a line
> #72: FILE:
On Wed, Mar 4, 2015 at 6:58 PM, joeyli wrote:
>
> After 84c91b7ae merged to v3.17 kernel, hibernate code checks the e280 regions
> should not be changed when doing hibernate resume. Without your patch 8,
> the hibernate resume checking will randomly fail on the machines that reserved
> setup_data
3c2d34f ("x86/mm/ASLR: Propagate base load address calculation")
Cc: Matt Fleming
Cc: Borislav Petkov
Cc: Kees Cook
Cc: Jiri Kosina
Acked-by: Jiri Kosina
Signed-off-by: Yinghai Lu
---
arch/x86/kernel/setup.c | 13 -
1 file changed, 12 insertions(+), 1 deletion(-)
On Wed, Mar 4, 2015 at 10:06 AM, Yinghai Lu wrote:
> On Wed, Mar 4, 2015 at 2:16 AM, Borislav Petkov wrote:
>> On Wed, Mar 04, 2015 at 12:00:37AM -0800, Yinghai Lu wrote:
>>> commit f47233c2d34f ("x86/mm/ASLR: Propagate base load address calculation")
>&
On Wed, Mar 4, 2015 at 7:54 AM, Jiri Kosina wrote:
>
> Also this 15-patch series needs to be separated into two patchsets. The
> whole series is not appropriate for -rc3, but this particular one at least
> is a regression fix that has to go in.
The first 4 should go v4.0.
could leave others to
On Wed, Mar 4, 2015 at 2:16 AM, Borislav Petkov wrote:
> On Wed, Mar 04, 2015 at 12:00:37AM -0800, Yinghai Lu wrote:
>> commit f47233c2d34f ("x86/mm/ASLR: Propagate base load address calculation")
>> is using address as value for kaslr_enabled.
>>
>> That will
cross 512G boundary, will need
1+(2+2)*4 pages with 2M mapping.
Cc: Kees Cook
Cc: Jiri Kosina
Cc: Borislav Petkov
Cc: Matt Fleming
Signed-off-by: Yinghai Lu
---
arch/x86/boot/compressed/aslr.c | 28 +++
arch/x86/boot/compressed/head_64.S | 4 +-
arch/x86/boot/compressed
abled accessing...
6. export SETUP_PCI via sysfs.
Yinghai Lu (15):
x86, kaslr: Use init_size instead of run_size
x86, boot: move ZO to end of buffer
x86, boot: keep data from ZO boot stage to VO kernel stage.
x86, kaslr: get kaslr_enabled back correctly
x86, kaslr: consolidate the mem_avoid fi
We need to include that in boot::decompress_kernel stage to set new mapping.
Signed-off-by: Yinghai Lu
---
arch/x86/include/asm/page.h | 5 +++
arch/x86/mm/ident_map.c | 74 +
arch/x86/mm/init_64.c | 74
uot;x86/mm/ASLR: Propagate base load address calculation")
Cc: Matt Fleming
Cc: Borislav Petkov
Cc: Kees Cook
Cc: Jiri Kosina
Acked-by: Jiri Kosina
Signed-off-by: Yinghai Lu
---
arch/x86/kernel/setup.c | 8 +++-
1 file changed, 7 insertions(+), 1 deletion(-)
diff --git a/arch/x86/kerne
/compressed/vmlinux.
-v2: add init_size in arch/x86/boot/header.S instead of BRK.
-v3: split code that move Zo to end of buffer to another patch.
Fixes: f47233c2d34f ("x86/mm/ASLR: Propagate base load address calculation")
Cc: "H. Peter Anvin"
Cc: Matt Fleming
Cc: Kees Cook
Signe
il.
Fixes: e6023367d779 ("x86, kaslr: Prevent .bss from overlaping initrd")
Cc: "H. Peter Anvin"
Cc: Josh Triplett
Cc: Matt Fleming
Cc: Kees Cook
Cc: Andrew Morton
Cc: Ard Biesheuvel
Cc: Junjie Mao
Signed-off-by: Yinghai Lu
---
arch/x86/boot/compressed/Makefile | 4
compressed kernel close the end of buffer instead of middle
of the buffer.
Fixes: f47233c2d34f ("x86/mm/ASLR: Propagate base load address calculation")
Cc: "H. Peter Anvin"
Cc: Matt Fleming
Cc: Kees Cook
Signed-off-by: Yinghai Lu
---
arch/x86/boot/compressed/head_32.S | 11 ++
So we could let kexec-tools to rebuild SETUP_PCI and pass it to
second kernel.
Now kexec-tools already build SETUP_EFI and SETUP_E820EXT.
Cc: Bjorn Helgaas
Cc: linux-...@vger.kernel.org
Signed-off-by: Yinghai Lu
---
arch/x86/pci/common.c | 175
the copy will be in __initdata, and it is small.
We can use pointer to access the setup_data instead of keeping on
early_memmap and early_memunmap everywhere.
Cc: Matt Fleming
Cc: linux-efi@vger.kernel.org
Signed-off-by: Yinghai Lu
---
arch/x86/include/asm/efi.h | 2 +-
arch/x86/platform
Let it reserve setup_data, and keep it's own list.
Also clear the hdr.setup_data, as all handler will handle or
reserve setup_data locally already.
Cc: Bjorn Helgaas
Cc: Matt Fleming
Cc: linux-...@vger.kernel.org
Signed-off-by: Yinghai Lu
---
arch/x86/include/asm/pci.h | 2 ++
arc
Cc: Matt Fleming
Signed-off-by: Yinghai Lu
---
arch/x86/kernel/kdebugfs.c | 142 -
arch/x86/kernel/setup.c| 17 --
2 files changed, 159 deletions(-)
diff --git a/arch/x86/kernel/kdebugfs.c b/arch/x86/kernel/kdebugfs.c
index dc1404b..c8ca86c
So we could avoid ioremap every time later.
Cc: Bjorn Helgaas
Cc: linux-...@vger.kernel.org
Signed-off-by: Yinghai Lu
---
arch/x86/include/asm/pci.h | 2 ++
arch/x86/kernel/setup.c| 1 +
arch/x86/pci/common.c | 77 +-
3 files changed, 65
un-Yi"
Tested-by: "Lee, Chun-Yi"
Cc: "Lee, Chun-Yi"
Signed-off-by: Yinghai Lu
Cc: sta...@vger.kernel.org
---
arch/x86/include/uapi/asm/e820.h | 9 -
arch/x86/kernel/e820.c | 6 ++
arch/x86/kernel/setup.c | 26 -
As EFI stub code could put them high when on 32bit or with exactmap=
on 64bit conf.
Check is the range is mapped, otherwise allocate new one and have
the rom data copied. So we could really avoid ioremap.
Signed-off-by: Yinghai Lu
---
arch/x86/pci/common.c | 47
We will not reserve setup_data in general code. Every handler
need to reserve and copy.
Current dtd handling already have code copying, just add reserve code ...
also simplify code a bit with storing real dtb size.
Cc: Rob Herring
Cc: David Vrabel
Signed-off-by: Yinghai Lu
---
arch/x86
pass that instead already.
Cc: Kees Cook
Signed-off-by: Yinghai Lu
---
arch/x86/boot/compressed/aslr.c | 29 ++---
1 file changed, 14 insertions(+), 15 deletions(-)
diff --git a/arch/x86/boot/compressed/aslr.c b/arch/x86/boot/compressed/aslr.c
index 7083c16..e8486a5 10
: Kees Cook
Cc: Andrew Morton
Cc: Ard Biesheuvel
Cc: Junjie Mao
Signed-off-by: Yinghai Lu
---
arch/x86/boot/compressed/Makefile |4 ---
arch/x86/boot/compressed/head_32.S |5 +---
arch/x86/boot/compressed/head_64.S |5
arch/x86/boot/compressed/misc.c| 15 ++---
a
On Mon, Mar 2, 2015 at 6:53 AM, Borislav Petkov wrote:
> Well, it seems to work here but it still doesn't look reliable enough to
> me. And this addon_zo thing of arbitrary 256K is strange.
Thanks for check that out.
That is not arbitrary number. Need to make that bigger than _end - _rodata
> o
On Mon, Mar 2, 2015 at 12:56 AM, Borislav Petkov wrote:
> On Sun, Mar 01, 2015 at 12:41:10PM -0800, Yinghai Lu wrote:
>> Does not look safe yet...
>
> Why?
We can not assume that range is safe to use.
Please check attach one that should fix the problem really.
Thanks
Yinghai
On Sun, Mar 1, 2015 at 12:29 PM, Borislav Petkov wrote:
> On Sun, Mar 01, 2015 at 12:24:08PM -0800, Yinghai Lu wrote:
>> static allocation in misc.c can not be used to kernel/head_64.S stage safely.
>
> Correct. One possibility that works is sticking it right below
>
On Sun, Mar 1, 2015 at 11:49 AM, Borislav Petkov wrote:
> On Sun, Mar 01, 2015 at 11:27:48AM -0800, Yinghai Lu wrote:
>> other 7 should also address the problem in
>>http://lkml.kernel.org/r/1424929021.10337.24.ca...@intel.com
>
> No, they don't:
>
> [
On Sun, Mar 1, 2015 at 7:23 AM, Ingo Molnar wrote:
>
> I think that's a different bug.
>
> parse_kaslr_setup() is simply bogus, it does:
>
> kaslr_enabled = (bool)(pa_data + sizeof(struct setup_data));
>
> which makes no sense whatsoever: it randomly enables (or disables,
> depending on th
On Sat, Feb 28, 2015 at 6:17 PM, Yinghai Lu wrote:
> We should access variable with referrence instead of using physical
> address as value.
>
> Cc: Matt Fleming
> Cc: Borislav Petkov
> Signed-off-by: Yinghai Lu
> ---
> arch/x86/kernel/setup.c | 8 +++-
> 1
un-Yi"
Tested-by: "Lee, Chun-Yi"
Cc: "Lee, Chun-Yi"
Signed-off-by: Yinghai Lu
Cc: sta...@vger.kernel.org
---
arch/x86/include/uapi/asm/e820.h | 9 -
arch/x86/kernel/e820.c | 6 ++
arch/x86/kernel/setup.c | 26 -
We should access variable with referrence instead of using physical
address as value.
Cc: Matt Fleming
Cc: Borislav Petkov
Signed-off-by: Yinghai Lu
---
arch/x86/kernel/setup.c | 8 +++-
1 file changed, 7 insertions(+), 1 deletion(-)
diff --git a/arch/x86/kernel/setup.c b/arch/x86/kernel
Let it reserve setup_data, and keep it's own list.
Also clear the hdr.setup_data, as all handler will handle or
reserve setup_data locally already.
Cc: Bjorn Helgaas
Cc: Matt Fleming
Cc: linux-...@vger.kernel.org
Signed-off-by: Yinghai Lu
---
arch/x86/include/asm/pci.h | 2 ++
arc
the copy will be in __initdata, and it is small.
We can use pointer to access the setup_data instead of keeping on
early_memmap and early_memunmap everywhere.
Cc: Matt Fleming
Cc: linux-efi@vger.kernel.org
Signed-off-by: Yinghai Lu
---
arch/x86/include/asm/efi.h | 2 +-
arch/x86/platform
1 - 100 of 146 matches
Mail list logo