Linux Kernel Selftest development
 help / color / mirror / Atom feed
From: Kees Cook <kees@kernel.org>
To: Ayash-Bera <ayashbera@gmail.com>
Cc: shuah@kernel.org, luto@amacapital.net, wad@chromium.org,
	linux-kselftest@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] selftests/seccomp: improve clarity of test messages and comments
Date: Mon, 25 Aug 2025 14:22:53 -0700	[thread overview]
Message-ID: <202508251422.2312EDDAAA@keescook> (raw)
In-Reply-To: <20250817064252.40996-1-ayashbera@gmail.com>

On Sun, Aug 17, 2025 at 12:12:52PM +0530, Ayash-Bera wrote:
> Replace ambiguous language in comments and test descriptions to improve
> code readability and make test intentions clearer.

Thanks; these are good clarifications. Can you please use checkpatch.pl
and then wrap the long commit string?

-Kees

> 
> 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@gmail.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
> 

-- 
Kees Cook

      reply	other threads:[~2025-08-25 21:22 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-08-17  6:42 [PATCH] selftests/seccomp: improve clarity of test messages and comments Ayash-Bera
2025-08-25 21:22 ` Kees Cook [this message]

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=202508251422.2312EDDAAA@keescook \
    --to=kees@kernel.org \
    --cc=ayashbera@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-kselftest@vger.kernel.org \
    --cc=luto@amacapital.net \
    --cc=shuah@kernel.org \
    --cc=wad@chromium.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