From: sashiko-bot@kernel.org
To: "Yafang Shao" <laoar.shao@gmail.com>
Cc: bpf@vger.kernel.org
Subject: Re: [PATCH v2] kbuild: rpm-pkg: Preserve .BTF section in kernel modules during debuginfo stripping
Date: Thu, 16 Jul 2026 03:01:16 +0000 [thread overview]
Message-ID: <20260716030116.C613E1F000E9@smtp.kernel.org> (raw)
In-Reply-To: <20260716025342.42628-1-laoar.shao@gmail.com>
Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [Medium] The check for `find-debuginfo.sh` capabilities in `mkspec` hardcodes host properties into `kernel.spec`, breaking SRPM portability across distributions and failing silently when the tool is not in `$PATH`.
--
--- Patch [1]: [PATCH v2] kbuild: rpm-pkg: Preserve .BTF section in kernel modules during debuginfo stripping ---
commit 99202060a54c32638e01a2bfdc4d23b190f3f77c
Author: Yafang Shao <laoar.shao@gmail.com>
kbuild: rpm-pkg: Preserve .BTF section in kernel modules during debuginfo stripping
This commit updates the RPM packaging scripts to pass --keep-section .BTF
to find-debuginfo.sh. This ensures that BTF information is preserved when
debuginfo is stripped from kernel modules.
> diff --git a/scripts/package/mkspec b/scripts/package/mkspec
> index c604f8c174e2c..00acef348ba84 100755
> --- a/scripts/package/mkspec
> +++ b/scripts/package/mkspec
[ ... ]
> @@ -65,6 +65,11 @@ fi
> echo "%define with_debuginfo_manual $with_debuginfo_manual"
> echo "%define with_debuginfo_rpm $with_debuginfo_rpm"
>
> +# Detect if find-debuginfo.sh supports --keep-section (RHEL 9+)
> +if find-debuginfo.sh --help 2>&1 | grep -q keep-section; then
> + echo "%global with_keep_section 1"
> +fi
[Severity: Medium]
Is it safe to assume find-debuginfo.sh is in the standard user $PATH?
On many systems, this script resides in /usr/lib/rpm/, which isn't typically
in the $PATH. This could cause the check to silently fail and strip the .BTF
section during a local make rpm-pkg build.
Also, since mkspec runs during SRPM generation (make srcrpm-pkg), doesn't
this statically bake the generation host's capabilities into the resulting
kernel.spec file?
If the SRPM is rebuilt on an older distribution, rpmbuild might fail because
the older script rejects the --keep-section argument. If generated on an
older host and built on a newer one, BTF info would be silently stripped.
Could we dynamically query the target host's capabilities using something
like %(__find_debuginfo) inside the spec file itself?
--
Sashiko AI review · https://sashiko.dev/#/patchset/20260716025342.42628-1-laoar.shao@gmail.com?part=1
prev parent reply other threads:[~2026-07-16 3:01 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-07-16 2:53 [PATCH v2] kbuild: rpm-pkg: Preserve .BTF section in kernel modules during debuginfo stripping Yafang Shao
2026-07-16 3:01 ` sashiko-bot [this message]
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=20260716030116.C613E1F000E9@smtp.kernel.org \
--to=sashiko-bot@kernel.org \
--cc=bpf@vger.kernel.org \
--cc=laoar.shao@gmail.com \
--cc=sashiko-reviews@lists.linux.dev \
/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