From: Ankit Khushwaha <ankitkhushwaha.linux@gmail.com>
To: "David S. Miller" <davem@davemloft.net>,
Eric Dumazet <edumazet@google.com>,
Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>,
Simon Horman <horms@kernel.org>
Cc: Shuah Khan <shuah@kernel.org>,
netdev@vger.kernel.org, linux-kselftest@vger.kernel.org,
linux-kernel@vger.kernel.org,
Ankit Khushwaha <ankitkhushwaha.linux@gmail.com>
Subject: [PATCH] selftests: tls: fix read/write of garbage value
Date: Sat, 29 Nov 2025 12:07:26 +0530 [thread overview]
Message-ID: <20251129063726.31210-1-ankitkhushwaha.linux@gmail.com> (raw)
In 'poll_partial_rec_async' a uninitialized char variable 'token' with
*garbage* value is used for write/read instruction to synchronize
between threads via a pipe.
tls.c:2833:26: warning: variable 'token' is uninitialized
when passed as a const pointer argument here
[-Wuninitialized-const-pointer]
2833 | EXPECT_EQ(write(p[1], &token, 1), 1); /* Barrier #1 */
Initialize 'token' to '\0' to prevent write/read of garbage value.
Signed-off-by: Ankit Khushwaha <ankitkhushwaha.linux@gmail.com>
---
compiler used: clang version 21.1.5 (Fedora 21.1.5-1.fc43).
---
tools/testing/selftests/net/tls.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/tools/testing/selftests/net/tls.c b/tools/testing/selftests/net/tls.c
index a3ef4b57eb5f..a4d16a460fbe 100644
--- a/tools/testing/selftests/net/tls.c
+++ b/tools/testing/selftests/net/tls.c
@@ -2786,10 +2786,10 @@ TEST_F(tls_err, epoll_partial_rec)
TEST_F(tls_err, poll_partial_rec_async)
{
struct pollfd pfd = { };
+ char token = '\0';
ssize_t rec_len;
char rec[256];
char buf[128];
- char token;
int p[2];
int ret;
--
2.52.0
next reply other threads:[~2025-11-29 6:37 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-11-29 6:37 Ankit Khushwaha [this message]
2025-11-29 10:22 ` [PATCH] selftests: tls: fix read/write of garbage value Sabrina Dubroca
2025-11-29 15:40 ` Ankit Khushwaha
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20251129063726.31210-1-ankitkhushwaha.linux@gmail.com \
--to=ankitkhushwaha.linux@gmail.com \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=horms@kernel.org \
--cc=kuba@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-kselftest@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=shuah@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox