[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <175673689237.1920.5397597074920572070.tip-bot2@tip-bot2>
Date: Mon, 01 Sep 2025 14:28:12 -0000
From: "tip-bot2 for Nai-Chen Cheng" <tip-bot2@...utronix.de>
To: linux-tip-commits@...r.kernel.org
Cc: "Nai-Chen Cheng" <bleach1827@...il.com>,
Sebastian Andrzej Siewior <bigeasy@...utronix.de>,
"Borislav Petkov (AMD)" <bp@...en8.de>, x86@...nel.org,
linux-kernel@...r.kernel.org
Subject: [tip: locking/futex] selftests/futex: Fix format-security warnings in
futex_priv_hash
The following commit has been merged into the locking/futex branch of tip:
Commit-ID: f8ef9c24029c85cd0328a9c668283017d8c292ad
Gitweb: https://git.kernel.org/tip/f8ef9c24029c85cd0328a9c668283017d8c292ad
Author: Nai-Chen Cheng <bleach1827@...il.com>
AuthorDate: Wed, 27 Aug 2025 15:00:09 +02:00
Committer: Borislav Petkov (AMD) <bp@...en8.de>
CommitterDate: Mon, 01 Sep 2025 16:20:08 +02:00
selftests/futex: Fix format-security warnings in futex_priv_hash
Fix format-security warnings by using proper format strings when passing
message variables to ksft_exit_fail_msg(), ksft_test_result_pass(), and
ksft_test_result_skip() function.
Thus prevent potential security issues and eliminate compiler warnings when
building with -Wformat-security.
Signed-off-by: Nai-Chen Cheng <bleach1827@...il.com>
Signed-off-by: Sebastian Andrzej Siewior <bigeasy@...utronix.de>
Signed-off-by: Borislav Petkov (AMD) <bp@...en8.de>
Link: https://lore.kernel.org/20250827130011.677600-4-bigeasy@linutronix.de
---
tools/testing/selftests/futex/functional/futex_priv_hash.c | 10 +++----
1 file changed, 5 insertions(+), 5 deletions(-)
diff --git a/tools/testing/selftests/futex/functional/futex_priv_hash.c b/tools/testing/selftests/futex/functional/futex_priv_hash.c
index ec032fa..ffd60d0 100644
--- a/tools/testing/selftests/futex/functional/futex_priv_hash.c
+++ b/tools/testing/selftests/futex/functional/futex_priv_hash.c
@@ -192,10 +192,10 @@ int main(int argc, char *argv[])
futex_slots1 = futex_hash_slots_get();
if (futex_slots1 <= 0) {
ksft_print_msg("Current hash buckets: %d\n", futex_slots1);
- ksft_exit_fail_msg(test_msg_auto_create);
+ ksft_exit_fail_msg("%s", test_msg_auto_create);
}
- ksft_test_result_pass(test_msg_auto_create);
+ ksft_test_result_pass("%s", test_msg_auto_create);
online_cpus = sysconf(_SC_NPROCESSORS_ONLN);
ret = pthread_barrier_init(&barrier_main, NULL, MAX_THREADS + 1);
@@ -236,11 +236,11 @@ retry_getslots:
}
ksft_print_msg("Expected increase of hash buckets but got: %d -> %d\n",
futex_slots1, futex_slotsn);
- ksft_exit_fail_msg(test_msg_auto_inc);
+ ksft_exit_fail_msg("%s", test_msg_auto_inc);
}
- ksft_test_result_pass(test_msg_auto_inc);
+ ksft_test_result_pass("%s", test_msg_auto_inc);
} else {
- ksft_test_result_skip(test_msg_auto_inc);
+ ksft_test_result_skip("%s", test_msg_auto_inc);
}
ret = pthread_mutex_unlock(&global_lock);
Powered by blists - more mailing lists