lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [day] [month] [year] [list]
Message-ID: <20250817064252.40996-1-ayashbera@gmail.com>
Date: Sun, 17 Aug 2025 12:12:52 +0530
From: Ayash-Bera <ayashbera@...il.com>
To: shuah@...nel.org
Cc: kees@...nel.org,
	luto@...capital.net,
	wad@...omium.org,
	linux-kselftest@...r.kernel.org,
	linux-kernel@...r.kernel.org,
	Ayash-Bera <ayashbera@...il.com>
Subject: [PATCH] selftests/seccomp: improve clarity of test messages and comments

Replace ambiguous language in comments and test descriptions to improve
code readability and make test intentions clearer.

Changes made:
- Make TODO comment more specific about 64-bit vs 32-bit argument
  handling test requirements  
- Clarify comment about task termination during syscall execution
- Replace vague "bad recv()" with specific "invalid recv() with NULL parameter"
- Replace informal "bad flags" with "invalid flags" for consistency

These improvements help maintainers and contributors better understand
the expected test behavior.

Signed-off-by: Ayash Bera <ayashbera@...il.com>

---
 tools/testing/selftests/seccomp/seccomp_bpf.c | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/tools/testing/selftests/seccomp/seccomp_bpf.c b/tools/testing/selftests/seccomp/seccomp_bpf.c
index 61acbd45ffaa..bded07f86a54 100644
--- a/tools/testing/selftests/seccomp/seccomp_bpf.c
+++ b/tools/testing/selftests/seccomp/seccomp_bpf.c
@@ -933,7 +933,7 @@ TEST(KILL_unknown)
 	ASSERT_EQ(SIGSYS, WTERMSIG(status));
 }
 
-/* TODO(wad) add 64-bit versus 32-bit arg tests. */
+/* TODO(wad) add tests for 64-bit versus 32-bit argument handling differences. */
 TEST(arg_out_of_range)
 {
 	struct sock_filter filter[] = {
@@ -3514,7 +3514,7 @@ TEST(user_notification_kill_in_middle)
 	ASSERT_GE(listener, 0);
 
 	/*
-	 * Check that nothing bad happens when we kill the task in the middle
+	 * Check that killing the task in the middle of a syscall does not cause crashes or hangs when we kill the task in the middle
 	 * of a syscall.
 	 */
 	pid = fork();
@@ -3798,7 +3798,7 @@ TEST(user_notification_fault_recv)
 	if (pid == 0)
 		exit(syscall(__NR_getppid) != USER_NOTIF_MAGIC);
 
-	/* Do a bad recv() */
+	/* Test invalid recv() with NULL parameter */
 	EXPECT_EQ(ioctl(listener, SECCOMP_IOCTL_NOTIF_RECV, NULL), -1);
 	EXPECT_EQ(errno, EFAULT);
 
@@ -4169,13 +4169,13 @@ TEST(user_notification_addfd)
 	addfd.id = req.id;
 	addfd.flags = 0x0;
 
-	/* Verify bad newfd_flags cannot be set */
+	/* Verify invalid newfd_flags cannot be set */
 	addfd.newfd_flags = ~O_CLOEXEC;
 	EXPECT_EQ(ioctl(listener, SECCOMP_IOCTL_NOTIF_ADDFD, &addfd), -1);
 	EXPECT_EQ(errno, EINVAL);
 	addfd.newfd_flags = O_CLOEXEC;
 
-	/* Verify bad flags cannot be set */
+	/* Verify invalid flags cannot be set */
 	addfd.flags = 0xff;
 	EXPECT_EQ(ioctl(listener, SECCOMP_IOCTL_NOTIF_ADDFD, &addfd), -1);
 	EXPECT_EQ(errno, EINVAL);
-- 
2.50.1


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ