From patchwork Tue Jan 9 21:54:06 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Mirsad Todorovac X-Patchwork-Id: 13515413 Received: from domac.alu.hr (domac.alu.unizg.hr [161.53.235.3]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id D73913DB84; Tue, 9 Jan 2024 21:55:05 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=alu.unizg.hr Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=alu.unizg.hr Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=alu.unizg.hr header.i=@alu.unizg.hr header.b="ixUKeS9Y"; dkim=pass (2048-bit key) header.d=alu.unizg.hr header.i=@alu.unizg.hr header.b="UlXXzZ1R" Received: from localhost (localhost [127.0.0.1]) by domac.alu.hr (Postfix) with ESMTP id F367960177; Tue, 9 Jan 2024 22:55:03 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=alu.unizg.hr; s=mail; t=1704837303; bh=gjAe0zsZPSBxzH34pX4YBPhyeK7qeqNr+UXk48KQegA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=ixUKeS9YXiuHGQIsn/6EYiF8boopbExaMio1xW04/eTd4BNooZvhKf4HDHgvEs4CJ iRx/OpviUAZt5bItzQvMAMCk9KfYivvkMYi1GA5cTvQR1tYe2T++0AVPrLF4haGA4Q jLYx2wAPVjbmBqRHy+jS/oAg9z+KvLBT6Zx6DKeZbWNeTeLMB5MpZoxxciMMgSyJsN VC/xsAGZnkaxcLukyRDnG8fVGhczid5PBJooi+8mScGCCojLjMAH/ev07nbwXzW8It JtZwdf5fLVCbGAptg4YD5VUngoF94FvdWeiE3uckLCBWDNFoGOSA+K9VRhK93w1Ph8 lz7mKBvf+H15A== X-Virus-Scanned: Debian amavisd-new at domac.alu.hr Received: from domac.alu.hr ([127.0.0.1]) by localhost (domac.alu.hr [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id q5DVtAp_bDfT; Tue, 9 Jan 2024 22:54:53 +0100 (CET) Received: from defiant.. (unknown [95.168.105.29]) by domac.alu.hr (Postfix) with ESMTPSA id 7F19F60171; Tue, 9 Jan 2024 22:54:53 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=alu.unizg.hr; s=mail; t=1704837293; bh=gjAe0zsZPSBxzH34pX4YBPhyeK7qeqNr+UXk48KQegA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=UlXXzZ1RjHV4azFdumDHAoh0tzIvKCLtlN3eUxqwBLXgVjbd6wMzKGBMSkgWPp5bz /k4RcIpjJg/xWTBjahHC7LZHg7mv8DMBeFjWGmia8TGyiULvUkkWQTLHt3PqtLpzVU u10ECKiY8ImNJQB8NjO5UeHarMY0TLPeLrtxU+04IGhWmb9QU9ip5ycaO9UGMiYC+W k7OvwM3XbNkVUvXVfsyLjoksvgTgfIUbqduhnLBjH3kOhTOI+RZPB/xJTsRnIAjT5y KIrVyiIgoLRIo7A2xaDurdRE6KRXvaI/cDoDZ1qZ80MJU6hM0izPpUs/QKow7Ecf9p 4wudPnfE5bwcw== From: Mirsad Todorovac To: Mirsad Todorovac , linux-kselftest@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Shuah Khan Subject: [PATCH v1 1/2] selftest: breakpoints: fix a minor typo in the format string Date: Tue, 9 Jan 2024 22:54:06 +0100 Message-Id: <20240109215406.18218-2-mirsad.todorovac@alu.unizg.hr> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20240109215406.18218-1-mirsad.todorovac@alu.unizg.hr> References: <20240109215406.18218-1-mirsad.todorovac@alu.unizg.hr> Precedence: bulk X-Mailing-List: linux-kselftest@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 GCC 13.2.0 reported a format string warning: step_after_suspend_test.c: In function ‘run_test’: step_after_suspend_test.c:92:32: warning: too many arguments for format [-Wformat-extra-args] 92 | ksft_print_msg("waitpid() failed: $s\n", strerror(errno)); | ^~~~~~~~~~~~~~~~~~~~~~~~ Fixing the typo $s into %s resolves the issue. Fixes: 3fa72f2c784b5 ("selftests: breakpoints: step_after_suspend_test use ksft_* var arg msg api") Cc: Shuah Khan Cc: linux-kselftest@vger.kernel.org Cc: linux-kernel@vger.kernel.org Signed-off-by: Mirsad Todorovac --- tools/testing/selftests/breakpoints/step_after_suspend_test.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/testing/selftests/breakpoints/step_after_suspend_test.c b/tools/testing/selftests/breakpoints/step_after_suspend_test.c index 2cf6f10ab7c4..b8703c499d28 100644 --- a/tools/testing/selftests/breakpoints/step_after_suspend_test.c +++ b/tools/testing/selftests/breakpoints/step_after_suspend_test.c @@ -89,7 +89,7 @@ int run_test(int cpu) wpid = waitpid(pid, &status, __WALL); if (wpid != pid) { - ksft_print_msg("waitpid() failed: $s\n", strerror(errno)); + ksft_print_msg("waitpid() failed: %s\n", strerror(errno)); return KSFT_FAIL; } if (WIFEXITED(status)) { From patchwork Tue Jan 9 21:54:08 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Mirsad Todorovac X-Patchwork-Id: 13515414 Received: from domac.alu.hr (domac.alu.unizg.hr [161.53.235.3]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 5CC973DB84; Tue, 9 Jan 2024 21:55:16 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=alu.unizg.hr Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=alu.unizg.hr Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=alu.unizg.hr header.i=@alu.unizg.hr header.b="A0iySkjP"; dkim=pass (2048-bit key) header.d=alu.unizg.hr header.i=@alu.unizg.hr header.b="uk3qDy3M" Received: from localhost (localhost [127.0.0.1]) by domac.alu.hr (Postfix) with ESMTP id 6403060177; Tue, 9 Jan 2024 22:55:14 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=alu.unizg.hr; s=mail; t=1704837314; bh=le8QSZjVL3Ipmww56+RTzFLJ8CHP/G7VfB4Ysq97AvA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=A0iySkjPKFxAkx51V/9kvsh7jjUudnQ7yu8dADsNKKsUz/7Srh2v5yV0RNRVCl+Ut KNXHlXrH/2uXfLc0VObiBCO6BqwWrmhDns+lGYft9fVKup4xnYodEfeKeZC80uMNwr bJ1/rAIhb4RdIRl7QsBMVTERfXTaY9vWqSv3sCNukoT4baUFtjVhI9eHK06EMSa3Q9 hN7H61UjgfjMwYRVCVTBBvEXsZpKsoRgrupXD3x+xa67D/qBbvIHGk02OyxlhdeUTQ 53hW2zDPaBt1ijlv41JVvrOBN4PhQI5QNZQ5XqZ9u3nuRzVmo/u/qSHui/7k0nz/T3 StzhcrqpwTcnQ== X-Virus-Scanned: Debian amavisd-new at domac.alu.hr Received: from domac.alu.hr ([127.0.0.1]) by localhost (domac.alu.hr [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 0o-DVXMEr7rM; Tue, 9 Jan 2024 22:55:12 +0100 (CET) Received: from defiant.. (unknown [95.168.105.29]) by domac.alu.hr (Postfix) with ESMTPSA id 83B9960171; Tue, 9 Jan 2024 22:55:11 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=alu.unizg.hr; s=mail; t=1704837312; bh=le8QSZjVL3Ipmww56+RTzFLJ8CHP/G7VfB4Ysq97AvA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=uk3qDy3Mul/GE+9ot0q9Qlxi6ZVfZvULptzxHsqIuGJx5DOCsTPa7QhMg9rwsZaT9 soHQpsSEUaNMdy471V4wvMkvEBcCCsnAfqb9e8fUcdZPN5JHi61PhsthjHi9/r1+oc 1sHm3ydujrxulKgpW+3QN2aOqhKVY+Dhup4zddI06ssARQD+hZQ7oGDlQ8lJmRAVEl sodzvsdTNOvT27ac0mFw0KCr7K5Mgi3ucOH+r4m56NvCMcAEKRVp3p/gIlp5Xu83gW MSu7ZA5eoGEgJeOgNN3Q9J/IOtbFHKhxY8w2R+soU0L0WLZFkilz4OAVHDwzhmnAa4 3AOJHaTW/aDrQ== From: Mirsad Todorovac To: Mirsad Todorovac , linux-kselftest@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Shuah Khan , Paul Elder , Alice Ferrazzi , Greg Kroah-Hartman Subject: [PATCH v1 2/2] selftest: breakpoints: clear the format string warning and secure the output Date: Tue, 9 Jan 2024 22:54:08 +0100 Message-Id: <20240109215406.18218-3-mirsad.todorovac@alu.unizg.hr> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20240109215406.18218-1-mirsad.todorovac@alu.unizg.hr> References: <20240109215406.18218-1-mirsad.todorovac@alu.unizg.hr> Precedence: bulk X-Mailing-List: linux-kselftest@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 GCC 13.2.0 compiler reported the following warning: breakpoint_test.c: In function ‘check_success’: breakpoint_test.c:287:17: warning: format not a string literal and no format arguments [-Wformat-security] 287 | ksft_test_result_pass(msg); | ^~~~~~~~~~~~~~~~~~~~~ breakpoint_test.c:289:17: warning: format not a string literal and no format arguments [-Wformat-security] 289 | ksft_test_result_fail(msg); | ^~~~~~~~~~~~~~~~~~~~~ ksft_*() functions are unprotected against potential spurious format specifiers in msg. Protecting the conversion with "%s\n" format string fixes the warning. Fixes: 748e84b79af01 ("kselftest: breakpoints: convert breakpoint_test to TAP13 output") Cc: Paul Elder Cc: Alice Ferrazzi Cc: Greg Kroah-Hartman Cc: Shuah Khan Cc: linux-kselftest@vger.kernel.org Cc: linux-kernel@vger.kernel.org Signed-off-by: Mirsad Todorovac --- tools/testing/selftests/breakpoints/breakpoint_test.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tools/testing/selftests/breakpoints/breakpoint_test.c b/tools/testing/selftests/breakpoints/breakpoint_test.c index 3266cc9293fe..07249251859b 100644 --- a/tools/testing/selftests/breakpoints/breakpoint_test.c +++ b/tools/testing/selftests/breakpoints/breakpoint_test.c @@ -284,9 +284,9 @@ static void check_success(const char *msg) nr_tests++; if (ret) - ksft_test_result_pass(msg); + ksft_test_result_pass("%s\n", msg); else - ksft_test_result_fail(msg); + ksft_test_result_fail("%s\n", msg); } static void launch_instruction_breakpoints(char *buf, int local, int global)