public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] kbuild: Fix permissions of modules.builtin.modinfo
@ 2026-01-27 19:23 Ethan Zuo
  2026-01-27 20:59 ` Nathan Chancellor
  0 siblings, 1 reply; 7+ messages in thread
From: Ethan Zuo @ 2026-01-27 19:23 UTC (permalink / raw)
  To: nathan, nsc; +Cc: masahiroy, linux-kbuild, linux-kernel, Ethan Zuo

Currently, modules.builtin.modinfo is created with executable permissions
(0755). This is because after commit 39cfd5b12160 ("kbuild: extract
modules.builtin.modinfo from vmlinux.unstripped"), modules.builtin.modinfo
is extracted from vmlinux.unstripped using objcopy. When extracting
sections, objcopy inherits attributes from the source ELF file.

Since modules.builtin.modinfo is a data file and not an executable,
it should have 0644 permissions. The executable bit can trigger
warnings in Debian's Lintian tool.

Explicitly set the permissions to 0644 after generation.

Fixes: 39cfd5b12160 ("kbuild: extract modules.builtin.modinfo from vmlinux.unstripped")
Signed-off-by: Ethan Zuo <yuxuan.zuo@outlook.com>
---
 scripts/Makefile.vmlinux | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/scripts/Makefile.vmlinux b/scripts/Makefile.vmlinux
index cd788cac9d91..c5305619b1d3 100644
--- a/scripts/Makefile.vmlinux
+++ b/scripts/Makefile.vmlinux
@@ -113,7 +113,8 @@ vmlinux: vmlinux.unstripped FORCE
 # what kmod expects to parse.
 quiet_cmd_modules_builtin_modinfo = GEN     $@
       cmd_modules_builtin_modinfo = $(cmd_objcopy); \
-                                    sed -i 's/\x00\+$$/\x00/g' $@
+                                    sed -i 's/\x00\+$$/\x00/g' $@; \
+                                    chmod 644 $@
 
 OBJCOPYFLAGS_modules.builtin.modinfo := -j .modinfo -O binary
 
-- 
2.51.0


^ permalink raw reply related	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2026-01-28 11:27 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-01-27 19:23 [PATCH] kbuild: Fix permissions of modules.builtin.modinfo Ethan Zuo
2026-01-27 20:59 ` Nathan Chancellor
2026-01-28  6:15   ` Ethan Zuo
2026-01-28  6:35   ` Ethan Zuo
2026-01-28  6:37   ` [PATCH v2] " Ethan Zuo
2026-01-28 11:27     ` Nicolas Schier
2026-01-28  8:16   ` [PATCH] " Nicolas Schier

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox