From 27698b545cde67aaf947e20f8e6fe00af1b667df Mon Sep 17 00:00:00 2001 From: Shuah Khan Date: Wed, 21 Oct 2026 15:50:15 -0600 Subject: [PATCH 1/3] selftests/filesystems: Fix run_fat_tests hang run_fat_tests script hangs waiting at sudo prompt preventing the kselftest default test to complete when a non-privileged user runs the test. This is incorrect test behavior. Fix it to test for root and skip the test. Link: https://lore.kernel.org/r/20261021215045.26522-1-skhan@linuxfoundation.org Signed-off-by: Shuah Khan --- .../selftests/filesystems/fat/run_fat_tests.sh | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/tools/testing/selftests/filesystems/fat/run_fat_tests.sh b/tools/testing/selftests/filesystems/fat/run_fat_tests.sh index d61264d4795d..0712c8d23fd7 100755 --- a/tools/testing/selftests/filesystems/fat/run_fat_tests.sh +++ b/tools/testing/selftests/filesystems/fat/run_fat_tests.sh @@ -15,6 +15,8 @@ BASE_DIR="$(dirname $0)" TMP_DIR="$(mktemp -d /tmp/fat_tests_tmp.XXXXXX)" IMG_PATH="${TMP_DIR}/fat.img" MNT_PATH="${TMP_DIR}/mnt" +# Kselftest framework requirement - SKIP code is 4. +ksft_skip=4 cleanup() { @@ -23,6 +25,17 @@ cleanup() } trap cleanup SIGINT SIGTERM EXIT +check_prereqs() +{ + local msg="skip all tests:" + local uid=$(id -u) + + if [ $uid -ne 0 ]; then + echo $msg must be run as root >&2 + exit $ksft_skip + fi +} + create_loopback() { touch "${IMG_PATH}" @@ -73,6 +86,7 @@ unmount_image() sudo umount "${MNT_PATH}" &> /dev/null } +check_prereqs create_loopback mount_image rename_exchange_test From 88d5f8cb8a6276194ac8c1de44f3ed77d7e938ce Mon Sep 17 00:00:00 2001 From: Steven Rostedt Date: Thu, 29 Oct 2026 21:12:18 -0400 Subject: [PATCH 2/3] tracing/selftests: Fix false bashism in kprobe_non_uniq_symbol.tc The checkbashism is giving a false positive to the kprobe test of: ($"foo" should be eval_gettext "foo"): if [ "$(grep -c -E "[[:alnum:]]+ t ${SYMBOL}$" /proc/kallsyms)" -le '1' ]; then This is because it sees the $" at the end of the grep as a bash symbol. Instead, escape the '$' with a backslash as it is within quotes and that '$' is for grep to process an end of line character and not a bash variable. Link: https://lore.kernel.org/r/20261029211218.3749963a@fedora Cc: stable@vger.kernel.org Fixes: d22c3e0088e85 ("selftests/ftrace: Fix unique symbol check in kprobe_non_uniq_symbol.tc") Signed-off-by: Steven Rostedt Acked-by: Masami Hiramatsu (Google) Signed-off-by: Shuah Khan --- .../selftests/ftrace/test.d/kprobe/kprobe_non_uniq_symbol.tc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/testing/selftests/ftrace/test.d/kprobe/kprobe_non_uniq_symbol.tc b/tools/testing/selftests/ftrace/test.d/kprobe/kprobe_non_uniq_symbol.tc index 03eb9e70b438..f8e18ea8c268 100644 --- a/tools/testing/selftests/ftrace/test.d/kprobe/kprobe_non_uniq_symbol.tc +++ b/tools/testing/selftests/ftrace/test.d/kprobe/kprobe_non_uniq_symbol.tc @@ -6,7 +6,7 @@ SYMBOL='init_once' # We skip this test on kernel where SYMBOL is unique or does not exist. -if [ "$(grep -c -E "[[:alnum:]]+ t ${SYMBOL}$" /proc/kallsyms)" -le '1' ]; then +if [ "$(grep -c -E "[[:alnum:]]+ t ${SYMBOL}\$" /proc/kallsyms)" -le '1' ]; then exit_unsupported fi From 36990c8fda77d918b1e52d5d6df3a144b552d86e Mon Sep 17 00:00:00 2001 From: Jaewon Jung Date: Wed, 28 Oct 2026 10:18:49 +0900 Subject: [PATCH 3/3] selftests/ftrace: Add missing spaces after ! in probe syntax tests Add the missing space between ! and grep. Otherwise, the shell tries to run !grep and reports "!grep: not found". This always skips the conditional checks without checking for kernel return probe argument support. Link: https://lore.kernel.org/r/20261025075044.1750113-1-jaewon8868@gmail.com Fixes: 25f00e40ce79 ("tracing/probes: Support $argN in return probe (kprobe and fprobe)") Cc: stable@vger.kernel.org Signed-off-by: Jaewon Jung Acked-by: Masami Hiramatsu (Google) Signed-off-by: Shuah Khan --- .../selftests/ftrace/test.d/dynevent/fprobe_syntax_errors.tc | 4 ++-- .../selftests/ftrace/test.d/kprobe/kprobe_syntax_errors.tc | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/tools/testing/selftests/ftrace/test.d/dynevent/fprobe_syntax_errors.tc b/tools/testing/selftests/ftrace/test.d/dynevent/fprobe_syntax_errors.tc index 384209968325..70751573e8de 100644 --- a/tools/testing/selftests/ftrace/test.d/dynevent/fprobe_syntax_errors.tc +++ b/tools/testing/selftests/ftrace/test.d/dynevent/fprobe_syntax_errors.tc @@ -33,7 +33,7 @@ check_error 'f vfs_read ^$stack10000' # BAD_STACK_NUM check_error 'f vfs_read ^$arg10000' # BAD_ARG_NUM -if !grep -q 'kernel return probes support:' README; then +if ! grep -q 'kernel return probes support:' README; then check_error 'f vfs_read $retval ^$arg1' # BAD_VAR fi check_error 'f vfs_read ^$none_var' # BAD_VAR @@ -100,7 +100,7 @@ if grep -q "" README; then check_error 'f vfs_read args=^$arg*' # BAD_VAR_ARGS check_error 'f vfs_read +0(^$arg*)' # BAD_VAR_ARGS check_error 'f vfs_read $arg* ^$arg*' # DOUBLE_ARGS -if !grep -q 'kernel return probes support:' README; then +if ! grep -q 'kernel return probes support:' README; then check_error 'f vfs_read%return ^$arg*' # NOFENTRY_ARGS fi check_error 'f vfs_read ^hoge' # NO_BTFARG diff --git a/tools/testing/selftests/ftrace/test.d/kprobe/kprobe_syntax_errors.tc b/tools/testing/selftests/ftrace/test.d/kprobe/kprobe_syntax_errors.tc index b0e6b80ccb01..06efa67e01ff 100644 --- a/tools/testing/selftests/ftrace/test.d/kprobe/kprobe_syntax_errors.tc +++ b/tools/testing/selftests/ftrace/test.d/kprobe/kprobe_syntax_errors.tc @@ -108,7 +108,7 @@ if grep -q "" README; then check_error 'p vfs_read args=^$arg*' # BAD_VAR_ARGS check_error 'p vfs_read +0(^$arg*)' # BAD_VAR_ARGS check_error 'p vfs_read $arg* ^$arg*' # DOUBLE_ARGS -if !grep -q 'kernel return probes support:' README; then +if ! grep -q 'kernel return probes support:' README; then check_error 'r vfs_read ^$arg*' # NOFENTRY_ARGS fi check_error 'p vfs_read+20 ^$arg*' # NOFENTRY_ARGS