Linux-kselftest Archive on lore.kernel.org
 help / color / Atom feed
From: shuah <shuah@kernel.org>
To: Eugene Syromiatnikov <esyr@redhat.com>,
	linux-kernel@vger.kernel.org,
	Christian Brauner <christian@brauner.io>,
	linux-kselftest@vger.kernel.org
Cc: Adrian Reber <areber@redhat.com>, shuah <shuah@kernel.org>
Subject: Re: [PATCH 2/6] selftests/clone3: add a check for invalid exit_signal
Date: Mon, 16 Sep 2019 10:37:15 -0600
Message-ID: <f93052b9-9520-c53a-27dd-b096d3336576@kernel.org> (raw)
In-Reply-To: <f5c715164c87a226afca711559e7ed72a70426a4.1568116761.git.esyr@redhat.com>

On 9/10/19 6:03 AM, Eugene Syromiatnikov wrote:
> Check that the kernel fails calls with exit_signal with non-zero highest
> 32 bits.
> 

Describe what you are testing:

"Add a test case for clone3() non-zero highest 32 bits behavior. It
should fail with exit_signal value??"

Add checks for unsupported cases. Handle unsupported architectures
and configurations with skip

> * tools/testing/selftests/clone3/clone3.c (enum test_mode): Add
> CLONE3_ARGS_BIG_EXIT_SIGNAL.
> (call_clone3): Add args.exit_signal initialisation in case
> test_mode == CLONE3_ARGS_BIG_EXIT_SIGNAL.
> (main): Add test_clone3 clone check with
> test_mode == CLONE3_ARGS_BIG_EXIT_SIGNAL.

Please don't include pseudo code in the commit log.

> 
> Signed-off-by: Eugene Syromiatnikov <esyr@redhat.com>
> ---
>   tools/testing/selftests/clone3/clone3.c | 9 +++++++++
>   1 file changed, 9 insertions(+)
> 
> diff --git a/tools/testing/selftests/clone3/clone3.c b/tools/testing/selftests/clone3/clone3.c
> index 7b65ee5..4f23a0c 100644
> --- a/tools/testing/selftests/clone3/clone3.c
> +++ b/tools/testing/selftests/clone3/clone3.c
> @@ -28,6 +28,7 @@ enum test_mode {
>   	CLONE3_ARGS_NO_TEST,
>   	CLONE3_ARGS_ALL_0,
>   	CLONE3_ARGS_ALL_1,
> +	CLONE3_ARGS_BIG_EXIT_SIGNAL,
>   };
>   
>   static pid_t raw_clone(struct clone_args *args, size_t size)
> @@ -72,6 +73,10 @@ static int call_clone3(int flags, size_t size, enum test_mode test_mode)
>   		args.tls = 1;
>   		args.set_tid = 1;
>   		break;
> +
> +	case CLONE3_ARGS_BIG_EXIT_SIGNAL:
> +		args.exit_signal = 0xbadc0ded00000000;

Please add a comment to indicate what this is. I am assuming
this bad sig val.

> +		break;
>   	}
>   
>   	pid = raw_clone(&args, size);
> @@ -146,6 +151,10 @@ int main(int argc, char *argv[])
>   	/* Do a clone3() with all members set to 1 */
>   	if (test_clone3(0, CLONE3_ARGS_SIZE_V0, -EINVAL, CLONE3_ARGS_ALL_1))
>   		goto on_error;
> +	/* Do a clone3() with exit_signal having highest 32 bits non-zero */
> +	if (test_clone3(0, CLONE3_ARGS_SIZE_V0, -EINVAL,
> +			CLONE3_ARGS_BIG_EXIT_SIGNAL))
> +		goto on_error;
>   	/*
>   	 * Do a clone3() with sizeof(struct clone_args) + 8
>   	 * and all members set to 0.
> 

thanks,
-- Shuah

  reply index

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-09-10 12:02 [PATCH 0/6] Update clone3 self-tests Eugene Syromiatnikov
2019-09-10 12:03 ` [PATCH 1/6] selftests/clone3: convert test modes into an enum Eugene Syromiatnikov
2019-09-16 16:28   ` shuah
2019-09-10 12:03 ` [PATCH 2/6] selftests/clone3: add a check for invalid exit_signal Eugene Syromiatnikov
2019-09-16 16:37   ` shuah [this message]
2019-09-10 12:03 ` [PATCH 3/6] selftests/clone3: use uint64_t for flags parameter Eugene Syromiatnikov
2019-09-16 16:40   ` shuah
2019-09-10 12:03 ` [PATCH 4/6] selftests/clone3: fix up format strings Eugene Syromiatnikov
2019-09-16 16:41   ` shuah
2019-09-10 12:03 ` [PATCH 5/6] selftests/clone3: enable clone3 self-tests on all architectures Eugene Syromiatnikov
2019-09-16 16:44   ` shuah
2019-09-10 12:03 ` [PATCH 6/6] selftests: add clone3 to TARGETS Eugene Syromiatnikov
2019-09-16 16:48   ` shuah

Reply instructions:

You may reply publically 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=f93052b9-9520-c53a-27dd-b096d3336576@kernel.org \
    --to=shuah@kernel.org \
    --cc=areber@redhat.com \
    --cc=christian@brauner.io \
    --cc=esyr@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-kselftest@vger.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

Linux-kselftest Archive on lore.kernel.org

Archives are clonable:
	git clone --mirror https://lore.kernel.org/linux-kselftest/0 linux-kselftest/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 linux-kselftest linux-kselftest/ https://lore.kernel.org/linux-kselftest \
		linux-kselftest@vger.kernel.org linux-kselftest@archiver.kernel.org
	public-inbox-index linux-kselftest

Example config snippet for mirrors

Newsgroup available over NNTP:
	nntp://nntp.lore.kernel.org/org.kernel.vger.linux-kselftest


AGPL code for this site: git clone https://public-inbox.org/ public-inbox