Received: by 2002:ab2:69cc:0:b0:1f4:be93:e15a with SMTP id n12csp279103lqp; Fri, 12 Apr 2024 18:43:42 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCXCrx5kO9zGGcEg0IScSSEdH/npPJoGTA7Lb3ghEFrOaXpYfEHBI2znJqctJFVSrVHNJiGJ4BJSWJR+ITHwUg86H6awkBhzaF2jcAs68w== X-Google-Smtp-Source: AGHT+IGc6W6GeveJ9HONSFGtRgPgJ9I/d7qmXjt8epyeepPbwn70MpBieC5NI7F/G3nuABYdk5QR X-Received: by 2002:a50:f604:0:b0:56b:d013:a67e with SMTP id c4-20020a50f604000000b0056bd013a67emr3945491edn.18.1712972621964; Fri, 12 Apr 2024 18:43:41 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1712972621; cv=pass; d=google.com; s=arc-20160816; b=s3T+k5VMS4HKBtRqQwHD1CrBiqxnEdY9tp21MF0f03hrzUJmszVLgO7rcaN/BTbaHP BZ3Bu5YGEbbfWy1JcY6kTwTafMXhRuwCQlLHvnU0vjAN+gt830B5g6mbBdOxUqpeM9Fu rKcw9dAMIbpl0XN1nlPJCQ1iJMWcBtrzNXxg3ytH8kpXY70P7aq/z2gglge4Pl2IQLrW cHNmTCCcjMrOkloooT5+PkobMMbp6dB10sOtvI+ep9Lmh+yIPwFlVPIUDdu8Ljq4vI1s Fm3/JZ53fKMQqnzpv46Fv/32J4m6DTcBUUEr0yGm2e60i2D9qeDAvIoS9I4PffXmMPfl W8YA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=reply-to:cc:to:in-reply-to:references:message-id :content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:subject:date:from:dkim-signature; bh=Pf4Wrwy3zhNP8zMo5EK9yBLrbHCtXZxWg2P4DeVKuO4=; fh=mIjzXHw5v7A2Erx58fxNJLY3dKis8KZygbiuspmBmUM=; b=kSEVIGZwkPZh4foOvuR8ZNIwUsLJnGGVjl0DCy3Bmo9fzqFVFsOnbOlgH8ZzoLONfP HUrEeizZfVaJNMfX3AlumFb5/OXZutXOOhER6KFWL9dBYbKygArkr4oBUrPIhGyFEYBt o3n/CZorWiMbNH9UrthwTH2OvYC4B+1IQkYZrgBI/Y8ZYmhtpPzo6GbAigs6xTbNyJVN Oh6nD6Nv2Io8E2NOAnEAuC9zs1FFd1SwK5jlVjMSjaCzO+3ysDYopXvFvIIGlM3orUpd XKU8sZNUZNTuHwKUzFI+dj/I3tEbfd38f67J82K9mKieJmpPrPXjV5Jrzj9WLM6AH5Uu ewNQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=hELGoIfC; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-143495-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-143495-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id h28-20020a50cddc000000b0056e2c60123esi2223314edj.26.2024.04.12.18.43.41 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 12 Apr 2024 18:43:41 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-143495-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) client-ip=147.75.80.249; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=hELGoIfC; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-143495-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-143495-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org 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 am.mirrors.kernel.org (Postfix) with ESMTPS id 614931F232F6 for ; Sat, 13 Apr 2024 01:43:41 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id D91AA18EB1; Sat, 13 Apr 2024 01:43:05 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="hELGoIfC" Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id D6A173233; Sat, 13 Apr 2024 01:43:04 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712972584; cv=none; b=i2CEKFGfCUxI9/N8kx1teQzl1IH4rg1m+AsNX1tdmNog0R8qimHELHaW6Hcn0VuHvWx10zfswmY1M1Ul0uNR/KGVTYMCiXZ9dcpMJ6w2v7+IETya2/MfNu+WkykVsB+oGmDA5I8IA54qBiO+8j2+SuXcoEVIstHbS7J10p4mXZk= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712972584; c=relaxed/simple; bh=1zBOLKB4+pIe6A93dx/WvIB9KUfoduEU9FapuBAIaA0=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=ERYXwfNNY7fElDJusuTBRV0UL1GKTLeLmnQYDSIDdi22VkRoBtzUJIcpYF1tpP6v0BzGYolxuky7bQawidUkdrSPXol6crmcDFXZ3kuUbHr4K3CXED1j3Ex+7sk4vk56qmG5M8N/j9YOjX9yuD0zWWHk8E7si/nOp9qw4s+mlMo= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=hELGoIfC; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPS id 7ABA0C32786; Sat, 13 Apr 2024 01:43:04 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1712972584; bh=1zBOLKB4+pIe6A93dx/WvIB9KUfoduEU9FapuBAIaA0=; h=From:Date:Subject:References:In-Reply-To:To:Cc:Reply-To:From; b=hELGoIfCH87KZzHVRnhTiDXXcXMJ+78K1DT/oWn2ddt9gSZlYsLnYJn0XKiL8o4TG Wbl4+KO9VIVNobzxrd8UU4P2ADNQoXo2wnxIPTNOb6y1ddeFjNtwUpC1fLgV6gve5n bZ+oZ3Ky61tFFgF7f1Jm6WoVXMt99pyXsOYGgrNVYM6ZgnfsWnGXlGYryrIdBXH1ZY WbYa2Lg/6gAj+imJOpLoetyJJUvtntxCUY08KvJpm40h4I6ylGBs1a+4zi8YrC/3hL A6zhCZVGLRizm+w6brBR+cB00oWUcmnY+4c9nfex/AxqZZR6FjRfLkPqhVpwjLLFEu XM1nTDr6e5syA== Received: from aws-us-west-2-korg-lkml-1.web.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.lore.kernel.org (Postfix) with ESMTP id 6EE14C05023; Sat, 13 Apr 2024 01:43:04 +0000 (UTC) From: Dmitry Safonov via B4 Relay Date: Sat, 13 Apr 2024 02:42:55 +0100 Subject: [PATCH net 4/4] selftests/tcp_ao: Printing fixes to confirm with format-security Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 8bit Message-Id: <20240413-tcp-ao-selftests-fixes-v1-4-f9c41c96949d@gmail.com> References: <20240413-tcp-ao-selftests-fixes-v1-0-f9c41c96949d@gmail.com> In-Reply-To: <20240413-tcp-ao-selftests-fixes-v1-0-f9c41c96949d@gmail.com> To: "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Shuah Khan Cc: netdev@vger.kernel.org, linux-kselftest@vger.kernel.org, linux-kernel@vger.kernel.org, Dmitry Safonov <0x7f454c46@gmail.com> X-Mailer: b4 0.12.3 X-Developer-Signature: v=1; a=ed25519-sha256; t=1712972582; l=3422; i=0x7f454c46@gmail.com; s=20240410; h=from:subject:message-id; bh=wxpBb6LXRSkXjmd5ZWPuyM5ay6kCGD4vUjqDQ4vhKHA=; b=RzjpBpFw7UrSJlsSzfmRDK0F7NIVVw+KR068dfVdNt06AMkdy9ah7w7UoWLndoMjzomBVdPa14O0 ZCVN90BLA1GKUznUJw6J2yAK+8RkIyG4lKRpp4CSVb4z9l4mCxIC X-Developer-Key: i=0x7f454c46@gmail.com; a=ed25519; pk=cFSWovqtkx0HrT5O9jFCEC/Cef4DY8a2FPeqP4THeZQ= X-Endpoint-Received: by B4 Relay for 0x7f454c46@gmail.com/20240410 with auth_id=152 X-Original-From: Dmitry Safonov <0x7f454c46@gmail.com> Reply-To: 0x7f454c46@gmail.com From: Dmitry Safonov <0x7f454c46@gmail.com> On my new laptop with packages from nixos-unstable, gcc 12.3.0 produces > lib/setup.c: In function ‘__test_msg’: > lib/setup.c:20:9: error: format not a string literal and no format arguments [-Werror=format-security] > 20 | ksft_print_msg(buf); > | ^~~~~~~~~~~~~~ > lib/setup.c: In function ‘__test_ok’: > lib/setup.c:26:9: error: format not a string literal and no format arguments [-Werror=format-security] > 26 | ksft_test_result_pass(buf); > | ^~~~~~~~~~~~~~~~~~~~~ > lib/setup.c: In function ‘__test_fail’: > lib/setup.c:32:9: error: format not a string literal and no format arguments [-Werror=format-security] > 32 | ksft_test_result_fail(buf); > | ^~~~~~~~~~~~~~~~~~~~~ > lib/setup.c: In function ‘__test_xfail’: > lib/setup.c:38:9: error: format not a string literal and no format arguments [-Werror=format-security] > 38 | ksft_test_result_xfail(buf); > | ^~~~~~~~~~~~~~~~~~~~~~ > lib/setup.c: In function ‘__test_error’: > lib/setup.c:44:9: error: format not a string literal and no format arguments [-Werror=format-security] > 44 | ksft_test_result_error(buf); > | ^~~~~~~~~~~~~~~~~~~~~~ > lib/setup.c: In function ‘__test_skip’: > lib/setup.c:50:9: error: format not a string literal and no format arguments [-Werror=format-security] > 50 | ksft_test_result_skip(buf); > | ^~~~~~~~~~~~~~~~~~~~~ > cc1: some warnings being treated as errors As the buffer was already pre-printed into, print it as a string rather than a format-string. Fixes: cfbab37b3da0 ("selftests/net: Add TCP-AO library") Signed-off-by: Dmitry Safonov <0x7f454c46@gmail.com> --- tools/testing/selftests/net/tcp_ao/lib/setup.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/tools/testing/selftests/net/tcp_ao/lib/setup.c b/tools/testing/selftests/net/tcp_ao/lib/setup.c index 92276f916f2f..e408b9243b2c 100644 --- a/tools/testing/selftests/net/tcp_ao/lib/setup.c +++ b/tools/testing/selftests/net/tcp_ao/lib/setup.c @@ -17,37 +17,37 @@ static pthread_mutex_t ksft_print_lock = PTHREAD_MUTEX_INITIALIZER; void __test_msg(const char *buf) { pthread_mutex_lock(&ksft_print_lock); - ksft_print_msg(buf); + ksft_print_msg("%s", buf); pthread_mutex_unlock(&ksft_print_lock); } void __test_ok(const char *buf) { pthread_mutex_lock(&ksft_print_lock); - ksft_test_result_pass(buf); + ksft_test_result_pass("%s", buf); pthread_mutex_unlock(&ksft_print_lock); } void __test_fail(const char *buf) { pthread_mutex_lock(&ksft_print_lock); - ksft_test_result_fail(buf); + ksft_test_result_fail("%s", buf); pthread_mutex_unlock(&ksft_print_lock); } void __test_xfail(const char *buf) { pthread_mutex_lock(&ksft_print_lock); - ksft_test_result_xfail(buf); + ksft_test_result_xfail("%s", buf); pthread_mutex_unlock(&ksft_print_lock); } void __test_error(const char *buf) { pthread_mutex_lock(&ksft_print_lock); - ksft_test_result_error(buf); + ksft_test_result_error("%s", buf); pthread_mutex_unlock(&ksft_print_lock); } void __test_skip(const char *buf) { pthread_mutex_lock(&ksft_print_lock); - ksft_test_result_skip(buf); + ksft_test_result_skip("%s", buf); pthread_mutex_unlock(&ksft_print_lock); } -- 2.42.0