x86: updated patches for kaslr and setup_data etc for v4.3
Get series with b4
b4 am [email protected]Versions newest first
- v1 Latest42 patches 31 repliesIn review
Patches in v1 No applies recorded yet
| # | Subject and files | Size | Replies | Applied |
|---|---|---|---|---|
| 1/42 | x86, kasl: Remove not needed parameter for choose_kernel_locationarch/ arch/ arch/ | +5 | 1 reply | |
| 2/42 | x86, boot: Move compressed kernel to end of buffer before decompressingarch/ arch/ arch/ +4 more | +21 | 1 reply | |
| 3/42 | x86, boot: Fix run_size calculationarch/ arch/ arch/ | +16 | 1 reply | |
| 4/42 | x86, kaslr: Kill not needed and wrong run_size calculation code.arch/ arch/ arch/ +3 more | +6 | 1 reply | |
| 5/42 | x86, kaslr: rename output_size to output_run_sizearch/ arch/ arch/ | +11 | 0 replies | |
| 6/42 | x86, kaslr: Consolidate mem_avoid array fillingarch/ | +13 | 1 reply | |
| 7/42 | x86, boot: Move z_extract_offset calculation to header.Sarch/ arch/ arch/ +1 more | +32 | 0 replies | |
| 8/42 | x86, kaslr: Get correct max_addr for relocs pointerarch/ arch/ | +2 | 1 reply | |
| 9/42 | x86, boot: Split kernel_ident_mapping_init to another filearch/ arch/ arch/ | +80 | 0 replies | |
| 10/42 | x86, 64bit: Set ident_mapping for kaslrarch/ arch/ arch/ +3 more | +140 | 0 replies | |
| 11/42 | x86, boot: Add checking for memcpyarch/ arch/ arch/ | +35 | 0 replies | |
| 12/42 | x86, kaslr: Fix a bug that relocation can not be handled when kernel is loaded above 2Garch/ | +1 | 1 reply | |
| 13/42 | x86, kaslr: Introduce struct slot_area to manage randomization slot infoarch/ | +12 | 0 replies | |
| 14/42 | x86, kaslr: Add two functions which will be used laterarch/ | +51 | 0 replies | |
| 15/42 | x86, kaslr: Introduce fetch_random_virt_offset to randomize the kernel text mapping addressarch/ | +21 | 0 replies | |
| 16/42 | x86, kaslr: Randomize physical and virtual address of kernel separatelyarch/ arch/ arch/ | +58 | 0 replies | |
| 17/42 | x86, kaslr: Add support of kernel physical address randomization above 4Garch/ | +51 | 0 replies | |
| 18/42 | x86, kaslr: Remove useless codesarch/ | +0 | 0 replies | |
| 19/42 | x86, kaslr: Allow random address could be below loaded addressarch/ | +8 | 0 replies | |
| 20/42 | x86, boot: Add printf support for early console in compressed/misc.carch/ arch/ arch/ +1 more | +51 | 0 replies | |
| 21/42 | x86, boot: Add more debug printout in compressed/misc.carch/ | +11 | 0 replies | |
| 22/42 | x86, setup: Check early serial console per string instead of one chararch/ | +10 | 1 reply | |
| 23/42 | x86, setup: Use puts() instead of printf() in edd codearch/ | +2 | 0 replies | |
| 24/42 | x86: Setup early console as early as possible in x86_start_kernel()arch/ arch/ arch/ +3 more | +57 | 0 replies | |
| 25/42 | x86, boot: print compression suffix in decompress stagearch/ | +8 | 1 reply | |
| 26/42 | x86: remove not needed clear_page callingarch/ | +0 | 1 reply | |
| 27/42 | x86: restore end_of_ram to E820_RAMarch/ | +4 | 4 replies | |
| 28/42 | x86, boot: Allow 64bit EFI kernel to be loaded above 4GDocumentation/ arch/ arch/ +3 more | +39 | 2 replies | |
| 29/42 | x86: Find correct 64 bit ramdisk address for microcode early updatearch/ arch/ arch/ +1 more | +26 | 1 reply | |
| 30/42 | x86: Kill E820_RESERVED_KERNarch/ arch/ arch/ +2 more | +7 | 0 replies | |
| 31/42 | x86, efi: Copy SETUP_EFI data and access directlyarch/ arch/ arch/ +1 more | +18 | 2 replies | |
| 32/42 | x86, of: Let add_dtb reserve setup_data locallyarch/ arch/ | +27 | 0 replies | |
| 33/42 | x86, boot: Add add_pci handler for SETUP_PCIarch/ arch/ arch/ | +38 | 1 reply | |
| 34/42 | x86: Kill not used setup_data handling codearch/ arch/ | +0 | 0 replies | |
| 35/42 | x86, boot, PCI: Convert SETUP_PCI data to listarch/ arch/ arch/ | +65 | 2 replies | |
| 36/42 | x86, boot, PCI: Copy SETUP_PCI rom to kernel spacearch/ | +45 | 0 replies | |
| 37/42 | x86, boot, PCI: Export SETUP_PCI data via sysfsarch/ | +175 | 0 replies | |
| 38/42 | x86: Fix typo in mark_rodata_roarch/ | +2 | 1 reply | |
| 39/42 | x86, 64bit: add pfn_range_is_highmapped()arch/ arch/ arch/ | +25 | 0 replies | |
| 40/42 | x86, 64bit: remove highmap for not needed rangesarch/ | +62 | 1 reply | |
| 41/42 | x86, 64bit: Add __pa_high/__va_higharch/ | +9 | 0 replies | |
| 42/42 | x86: fix msr print againarch/ arch/ | +32 | 0 replies |
Reviews trailers per patch
5 of 42 patches have a Reviewed-by or Acked-by.
| Patch | Lee, Chun-Yi | Kees Cook | Mel Gorman | Seth Forshee |
|---|---|---|---|---|
| Series | T-b | |||
| 1/42 | A-b | |||
| 2/42 | ||||
| 3/42 | ||||
| 4/42 | ||||
| 5/42 | ||||
| 6/42 | ||||
| 7/42 | ||||
| 8/42 | A-b | |||
| 9/42 | R-b | |||
| 10/42 | ||||
| 11/42 | ||||
| 12/42 | A-b | |||
| 13/42 | ||||
| 14/42 | ||||
| 15/42 | ||||
| 16/42 | ||||
| 17/42 | ||||
| 18/42 | ||||
| 19/42 | ||||
| 20/42 | ||||
| 21/42 | ||||
| 22/42 | ||||
| 23/42 | ||||
| 24/42 | ||||
| 25/42 | ||||
| 26/42 | ||||
| 27/42 | ||||
| 28/42 | ||||
| 29/42 | A-b | |||
| 30/42 | T-b | |||
| 31/42 | ||||
| 32/42 | ||||
| 33/42 | ||||
| 34/42 | ||||
| 35/42 | T-b | |||
| 36/42 | ||||
| 37/42 | ||||
| 38/42 | ||||
| 39/42 | ||||
| 40/42 | ||||
| 41/42 | ||||
| 42/42 |
Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes. Scroll the table sideways for all 4 reviewers.
Cover letter [PATCH 00/42] x86: updated patches for kaslr and setup_data etc for v4.3
Those patches are rebased on v4.2-rc1 that I sent before but were rejected by Ingo on changelog.
Kees Cook said that he would like to give a try to make improvement on changelog to get things moving.
First part are kaslr related:
1. First put compressed kernel ZO near end of the buffer before decompressing so we can find the ZO position easily for kaslr buffer searchin
2. kill run_size calculation shell scripts.
3. create new ident mapping for kasl 64bit, so we can cover
above 4G random kernel base
4. 7 patches from He that support random random, as I already used his patches to test the ident mapping code.
5. some debug patches for boot/kaslr.
Second part are setup_data related:
Now setup_data is reserved via memblock and e820 and different handlers have different ways, and it is confusing.
1. SETUP_E820_EXT: is consumed early and will not copy or access again. have memory wasted.
2. SETUP_EFI: is accessed via ioremap every time at early stage. have memory wasted.
3. SETUP_DTB: is copied locally.
have memory wasted.
4. SETUP_PCI: is accessed via ioremap for every pci devices, even run-time. Also setup_data is exported to debugfs for debug purpose.
Here will convert to let every handler to decide how to handle it. and will not reserve the setup_data generally, so will not waste memory and also make memblock/e820 keep page aligned.
1. not touch E820 anymore.
2. copy SETUP_EFI to __initdata variable and access it without ioremap.
3. SETUP_DTB: reserver and copy to local and free.
4. SETUP_PCI: reverve localy and convert to list, to avoid keeping ioremap.
5. export SETUP_PCI via sysfs.
Third part are some small cleanup patches.
put those patches atgit://git.kernel.org/pub/scm/linux/kernel/git/yinghai/linux-yinghai.git for-x86-v4.3-next
Thanks
Yinghai
Baoquan He (7):
x86, kaslr: Fix a bug that relocation can not be handled when kernel is loaded above 2G x86, kaslr: Introduce struct slot_area to manage randomization slot info x86, kaslr: Add two functions which will be used later
x86, kaslr: Introduce fetch_random_virt_offset to randomize the kernel text mapping address x86, kaslr: Randomize physical and virtual address of kernel separately
x86, kaslr: Add support of kernel physical address randomization above 4G x86, kaslr: Remove useless codes
Yinghai Lu (35):
x86, kasl: Remove not needed parameter for choose_kernel_location x86, boot: Move compressed kernel to end of buffer before decompressing x86, boot: Fix run_size calculation
x86, kaslr: Kill not needed and wrong run_size calculation code. x86, kaslr: rename output_size to output_run_size
x86, kaslr: Consolidate mem_avoid array filling
x86, boot: Move z_extract_offset calculation to header.S x86, kaslr: Get correct max_addr for relocs pointer
x86, boot: Split kernel_ident_mapping_init to another file x86, 64bit: Set ident_mapping for kaslr
x86, boot: Add checking for memcpy
x86, kaslr: Allow random address could be below loaded address x86, boot: Add printf support for early console in compressed/misc.c x86, boot: Add more debug printout in compressed/misc.c x86, setup: Check early serial console per string instead of one char x86, setup: Use puts() instead of printf() in edd code
x86: Setup early console as early as possible in x86_start_kernel() x86, boot: print compression suffix in decompress stage
x86: remove not needed clear_page calling
x86: restore end_of_ram to E820_RAM
x86, boot: Allow 64bit EFI kernel to be loaded above 4G
x86: Find correct 64 bit ramdisk address for microcode early update
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 used setup_data handling code
x86, boot, PCI: Convert SETUP_PCI data to list
x86, boot, PCI: Copy SETUP_PCI rom to kernel space
x86, boot, PCI: Export SETUP_PCI data via sysfs
x86: Fix typo in mark_rodata_ro
x86, 64bit: add pfn_range_is_highmapped()
x86, 64bit: remove highmap for not needed ranges
x86, 64bit: Add __pa_high/__va_high
x86: fix msr print again
Documentation/x86/boot.txt | 19 ++ arch/x86/boot/Makefile | 13 +- arch/x86/boot/compressed/Makefile | 21 +- arch/x86/boot/compressed/aslr.c | 258 ++++++++++++++++------- arch/x86/boot/compressed/eboot.c | 15 +- arch/x86/boot/compressed/head_32.S | 14 +- arch/x86/boot/compressed/head_64.S | 22 +- arch/x86/boot/compressed/misc.c | 129 +++++++++--- arch/x86/boot/compressed/misc.h | 41 +++- arch/x86/boot/compressed/misc_pgt.c | 91 ++++++++ arch/x86/boot/compressed/mkpiggy.c | 28 +-- arch/x86/boot/compressed/printf.c | 5 + arch/x86/boot/compressed/string.c | 28 ++- arch/x86/boot/compressed/vmlinux.lds.S | 1 + arch/x86/boot/edd.c | 4 +- arch/x86/boot/header.S | 34 ++- arch/x86/boot/tty.c | 14 +- arch/x86/include/asm/boot.h | 19 ++ arch/x86/include/asm/efi.h | 2 +- arch/x86/include/asm/page.h | 5 + arch/x86/include/asm/pci.h | 4 + arch/x86/include/asm/pgtable_64.h | 2 + arch/x86/include/asm/processor.h | 1 - arch/x86/include/asm/prom.h | 9 +- arch/x86/include/asm/setup.h | 5 + arch/x86/include/uapi/asm/bootparam.h | 1 + arch/x86/include/uapi/asm/e820.h | 8 - arch/x86/kernel/asm-offsets.c | 2 + arch/x86/kernel/cpu/common.c | 61 +++--- arch/x86/kernel/cpu/microcode/amd_early.c | 10 +- arch/x86/kernel/cpu/microcode/intel_early.c | 8 +- arch/x86/kernel/devicetree.c | 39 ++-- arch/x86/kernel/e820.c | 18 +- arch/x86/kernel/head.c | 26 +++ arch/x86/kernel/head32.c | 1 + arch/x86/kernel/head64.c | 21 +- arch/x86/kernel/kdebugfs.c | 142 ------------- arch/x86/kernel/setup.c | 79 ++----- arch/x86/kernel/tboot.c | 3 +- arch/x86/kernel/vmlinux.lds.S | 1 + arch/x86/mm/ident_map.c | 74 +++++++ arch/x86/mm/init_64.c | 173 +++++++-------- arch/x86/mm/pageattr.c | 16 +- arch/x86/pci/common.c | 313 ++++++++++++++++++++++++++-- arch/x86/platform/efi/efi.c | 13 +- arch/x86/platform/efi/efi_64.c | 10 +- arch/x86/platform/efi/quirks.c | 23 +- arch/x86/tools/calc_run_size.sh | 42 ---- drivers/tty/serial/8250/8250_early.c | 17 ++ kernel/printk/printk.c | 11 +- 50 files changed, 1235 insertions(+), 661 deletions(-) create mode 100644 arch/x86/boot/compressed/misc_pgt.c create mode 100644 arch/x86/boot/compressed/printf.c create mode 100644 arch/x86/mm/ident_map.c delete mode 100644 arch/x86/tools/calc_run_size.sh
Signature · 1 line
1.8.4.5