Re: [PATCH v3 14/58] objtool/klp: Add test for newly introduced functions
From: sashiko-bot@kernel.org
Date: 2026-09-14 23:46:20
Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider: - [Medium] selftests/objtool: fragile symbol check matches section names -- commit da3ad59507d5d910ed876f2401fd7f2746140303 Author: Puranjay Mohan [off-list ref] objtool/klp: Add test for newly introduced functions A function added by the patch has no original to correlate against, and still has to be carried into the livepatch or the changed caller ends up referencing something which does not exist.
quoted hunk ↗ jump to hunk
diff --git a/tools/objtool/tests/generic/test-new-function.sh b/tools/objtool/tests/generic/test-new-function.sh new file mode 100755 index 0000000000000..17af18545b7de --- /dev/null +++ b/tools/objtool/tests/generic/test-new-function.sh@@ -0,0 +1,17 @@
[ ... ]
+setup +build_pair new_function.c +run_diff + +assert_patched target +out_symbols | grep -q 'klp_new_helper' || + fail "new function was not carried into the patch"
[Severity: Medium] Will this grep check falsely pass on newer versions of binutils? It seems `grep -q 'klp_new_helper'` matches substrings, and newer versions of binutils print section names (e.g., `.text.klp_new_helper`) in `readelf -s` output. This could cause the test to erroneously pass if the section symbol is present but the actual function symbol is missing. Could this be updated to use the robust `assert_symbol` helper provided by the test framework rather than directly grepping `out_symbols`?
+ +pass "new function carried into the patch with its caller"
-- Sashiko AI review · https://sashiko.dev/#/patchset/20260914230355.3422996-1-song@kernel.org?part=14