Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1429147

[PATCH 2/3 v2] KEYS: Insert incompressible bytes to vmlinux to reserve space in bzImage

From Mehmet Kayaalp <mkayaalp@linux.vnet.ibm.com>
Newsgroups linux.kernel
Subject [PATCH 2/3 v2] KEYS: Insert incompressible bytes to vmlinux to reserve space in bzImage
Date 2016-06-23 00:40 +0200
Message-ID <rMYYp-11q-5@gated-at.bofh.it> (permalink)
References <rMYYp-11q-7@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


Call insert-sys-cert script with null file to ensure that random bytes are
inserted to the space reserved with CONFIG_SYSTEM_EXTRA_CERTIFICATE, before
compressing the vmlinux. This results in an uncompressed reserved area
inside the bzImage as well, so that it can be replaced with an actual
certificate later (after the bzImage is distributed).

Cross compilation is not supported yet.

Signed-off-by: Mehmet Kayaalp <mkayaalp@linux.vnet.ibm.com>
Tested-by: Stefan Berger <stefanb@linux.vnet.ibm.com>
Acked-by: Mimi Zohar <zohar@linux.vnet.ibm.com>
---
 arch/x86/boot/compressed/Makefile | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/arch/x86/boot/compressed/Makefile b/arch/x86/boot/compressed/Makefile
index f135688..5b15e56 100644
--- a/arch/x86/boot/compressed/Makefile
+++ b/arch/x86/boot/compressed/Makefile
@@ -88,8 +88,16 @@ vmlinux-objs-$(CONFIG_EFI_MIXED) += $(obj)/efi_thunk_$(BITS).o
 $(obj)/vmlinux: $(vmlinux-objs-y) FORCE
 	$(call if_changed,ld)
 
+quiet_cmd_inscert = INSCERT /dev/null to $<
+      cmd_inscert = scripts/insert-sys-cert -b $< -c /dev/null > /dev/null
+
 OBJCOPYFLAGS_vmlinux.bin :=  -R .comment -S
 $(obj)/vmlinux.bin: vmlinux FORCE
+ifndef CROSS_COMPILE
+ifeq ("$(CONFIG_SYSTEM_EXTRA_CERTIFICATE)", "y")
+	$(call if_changed,inscert)
+endif
+endif
 	$(call if_changed,objcopy)
 
 targets += $(patsubst $(obj)/%,%,$(vmlinux-objs-y)) vmlinux.bin.all vmlinux.relocs
-- 
2.7.4

Back to linux.kernel | Previous | Next | Find similar | Unroll thread


Thread

[PATCH 2/3 v2] KEYS: Insert incompressible bytes to vmlinux to reserve space in bzImage Mehmet Kayaalp <mkayaalp@linux.vnet.ibm.com> - 2016-06-23 00:40 +0200

csiph-web