From patchwork Fri Mar 7 18:32:03 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andy Whitcroft X-Patchwork-Id: 328048 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from huckleberry.canonical.com (huckleberry.canonical.com [91.189.94.19]) by ozlabs.org (Postfix) with ESMTP id F1E332C00B9 for ; Sat, 8 Mar 2014 05:32:22 +1100 (EST) Received: from localhost ([127.0.0.1] helo=huckleberry.canonical.com) by huckleberry.canonical.com with esmtp (Exim 4.76) (envelope-from ) id 1WLzZ8-0002lB-N2; Fri, 07 Mar 2014 18:32:14 +0000 Received: from mail-we0-f178.google.com ([74.125.82.178]) by huckleberry.canonical.com with esmtp (Exim 4.76) (envelope-from ) id 1WLzZ2-0002l3-KC for kernel-team@lists.ubuntu.com; Fri, 07 Mar 2014 18:32:08 +0000 Received: by mail-we0-f178.google.com with SMTP id u56so5278233wes.23 for ; Fri, 07 Mar 2014 10:32:08 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=YSkKHBn6oJWzakCap5O0NB9mdliV7KtMyqhQw0sZUys=; b=b+gd17WsBD+Szv0ybZeriXTa/0xB8C6CF+fHTFjKgQ+pFOZCoLek+oWoCo9oviMA5+ la8T/3WY/L4sVENLVChmx3t7E9XYRm3dgKX1+yeOFQXS46eZS3cjh/fctIxR6edHbIig oN3nXuIi9PchSlAGJ1+2412wWmsjYDwaf9ktWMxS2rvlsIvu6d24tVDIfNDUyZjHrGHC 5nMGF35V7PfrOd/9URZ9FcucKyhxqyU9on2c0VTH3Qs+apoxz1igyvVs1ExJhJktFInA ygz8jxR0Ma9SPRLDR+/phsyFDKKJZvbTNKexEzXFMfNsMvK0tIOrMpCVF9pulkncJ+F4 y+DQ== X-Gm-Message-State: ALoCoQmG9jR7aReO7t98GGN/c7B1BRVzPJL47+ZxTEahKyHlvqCkX1L4phT6tWDOshLD0dMlqO+9 X-Received: by 10.194.188.41 with SMTP id fx9mr21255314wjc.56.1394217128462; Fri, 07 Mar 2014 10:32:08 -0800 (PST) Received: from localhost ([2001:470:6973:2:221:70ff:fe81:b177]) by mx.google.com with ESMTPSA id lz3sm268733wic.1.2014.03.07.10.32.07 for (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Fri, 07 Mar 2014 10:32:07 -0800 (PST) From: Andy Whitcroft To: kernel-team@lists.ubuntu.com Subject: [SRU precise/lts-backport-raring 1/1] UBUNTU: [Debian] Re-sign modules after debug objcopy Date: Fri, 7 Mar 2014 18:32:03 +0000 Message-Id: <1394217123-32501-2-git-send-email-apw@canonical.com> X-Mailer: git-send-email 1.9.0 In-Reply-To: <1394217123-32501-1-git-send-email-apw@canonical.com> References: <1394217123-32501-1-git-send-email-apw@canonical.com> Cc: Andy Whitcroft X-BeenThere: kernel-team@lists.ubuntu.com X-Mailman-Version: 2.1.14 Precedence: list List-Id: Kernel team discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: kernel-team-bounces@lists.ubuntu.com Sender: kernel-team-bounces@lists.ubuntu.com From: Tim Gardner BugLink: http://bugs.launchpad.net/bugs/1253155 Adding a GNU debug link to a module ELF destroys the module signature, so re-sign the module file after the objcopy. objcopy --add-gnu-debuglink=$(dbgpkgdir)/usr/lib/debug/$$module $(pkgdir)/$$module; scripts/sign-file $(CONFIG_MODULE_SIG_HASH) $(MODSECKEY) $(MODPUBKEY) $(pkgdir)/$$module; Signed-off-by: Tim Gardner Acked-by: Andy Whitcroft Acked-by: Stefan Bader Signed-off-by: Andy Whitcroft --- debian/rules.d/2-binary-arch.mk | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/debian/rules.d/2-binary-arch.mk b/debian/rules.d/2-binary-arch.mk index c593ef2..54bc527 100644 --- a/debian/rules.d/2-binary-arch.mk +++ b/debian/rules.d/2-binary-arch.mk @@ -54,6 +54,9 @@ install-%: instfile = $(call custom_override,install_file,$*) install-%: hdrdir = $(CURDIR)/debian/$(basepkg)-$*/usr/src/$(basepkg)-$* install-%: target_flavour = $* install-%: dtb_files = $(dtb_files_$*) +install-%: CONFIG_MODULE_SIG_HASH=sha512 +install-%: MODSECKEY=$(builddir)/build-$*/signing_key.priv +install-%: MODPUBKEY=$(builddir)/build-$*/signing_key.x509 install-%: checks-% @echo Debug: $@ kernel_file $(kernel_file) kernfile $(kernfile) install_file $(install_file) instfile $(instfile) dh_testdir @@ -212,6 +215,8 @@ ifneq ($(skipdbg),true) $(CROSS_COMPILE)objcopy \ --add-gnu-debuglink=$(dbgpkgdir)/usr/lib/debug/$$module \ $(pkgdir)/$$module; \ + scripts/sign-file $(CONFIG_MODULE_SIG_HASH) $(MODSECKEY) $(MODPUBKEY) \ + $(pkgdir)/$$module; \ fi; \ done rm -f $(dbgpkgdir)/usr/lib/debug/lib/modules/$(abi_release)-$*/build