linux-kbuild.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Fabian Pfitzner <f.pfitzner@pengutronix.de>
To: Nathan Chancellor <nathan@kernel.org>, Nicolas Schier <nsc@kernel.org>
Cc: linux-kbuild@vger.kernel.org, linux-kernel@vger.kernel.org,
	 Fabian Pfitzner <f.pfitzner@pengutronix.de>
Subject: [PATCH] kbuild: fix modules.builtin.modinfo being executable
Date: Tue, 09 Dec 2025 16:59:45 +0100	[thread overview]
Message-ID: <20251209-modinfo-executable-v1-1-ed0c553a4390@pengutronix.de> (raw)

Since commit a26a6c93edfe ("kbuild: Strip trailing padding bytes from
modules.builtin.modinfo") the resulting modules.builtin.modinfo file gets
copied by objcopy resulting in an executable file.

It seems, that objcopy detects this file as executable even though
the file is not executable at all.

This problem arises on x86_64 and arm-v7a, but for some reason does not
happen on aarch64.

Fix this problem by removing the execution bit afterwards.

Signed-off-by: Fabian Pfitzner <f.pfitzner@pengutronix.de>
---
 scripts/Makefile.vmlinux | 1 +
 1 file changed, 1 insertion(+)

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

---
base-commit: cb015814f8b6eebcbb8e46e111d108892c5e6821
change-id: 20251209-modinfo-executable-2d2af74150c0

Best regards,
-- 
Fabian Pfitzner <f.pfitzner@pengutronix.de>


             reply	other threads:[~2025-12-09 16:00 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-12-09 15:59 Fabian Pfitzner [this message]
2025-12-09 18:02 ` [PATCH] kbuild: fix modules.builtin.modinfo being executable Randy Dunlap
2025-12-10  0:28 ` Nathan Chancellor

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20251209-modinfo-executable-v1-1-ed0c553a4390@pengutronix.de \
    --to=f.pfitzner@pengutronix.de \
    --cc=linux-kbuild@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=nathan@kernel.org \
    --cc=nsc@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).