Skip to content

Commit 5d83a17

Browse files
authored
Change the system.map file permission only readable by root (#368)
1 parent 6370502 commit 5d83a17

File tree

2 files changed

+28
-12
lines changed

2 files changed

+28
-12
lines changed
Lines changed: 27 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,42 @@
1-
From 01e598f75f4ab650555b01116ceec4e5c8f2899b Mon Sep 17 00:00:00 2001
2-
From: xumia <xumia@contoso.com>
3-
Date: Thu, 7 Sep 2023 02:53:49 +0000
1+
From 0ec2a0c7a1380d55072fa3661abf8a33215b3dd6 Mon Sep 17 00:00:00 2001
2+
From: xumia <xumia@microsoft.com>
3+
Date: Sun, 10 Dec 2023 01:02:27 +0000
44
Subject: [PATCH] Change the system.map file permission only readable by root
55

66
---
7-
debian/rules.real | 2 +-
8-
1 file changed, 1 insertion(+), 1 deletion(-)
7+
debian/rules.real | 5 +++--
8+
1 file changed, 3 insertions(+), 2 deletions(-)
99

1010
diff --git a/debian/rules.real b/debian/rules.real
11-
index 3304579ad..908258789 100644
11+
index 98ee4ac7a..5f1d8a665 100644
1212
--- a/debian/rules.real
1313
+++ b/debian/rules.real
14-
@@ -505,7 +505,7 @@ install-image-dbg_$(ARCH)_$(FEATURESET)_$(FLAVOUR): $(STAMPS_DIR)/build_$(ARCH)_
15-
dh_installdirs usr/lib/debug usr/lib/debug/boot usr/share/lintian/overrides/
14+
@@ -191,7 +191,7 @@ endif
15+
dh_bugfiles
1616
dh_lintian
17+
dh_compress
18+
- dh_fixperms
19+
+ dh_fixperms -XSystem.map-*
20+
dh_installdeb
21+
dh_gencontrol -- $(GENCONTROL_ARGS)
22+
dh_md5sums
23+
@@ -383,6 +383,7 @@ endif
24+
sed '/CONFIG_\(MODULE_SIG_\(ALL\|KEY\)\|SYSTEM_TRUSTED_KEYS\|BUILD_SALT\)[ =]/d' $(DIR)/.config > $(DESTDIR)/boot/config-$(REAL_VERSION)
25+
echo "ffffffffffffffff B The real System.map is in the linux-image-<version>-dbg package" \
26+
> $(DESTDIR)/boot/System.map-$(REAL_VERSION)
27+
+ chmod 600 $(DESTDIR)/boot/System.map-$(REAL_VERSION)
28+
rm -f $(DESTDIR)/lib/modules/$(REAL_VERSION)/build
29+
rm -f $(DESTDIR)/lib/modules/$(REAL_VERSION)/source
30+
rm $(DESTDIR)/lib/firmware -rf
31+
@@ -435,7 +436,7 @@ binary_image-dbg: $(STAMPS_DIR)/build_$(ARCH)_$(FEATURESET)_$(FLAVOUR)
32+
dh_prep
33+
dh_installdirs usr/lib/debug usr/lib/debug/boot usr/share/lintian/overrides/
1734
install -m644 $(DIR)/vmlinux $(DEBUG_DIR)/boot/vmlinux-$(REAL_VERSION)
1835
- install -m644 $(DIR)/System.map $(DEBUG_DIR)/boot/System.map-$(REAL_VERSION)
1936
+ install -m600 $(DIR)/System.map $(DEBUG_DIR)/boot/System.map-$(REAL_VERSION)
20-
+$(MAKE_CLEAN) -C $(DIR) modules_install DEPMOD='$(CURDIR)/debian/bin/no-depmod' INSTALL_MOD_PATH='$(CURDIR)'/$(DEBUG_DIR)
37+
+$(MAKE_CLEAN) -C $(DIR) modules_install DEPMOD='$(CURDIR)/debian/bin/no-depmod' INSTALL_MOD_PATH=$(DEBUG_DIR)
2138
find $(DEBUG_DIR)/lib/modules/$(REAL_VERSION)/ -mindepth 1 -maxdepth 1 \! -name kernel -exec rm {} \+
2239
rm $(DEBUG_DIR)/lib/firmware -rf
2340
--
24-
2.30.2
41+
2.25.1
2542

patch/series

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -185,8 +185,7 @@ cisco-npu-disable-other-bars.patch
185185
0024-drivers-soc-pensando-penfw-driver.patch
186186

187187
# Security patch
188-
# TODO: update for bookworm
189-
#0001-Change-the-system.map-file-permission-only-readable-.patch
188+
0001-Change-the-system.map-file-permission-only-readable-.patch
190189

191190
#
192191
#

0 commit comments

Comments
 (0)