From: "Antonin Godard" <antonin.godard@bootlin.com>
To: <anis.bougrine10@gmail.com>, <openembedded-core@lists.openembedded.org>
Cc: <ross.burton@arm.com>
Subject: Re: [OE-core] [PATCH] kernel.bbclass: add strip process for signed kernel modules
Date: Wed, 12 Aug 2026 15:50:28 +0200 [thread overview]
Message-ID: <DKN0I9BUB6PD.3V0CQ1YVMPXDN@bootlin.com> (raw)
In-Reply-To: <20260812130655.15109-1-anis.bougrine10@gmail.com>
Hi,
On Wed Aug 12, 2026 at 3:06 PM CEST, Anis Bougrine via lists.openembedded.org wrote:
> Currently, signed kernel modules skip the stripping process in order
> to preserve the file contents after signing. See commit:
> 4c47e5f171fa2603355e2f9183065ce8137a18c7
>
> However, the kernel install Makefile supports stripping modules before
> signing them. This allows signed modules to be stripped while preserving
> a valid signature.
>
> Make non-signed kernel modules follow the standard Yocto stripping flow,
> while signed kernel modules use the kernel Makefile stripping flow.
>
> Fixes [YOCTO #12927]
>
> Reported-by: ross.burton@arm.com
> Signed-off-by: Anis Bougrine <anis.bougrine10@gmail.com>
> ---
> meta/classes-recipe/kernel.bbclass | 16 +++++++++++++++-
> 1 file changed, 15 insertions(+), 1 deletion(-)
>
> diff --git a/meta/classes-recipe/kernel.bbclass b/meta/classes-recipe/kernel.bbclass
> index a82bdf7ecb..0d8d370e9d 100644
> --- a/meta/classes-recipe/kernel.bbclass
> +++ b/meta/classes-recipe/kernel.bbclass
> @@ -453,7 +453,21 @@ kernel_do_install() {
> #
> unset CFLAGS CPPFLAGS CXXFLAGS LDFLAGS MACHINE
> if (grep -q -i -e '^CONFIG_MODULES=y$' .config); then
> - oe_runmake DEPMOD=echo MODLIB=${D}${nonarch_base_libdir}/modules/${KERNEL_VERSION} INSTALL_FW_PATH=${D}${firmwaredir} modules_install
> + # If the module will be auto-signed, perform stripping before signing.
> + if grep -q '^CONFIG_MODULE_SIG=y$' .config && grep -q '^CONFIG_MODULE_SIG_ALL=y$' .config; then
Suggestion: you can use the kernel's scripts/config utility to get the option
values:
$ ./scripts/config --file ./.config --state MODULE_SIG
y
So that you really see the option value as the kernel sees it.
Antonin
next prev parent reply other threads:[~2026-08-12 13:50 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-08-12 13:06 [OE-core] [PATCH] kernel.bbclass: add strip process for signed kernel modules Anis Bougrine
2026-08-12 13:26 ` Bruce Ashfield
2026-08-12 15:40 ` Bougrine Anis
2026-08-12 13:50 ` Antonin Godard [this message]
2026-08-12 15:46 ` Bougrine Anis
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=DKN0I9BUB6PD.3V0CQ1YVMPXDN@bootlin.com \
--to=antonin.godard@bootlin.com \
--cc=anis.bougrine10@gmail.com \
--cc=openembedded-core@lists.openembedded.org \
--cc=ross.burton@arm.com \
/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