Re: [PATCH v12 23/40] selftests/dyndbg: Enable FT_classmap_inheritance
From: jim.cromie@gmail.com
Date: 2026-10-26 22:28:13
Also in:
dri-devel, linux-kbuild, sashiko-reviews
On Tue, Oct 13, 2026 at 8:37 PM [off-list ref] wrote:
Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider: - [Medium] selftests: regex flaw silently excludes submodule from test assertions -- commit d0e8e8cb940b9b06248942fb57c7a41c66ad8636 Author: Jim Cromie [off-list ref] selftests/dyndbg: Enable FT_classmap_inheritance Exercise classmap state inheritance between supermod and submod, verifying that class settings and controlling parameter states propagate from parent classmap definitions to dependent class users upon module load and during runtime reconfiguration.quoted
diff --git a/tools/testing/selftests/dynamic_debug/dyndbg_selftest.sh b/tools/testing/selftests/dynamic_debug/dyndbg_selftest.sh index c279c795867b6..d759243a4cbe7 100755 --- a/tools/testing/selftests/dynamic_debug/dyndbg_selftest.sh +++ b/tools/testing/selftests/dynamic_debug/dyndbg_selftest.sh[ ... ]quoted
@@ -291,6 +292,78 @@ function FT_basic_queries { ddcmd "file $f =_" "$f" } +function FT_classmap_inheritance {[ ... ]quoted
+ # Real-time mathematical proof that load-time (modprobe) parameter parsing + # and runtime (sysfs write) parameter configurations are perfectly equivalent! + local hash_modprobe=$(slice_and_hash_ddctrl '\[test_dynamic_debug*\]')[Severity: Medium] Does this regex fail to match the sub-module as intended? Looking at FT_classmap_inheritance(), it calls slice_and_hash_ddctrl() which uses grep to filter output. In POSIX Basic Regular Expressions (BRE), the * quantifier matches zero or more occurrences of the preceding character (g). This means the regex matches [test_dynamic_debug] but demands that the bracket ] immediately follows the g's. It completely fails to match [test_dynamic_debug_submod], silently excluding the sub-module from the load-time test assertions.
fixed in v13
quoted
+ + # Fresh load with default parameters, then configure them dynamically at runtime + ifrmmod test_dynamic_debug_submod + ifrmmod test_dynamic_debug + my_modprobe test_dynamic_debug + my_modprobe test_dynamic_debug_submod + echo 0x16 > /sys/module/test_dynamic_debug/parameters/p_disjoint_bits + echo 5 > /sys/module/test_dynamic_debug/parameters/p_level_num + + local hash_sysfs=$(slice_and_hash_ddctrl '\[test_dynamic_debug*\]')[Severity: Medium] Similar to the issue above, does this regex fail to capture the runtime state of the sub-module? This allows the equivalence check between hash_modprobe and hash_sysfs to pass without actually verifying the sub-module inheritance behavior.
yes, now fixed
quoted
+ if [ "$hash_modprobe" != "$hash_sysfs" ]; then + echo -e "${RED}: Load-time vs runtime parameter equivalence check failed!${NC}" + exit $ksft_fail-- Sashiko AI review · https://sashiko.dev/#/patchset/20261012-dd-cmap-part2-clean-v12-0-3c8cc5725def@gmail.com?part=23