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: 186578 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7300:2411:b0:101:2151:f287 with SMTP id m17csp430131dyi; Tue, 9 Jan 2024 13:55:36 -0800 (PST) X-Google-Smtp-Source: AGHT+IGLCiYgULPH0IYVHS81Ki+nFRN8T2m1IcHNvH8azoV5XcDqC33owDzJOAPXNvl3eaykZFeP X-Received: by 2002:a05:6214:21a6:b0:680:f9a7:a23b with SMTP id t6-20020a05621421a600b00680f9a7a23bmr154321qvc.0.1704837336205; Tue, 09 Jan 2024 13:55:36 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1704837336; cv=none; d=google.com; s=arc-20160816; b=WLNCZq3PWAZju+N6jy315p+t1QMFXed9jmCKiCBa14mEBkP2hzMowRgGMQyc8LAWwx f0LU0O1OhtXJB97i6v5n3cfQMIR7n6dwfYdFgKBPbTp6l0jtx6DXbYfY8ogLNHa0OFd1 O9wFCVBlpQ42t6m3xbcO68TSPCKnp9Popn/ZaqnLq4GPRNr0UdjzFQjlXu5VEVauctay DoB8Exx7yML4XMBsYnavHTRduwLk4MfvfNNdEU+Zft5wrCq+6ccc5nx1oNQqbCx0QRf1 j3METUIXlvqsyo/Hg3862U54J0bhr6i6zLQEF801+JFOHn4DFPOaUn9x0rTikiWMMfoK CE1g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature:dkim-signature; bh=VtNEqlM5Yg59qDMW9NDYE2H0XgJA89Iif8nqP7XT9pA=; fh=6Gw2oiZaYQ8qmn8SXoVTLNP9DLHQS3BWU9rtLhV1Lxk=; b=VXbtLjRX4naIt/1qLHs/yqyaCmUClokTny6lCPqbPz4RX38zL0sAr3Px2G4GwBvnoS QUFN+m3kFZ02UF9yQ6K7Z3ICPkLIc2ehQp1SJUtE93pAqnj0RWFW1SSXPDwVN+g3VHqD ObnVetA4HQk4zUjiyiYd0O6N2kkWNGDBPVYUreU57cq6kBYC8s+j1y8aAS6jDgNvRYuH L+8BlrI8CRglc3O+eYmuRT5ap/zAZETkqJ9Zy5dgzWXgVX6qM4hVT5KyHVkhEDsfGQnq yKdq7+6zV3ktTUheWFFAr7W5haJsPTuaFA3EB7mDdXk9e5zqUKdURMda90iLEkgWrLap mctA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@alu.unizg.hr header.s=mail header.b=A0iySkjP; dkim=pass header.i=@alu.unizg.hr header.s=mail header.b=uk3qDy3M; spf=pass (google.com: domain of linux-kernel+bounces-21453-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-21453-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=alu.unizg.hr Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [147.75.199.223]) by mx.google.com with ESMTPS id a19-20020a0ce353000000b0067f9b223bfbsi3101653qvm.294.2024.01.09.13.55.36 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 09 Jan 2024 13:55:36 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-21453-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) client-ip=147.75.199.223; Authentication-Results: mx.google.com; dkim=pass header.i=@alu.unizg.hr header.s=mail header.b=A0iySkjP; dkim=pass header.i=@alu.unizg.hr header.s=mail header.b=uk3qDy3M; spf=pass (google.com: domain of linux-kernel+bounces-21453-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-21453-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=alu.unizg.hr Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ny.mirrors.kernel.org (Postfix) with ESMTPS id 045761C24954 for ; Tue, 9 Jan 2024 21:55:36 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id DB4D63E46A; Tue, 9 Jan 2024 21:55:20 +0000 (UTC) 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 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 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-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1787651514690084056 X-GMAIL-MSGID: 1787651514690084056 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)