From patchwork Mon Jan 31 21:43:13 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kees Cook X-Patchwork-Id: 81234 X-Patchwork-Delegate: tim.gardner@canonical.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from chlorine.canonical.com (chlorine.canonical.com [91.189.94.204]) by ozlabs.org (Postfix) with ESMTP id ABB91B6F1E for ; Tue, 1 Feb 2011 08:43:24 +1100 (EST) Received: from localhost ([127.0.0.1] helo=chlorine.canonical.com) by chlorine.canonical.com with esmtp (Exim 4.71) (envelope-from ) id 1Pk1Wn-0000je-3p; Mon, 31 Jan 2011 21:43:17 +0000 Received: from smtp.outflux.net ([198.145.64.163]) by chlorine.canonical.com with esmtp (Exim 4.71) (envelope-from ) id 1Pk1Wk-0000jJ-Vr for kernel-team@lists.ubuntu.com; Mon, 31 Jan 2011 21:43:15 +0000 Received: from www.outflux.net (serenity-end.outflux.net [10.2.0.2]) by vinyl.outflux.net (8.14.3/8.14.3/Debian-9.1ubuntu1) with ESMTP id p0VLhD3b032284 for ; Mon, 31 Jan 2011 13:43:14 -0800 Date: Mon, 31 Jan 2011 13:43:13 -0800 From: Kees Cook To: kernel-team@lists.ubuntu.com Subject: [PATCH] packaging: really make System.map mode 0600 Message-ID: <20110131214313.GG4557@outflux.net> MIME-Version: 1.0 Content-Disposition: inline Organization: Ubuntu X-MIMEDefang-Filter: outflux$Revision: 1.316 $ X-HELO: www.outflux.net X-Scanned-By: MIMEDefang 2.67 on 10.2.0.1 X-BeenThere: kernel-team@lists.ubuntu.com X-Mailman-Version: 2.1.13 Precedence: list List-Id: Kernel team discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: kernel-team-bounces@lists.ubuntu.com Errors-To: kernel-team-bounces@lists.ubuntu.com 799f11e9c88770eb1017a297c1a456013a80f324 tried to make System.map mode 0600. It turns out that dh_fixperms undoes that change. This patch fixes this up, corrects perms for sub-flavors, and adds vmcoreinfo to the mode 0600 list. Signed-off-by: Kees Cook --- debian/rules.d/2-binary-arch.mk | 6 ++++-- debian/scripts/sub-flavour | 4 +++- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/debian/rules.d/2-binary-arch.mk b/debian/rules.d/2-binary-arch.mk index c289d11..c31ab14 100644 --- a/debian/rules.d/2-binary-arch.mk +++ b/debian/rules.d/2-binary-arch.mk @@ -72,6 +72,7 @@ endif ifeq ($(no_dumpfile),) makedumpfile -g $(pkgdir)/boot/vmcoreinfo-$(abi_release)-$* \ -x $(builddir)/build-$*/vmlinux + chmod 0600 $(pkgdir)/boot/vmcoreinfo-$(abi_release)-$* endif $(build_cd) $(kmake) $(build_O) modules_install \ @@ -92,6 +93,7 @@ endif ifeq ($(no_dumpfile),) makedumpfile -g $(pkgdir)/boot/vmcoreinfo-$(abi_release)-$* \ -x $(builddir)/build-$*/vmlinux + chmod 0600 $(pkgdir)/boot/vmcoreinfo-$(abi_release)-$* endif rm -f $(pkgdir)/lib/modules/$(abi_release)-$*/build rm -f $(pkgdir)/lib/modules/$(abi_release)-$*/source @@ -275,7 +277,7 @@ binary-%: install-% dh_installchangelogs -p$(pkgimg) dh_installdocs -p$(pkgimg) dh_compress -p$(pkgimg) - dh_fixperms -p$(pkgimg) + dh_fixperms -p$(pkgimg) -X/boot/ dh_installdeb -p$(pkgimg) dh_shlibdeps -p$(pkgimg) dh_gencontrol -p$(pkgimg) @@ -298,7 +300,7 @@ ifneq ($(skipsub),true) dh_installchangelogs -p$$pkg; \ dh_installdocs -p$$pkg; \ dh_compress -p$$pkg; \ - dh_fixperms -p$$pkg; \ + dh_fixperms -p$$pkg -X/boot/; \ dh_shlibdeps -p$$pkg; \ dh_installdeb -p$$pkg; \ dh_gencontrol -p$$pkg; \ diff --git a/debian/scripts/sub-flavour b/debian/scripts/sub-flavour index c0093a6..45456bb 100644 --- a/debian/scripts/sub-flavour +++ b/debian/scripts/sub-flavour @@ -11,7 +11,9 @@ from_moddir="debian/$from_pkg/lib/modules/$ABI_RELEASE-$FROM" to_moddir="debian/$to_pkg/lib/modules/$ABI_RELEASE-$FROM" install -d "debian/$to_pkg/boot" -install -m644 debian/$from_pkg/boot/{vmlinuz,System.map,config}-$ABI_RELEASE-$FROM \ +install -m644 debian/$from_pkg/boot/{vmlinuz,config}-$ABI_RELEASE-$FROM \ + debian/$to_pkg/boot/ +install -m600 debian/$from_pkg/boot/System.map-$ABI_RELEASE-$FROM \ debian/$to_pkg/boot/ #