mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Mehmet Kayaalp <mkayaalp@linux.vnet.ibm.com>
To: David Howells <dhowells@redhat.com>,
	linux-kernel@vger.kernel.org,
	linux-security-module@vger.kernel.org,
	linux-ima-devel@lists.sourceforge.net, keyrings@vger.kernel.org
Cc: Mimi Zohar <zohar@linux.vnet.ibm.com>,
	George Wilson <gcwilson@us.ibm.com>,
	Stefan Berger <stefanb@linux.vnet.ibm.com>,
	Mehmet Kayaalp <mkayaalp@linux.vnet.ibm.com>
Subject: [PATCH 2/3 v2] KEYS: Insert incompressible bytes to vmlinux to reserve space in bzImage
Date: Wed, 22 Jun 2016 18:37:32 -0400	[thread overview]
Message-ID: <1466635053-30512-3-git-send-email-mkayaalp@linux.vnet.ibm.com> (raw)
In-Reply-To: <1466635053-30512-1-git-send-email-mkayaalp@linux.vnet.ibm.com>

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

  parent reply	other threads:[~2016-06-22 22:39 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-06-22 22:37 [PATCH 0/3 v2] Certificate insertion support for x86 bzImages Mehmet Kayaalp
2016-06-22 22:37 ` [PATCH 1/3 v2] KEYS: Support for inserting a certificate into x86 bzImage Mehmet Kayaalp
2016-06-22 22:37 ` Mehmet Kayaalp [this message]
2016-06-23  6:17   ` [PATCH 2/3 v2] KEYS: Insert incompressible bytes to vmlinux to reserve space in bzImage kbuild test robot
2016-06-22 22:37 ` [PATCH 3/3 v2] KEYS: Print insert-sys-cert information to stdout instead of stderr Mehmet Kayaalp

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1466635053-30512-3-git-send-email-mkayaalp@linux.vnet.ibm.com \
    --to=mkayaalp@linux.vnet.ibm.com \
    --cc=dhowells@redhat.com \
    --cc=gcwilson@us.ibm.com \
    --cc=keyrings@vger.kernel.org \
    --cc=linux-ima-devel@lists.sourceforge.net \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-security-module@vger.kernel.org \
    --cc=stefanb@linux.vnet.ibm.com \
    --cc=zohar@linux.vnet.ibm.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®