All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 00/15][V4] kexec: A new system call to allow in kernel loading
@ 2014-06-26 20:33 ` Vivek Goyal
  0 siblings, 0 replies; 88+ messages in thread
From: Vivek Goyal @ 2014-06-26 20:33 UTC (permalink / raw)
  To: linux-kernel, kexec
  Cc: ebiederm, hpa, mjg59, greg, bp, dyoung, chaowang, bhe, akpm, Vivek Goyal

Hi,

This is V4 of the patchset. Previous versions were posted here.

V1: https://lkml.org/lkml/2013/11/20/540
V2: https://lkml.org/lkml/2014/1/27/331
V3: https://lkml.org/lkml/2014/6/3/432

Changes since v3:

- Took care of most of the review comments from V3.
- Stopped building purgatory for 32bit.
- If 64bit EFI is not enabled (EFI_64BIT) return error in kernel loading.
- If EFI OLD_MEMMAP is being used, do not do EFI setup and user space is
  expected to pass acpi_rsdp=<addr> param and boot second kernel in non
  efi mode.
- move machine_kexec.c code into kexec-bzimage64.c
- Renamed kexec-bzimage.c to kexec-bzimage64.c to reflect the fact that
  it is only 64bit bzimage loader.

This patch series is generated on top of 3.16.0-rc2.

This patch series does not do kernel signature verification yet. I plan
to post another patch series for that. Now distributions are already signing
PE/COFF bzImage with PKCS7 signature I plan to parse and verify those
signatures.

Primary goal of this patchset is to prepare groundwork so that kernel
image can be signed and signatures be verified during kexec load. This
should help with two things.

- It should allow kexec/kdump on secureboot enabled machines.

- In general it can help even without secureboot. By being able to verify
  kernel image signature in kexec, it should help with avoiding module
  signing restrictions. Matthew Garret showed how to boot into a custom
  kernel, modify first kernel's memory and then jump back to old kernel and
  bypass any policy one wants to.

I hope these patches can be queued up for 3.17. Even without signature
verification support, they provide new syscall functionality. But I
wil leave it to maintainers to decide if they want signature verification
support also be ready to merge before they merge this patchset.

Any feedback is welcome.

Thanks
Vivek

Vivek Goyal (15):
  bin2c: Move bin2c in scripts/basic
  kernel: Build bin2c based on config option CONFIG_BUILD_BIN2C
  kexec: rename unusebale_pages to unusable_pages
  kexec: Move segment verification code in a separate function
  kexec: Use common function for kimage_normal_alloc() and
    kimage_crash_alloc()
  resource: Provide new functions to walk through resources
  kexec: Make kexec_segment user buffer pointer a union
  kexec: New syscall kexec_file_load() declaration
  kexec: Implementation of new syscall kexec_file_load
  purgatory/sha256: Provide implementation of sha256 in purgaotory
    context
  purgatory: Core purgatory functionality
  kexec: Load and Relocate purgatory at kernel load time
  kexec-bzImage64: Support for loading bzImage using 64bit entry
  kexec: Support for kexec on panic using new system call
  kexec: Support kexec/kdump on EFI systems

 arch/x86/Kbuild                        |    4 +
 arch/x86/Kconfig                       |    3 +
 arch/x86/Makefile                      |    8 +
 arch/x86/include/asm/crash.h           |    9 +
 arch/x86/include/asm/kexec-bzimage64.h |    6 +
 arch/x86/include/asm/kexec.h           |   40 +
 arch/x86/kernel/Makefile               |    1 +
 arch/x86/kernel/crash.c                |  563 ++++++++++++++
 arch/x86/kernel/kexec-bzimage64.c      |  532 +++++++++++++
 arch/x86/kernel/machine_kexec_64.c     |  228 ++++++
 arch/x86/purgatory/Makefile            |   30 +
 arch/x86/purgatory/entry64.S           |  101 +++
 arch/x86/purgatory/purgatory.c         |   72 ++
 arch/x86/purgatory/setup-x86_64.S      |   58 ++
 arch/x86/purgatory/sha256.c            |  283 +++++++
 arch/x86/purgatory/sha256.h            |   22 +
 arch/x86/purgatory/stack.S             |   19 +
 arch/x86/purgatory/string.c            |   13 +
 arch/x86/syscalls/syscall_64.tbl       |    1 +
 drivers/firmware/efi/runtime-map.c     |   21 +
 include/linux/efi.h                    |   19 +
 include/linux/ioport.h                 |    6 +
 include/linux/kexec.h                  |  101 ++-
 include/linux/syscalls.h               |    4 +
 include/uapi/linux/kexec.h             |   11 +
 init/Kconfig                           |    5 +
 kernel/Makefile                        |    2 +-
 kernel/kexec.c                         | 1322 ++++++++++++++++++++++++++++----
 kernel/resource.c                      |  101 ++-
 kernel/sys_ni.c                        |    1 +
 scripts/.gitignore                     |    1 -
 scripts/Makefile                       |    1 -
 scripts/basic/.gitignore               |    1 +
 scripts/basic/Makefile                 |    1 +
 scripts/basic/bin2c.c                  |   35 +
 scripts/bin2c.c                        |   36 -
 36 files changed, 3463 insertions(+), 198 deletions(-)
 create mode 100644 arch/x86/include/asm/crash.h
 create mode 100644 arch/x86/include/asm/kexec-bzimage64.h
 create mode 100644 arch/x86/kernel/kexec-bzimage64.c
 create mode 100644 arch/x86/purgatory/Makefile
 create mode 100644 arch/x86/purgatory/entry64.S
 create mode 100644 arch/x86/purgatory/purgatory.c
 create mode 100644 arch/x86/purgatory/setup-x86_64.S
 create mode 100644 arch/x86/purgatory/sha256.c
 create mode 100644 arch/x86/purgatory/sha256.h
 create mode 100644 arch/x86/purgatory/stack.S
 create mode 100644 arch/x86/purgatory/string.c
 create mode 100644 scripts/basic/bin2c.c
 delete mode 100644 scripts/bin2c.c

-- 
1.9.0


^ permalink raw reply	[flat|nested] 88+ messages in thread

end of thread, other threads:[~2014-08-11 20:24 UTC | newest]

Thread overview: 88+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-06-26 20:33 [PATCH 00/15][V4] kexec: A new system call to allow in kernel loading Vivek Goyal
2014-06-26 20:33 ` Vivek Goyal
2014-06-26 20:33 ` [PATCH 01/15] bin2c: Move bin2c in scripts/basic Vivek Goyal
2014-06-26 20:33   ` Vivek Goyal
2014-06-26 20:33 ` [PATCH 02/15] kernel: Build bin2c based on config option CONFIG_BUILD_BIN2C Vivek Goyal
2014-06-26 20:33   ` Vivek Goyal
2014-06-26 20:33 ` [PATCH 03/15] kexec: rename unusebale_pages to unusable_pages Vivek Goyal
2014-06-26 20:33   ` Vivek Goyal
2014-06-26 20:33 ` [PATCH 04/15] kexec: Move segment verification code in a separate function Vivek Goyal
2014-06-26 20:33   ` Vivek Goyal
2014-06-26 20:33 ` [PATCH 05/15] kexec: Use common function for kimage_normal_alloc() and kimage_crash_alloc() Vivek Goyal
2014-06-26 20:33   ` Vivek Goyal
2014-06-26 20:33 ` [PATCH 06/15] resource: Provide new functions to walk through resources Vivek Goyal
2014-06-26 20:33   ` Vivek Goyal
2014-06-26 20:33 ` [PATCH 07/15] kexec: Make kexec_segment user buffer pointer a union Vivek Goyal
2014-06-26 20:33   ` Vivek Goyal
2014-06-26 20:33 ` [PATCH 08/15] kexec: New syscall kexec_file_load() declaration Vivek Goyal
2014-06-26 20:33   ` Vivek Goyal
2014-06-26 20:33   ` Vivek Goyal
2014-06-26 20:43   ` Vivek Goyal
2014-06-26 20:43     ` Vivek Goyal
2014-06-26 20:43     ` Vivek Goyal
2014-06-26 21:03     ` Andy Lutomirski
2014-06-26 21:03       ` Andy Lutomirski
2014-06-27 11:50       ` Vivek Goyal
2014-06-27 11:50         ` Vivek Goyal
2014-06-27 11:50         ` Vivek Goyal
2014-06-27 12:20         ` Michael Kerrisk (man-pages)
2014-06-27 12:20           ` Michael Kerrisk (man-pages)
2014-06-27 12:20           ` Michael Kerrisk (man-pages)
2014-06-26 20:33 ` [PATCH 09/15] kexec: Implementation of new syscall kexec_file_load Vivek Goyal
2014-06-26 20:33   ` Vivek Goyal
2014-06-26 20:58   ` Andrew Morton
2014-06-26 20:58     ` Andrew Morton
2014-06-27 16:31     ` Vivek Goyal
2014-06-27 16:31       ` Vivek Goyal
2014-07-01 20:25       ` Vivek Goyal
2014-07-01 20:25         ` Vivek Goyal
2014-06-26 20:33 ` [PATCH 10/15] purgatory/sha256: Provide implementation of sha256 in purgaotory context Vivek Goyal
2014-06-26 20:33   ` Vivek Goyal
2014-06-26 20:33 ` [PATCH 11/15] purgatory: Core purgatory functionality Vivek Goyal
2014-06-26 20:33   ` Vivek Goyal
2014-08-11 17:40   ` Shaun Ruffell
2014-08-11 17:40     ` Shaun Ruffell
2014-08-11 17:51     ` H. Peter Anvin
2014-08-11 17:51       ` H. Peter Anvin
2014-08-11 18:02       ` Vivek Goyal
2014-08-11 18:02         ` Vivek Goyal
2014-08-11 18:08         ` H. Peter Anvin
2014-08-11 18:08           ` H. Peter Anvin
2014-08-11 18:15           ` Vivek Goyal
2014-08-11 18:15             ` Vivek Goyal
2014-08-11 20:23           ` Vivek Goyal
2014-08-11 20:23             ` Vivek Goyal
2014-06-26 20:33 ` [PATCH 12/15] kexec: Load and Relocate purgatory at kernel load time Vivek Goyal
2014-06-26 20:33   ` Vivek Goyal
2014-06-26 20:33 ` [PATCH 13/15] kexec-bzImage64: Support for loading bzImage using 64bit entry Vivek Goyal
2014-06-26 20:33   ` Vivek Goyal
2014-06-26 20:33 ` [PATCH 14/15] kexec: Support for kexec on panic using new system call Vivek Goyal
2014-06-26 20:33   ` Vivek Goyal
2014-06-26 20:33 ` [PATCH 15/15] kexec: Support kexec/kdump on EFI systems Vivek Goyal
2014-06-26 20:33   ` Vivek Goyal
2014-06-26 20:33   ` Vivek Goyal
2014-07-01 19:46   ` Matt Fleming
2014-07-01 19:46     ` Matt Fleming
2014-07-01 19:46     ` Matt Fleming
2014-07-01 20:14     ` Andrew Morton
2014-07-01 20:14       ` Andrew Morton
2014-07-01 20:14       ` Andrew Morton
2014-07-01 20:21       ` Vivek Goyal
2014-07-01 20:21         ` Vivek Goyal
2014-07-01 20:21         ` Vivek Goyal
2014-07-01 21:23       ` Matt Fleming
2014-07-01 21:23         ` Matt Fleming
2014-07-01 21:23         ` Matt Fleming
2014-07-01 20:09   ` [PATCH 17/15] kexec-bzimage: Change EFI helper function names Vivek Goyal
2014-07-01 20:09     ` Vivek Goyal
2014-07-01 20:09     ` Vivek Goyal
2014-06-26 20:39 ` [PATCH 00/15][V4] kexec: A new system call to allow in kernel loading Vivek Goyal
2014-06-26 20:39   ` Vivek Goyal
2014-06-26 20:58 ` Andrew Morton
2014-06-26 20:58   ` Andrew Morton
2014-06-26 21:21   ` Borislav Petkov
2014-06-26 21:21     ` Borislav Petkov
2014-06-27 11:33   ` Vivek Goyal
2014-06-27 11:33     ` Vivek Goyal
2014-06-27 16:34 ` [PATCH 16/15] kexec: Fix freeing up for image loader data loading Vivek Goyal
2014-06-27 16:34   ` Vivek Goyal

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.