scripts/pahole-flags.sh change return to exit 0
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
linux (Ubuntu) |
Fix Released
|
Undecided
|
Unassigned | ||
Jammy |
Fix Released
|
Medium
|
Matthew Ruffell | ||
linux-bluefield (Ubuntu) |
Triaged
|
Undecided
|
Unassigned | ||
Jammy |
Fix Committed
|
Medium
|
Matthew Ruffell |
Bug Description
BugLink: https:/
[Impact]
When building the Jammy linux-bluefield kernel tree on a system without pahole installed, the following warning is emitted:
./scripts/
scripts/
The fix is straightforward, changing return to an exit 0.
--- a/scripts/
+++ b/scripts/
@@ -4,7 +4,7 @@
extra_paholeopt=
if ! [ -x "$(command -v ${PAHOLE})" ]; then
- return
+ exit 0
fi
[Testcase]
Clone the linux-bluefield kernel tree and build it on a arm64 system without
pahole installed.
A test kernel is available with the fix applied in:
https:/
Both linux-bluefield and ubuntu-jammy build correctly.
[Fix]
This was fixed by Linus Torvalds in the following merge commit:
commit fc02cb2b37fe2cb
Merge: bfc484fe6abb 84882cf72cd7
Author: Linus Torvalds <email address hidden>
Date: Tue Nov 2 06:20:58 2021 -0700
Subject: Merge tag 'net-next-for-5.16' of git://git.
Link: https:/
Note, the original commit does not have the fix included:
commit 9741e07ece7c247
Author: Jiri Olsa <email address hidden>
Date: Fri Oct 29 14:57:29 2021 +0200
Subject: kbuild: Unify options for BTF generation for vmlinux and modules
Link: https:/
The Ubuntu kernel cherry-picked the original commit and did not pick up the
silent fix made in the merge commit. Submitting the silent fix as a SAUCE patch
with changelog describing the change.
Note: I know SAUCE patches are bad, but in this scenario, to revert the initial commit and re-apply the fixed version would require us to revert two additional dependency commits, making six patches to review, vs, a one line change in a SAUCE commit that has a real changelog entry.
[Where problems could occur]
The Ubuntu kernel is built with pahole enabled, and requires pahole to be installed as a build dependency. It is extremely unlikely that any users are disabling pahole at build time, apart from linux-bluefield engineers.
If a regression were to occur, engineers would see errors during build time about scripts/
[Other info]
Linus remarked about the issue in the following lkml discussion:
https:/
https:/
This was silently Incorporated into the linux-stable commit:
commit 0baced0e0938f28
From: Jiri Olsa <email address hidden>
Date: Sun, 4 Sep 2022 15:19:00 +0200
Subject: kbuild: Unify options for BTF generation for vmlinux and modules
Link: https:/
Changed in linux (Ubuntu Jammy): | |
status: | New → Triaged |
Changed in linux-bluefield (Ubuntu Jammy): | |
status: | New → Triaged |
summary: |
- scripts/pahole-flags.sh needs upstream fix + scripts/pahole-flags.sh change return to exit 0 |
description: | updated |
Changed in linux (Ubuntu): | |
status: | Incomplete → Fix Released |
Changed in linux (Ubuntu Jammy): | |
status: | Triaged → In Progress |
Changed in linux-bluefield (Ubuntu Jammy): | |
status: | Triaged → In Progress |
Changed in linux (Ubuntu Jammy): | |
importance: | Undecided → Medium |
Changed in linux-bluefield (Ubuntu Jammy): | |
importance: | Undecided → Medium |
Changed in linux (Ubuntu Jammy): | |
assignee: | nobody → Matthew Ruffell (mruffell) |
Changed in linux-bluefield (Ubuntu Jammy): | |
assignee: | nobody → Matthew Ruffell (mruffell) |
description: | updated |
Changed in linux-bluefield (Ubuntu Jammy): | |
status: | In Progress → Fix Committed |
Changed in linux (Ubuntu Jammy): | |
status: | In Progress → Fix Committed |
It appears that Linus applied a fix for this directly in a merge commit: /github. com/torvalds/ linux/commits/ fc02cb2b37fe2cb f1d3334b9f0f0ea b9431766c4
https:/
When the change with this bug was backported to stable, the fix was squashed. But we appear to have cherry-picked the version from mainline instead of the one from stable which had the bug.