UBUNTU: [Config] packaging: adjust perms on vmlinuz as well
authorKees Cook <kees@ubuntu.com>
Wed, 23 Mar 2011 20:17:13 +0000 (13:17 -0700)
committerLeann Ogasawara <leann.ogasawara@canonical.com>
Mon, 28 Mar 2011 13:54:57 +0000 (06:54 -0700)
Since kernel symbols are resolvable internally to the kernel, the kernel
itself has a map of the symbols. Continuing the tradition of frustrating
off-the-shelf kernel exploits, make vmlinuz unreadable for non-root, just
like has been done for System.map, etc.

Signed-off-by: Kees Cook <kees.cook@canonical.com>
Signed-off-by: Tim Gardner <tim.gardner@canonical.com>

debian/rules.d/2-binary-arch.mk
debian/scripts/sub-flavour

index c31ab14..9765ef7 100644 (file)
@@ -54,13 +54,13 @@ install-%: $(stampdir)/stamp-build-% checks-%
        # compress_file logic required because not all architectures
        # generate a zImage automatically out of the box
 ifeq ($(compress_file),)
-       install -m644 -D $(builddir)/build-$*/$(kernel_file) \
+       install -m600 -D $(builddir)/build-$*/$(kernel_file) \
                $(pkgdir)/boot/$(install_file)-$(abi_release)-$*
 else
        install -d $(pkgdir)/boot
        gzip -c9v $(builddir)/build-$*/$(kernel_file) > \
                $(pkgdir)/boot/$(install_file)-$(abi_release)-$*
-       chmod 644 $(pkgdir)/boot/$(install_file)-$(abi_release)-$*
+       chmod 600 $(pkgdir)/boot/$(install_file)-$(abi_release)-$*
 endif
 
        install -m644 $(builddir)/build-$*/.config \
index 45456bb..0100493 100644 (file)
@@ -11,9 +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,config}-$ABI_RELEASE-$FROM \
+install -m644 debian/$from_pkg/boot/config-$ABI_RELEASE-$FROM \
        debian/$to_pkg/boot/
-install -m600 debian/$from_pkg/boot/System.map-$ABI_RELEASE-$FROM \
+install -m600 debian/$from_pkg/boot/{vmlinuz,System.map}-$ABI_RELEASE-$FROM \
        debian/$to_pkg/boot/
 
 #