Linux Test Project
 help / color / mirror / Atom feed
From: Avinesh Kumar via ltp <ltp@lists.linux.it>
To: Andrea Cervesato <andrea.cervesato@suse.de>,
	Linux Test Project <ltp@lists.linux.it>
Subject: Re: [LTP] [PATCH] clone11: skip CLONE_NEWCGROUP on kernels < 4.6
Date: Fri, 12 Jun 2026 07:14:47 +0200	[thread overview]
Message-ID: <201c8991-f58e-4f00-abc2-e03633ed3e1b@suse.com> (raw)
In-Reply-To: <20260611-fix_clone11_min_kver-v1-1-264fba2b01b4@suse.com>

Hi,

Reviewed-by: Avinesh Kumar <avinesh.kumar@suse.com>


On 6/11/26 4:03 PM, Andrea Cervesato wrote:
> From: Andrea Cervesato <andrea.cervesato@suse.com>
> 
> CLONE_NEWCGROUP was added in kernel v4.6. On older kernels such as
> v4.4, the flag is unknown and clone() returns EINVAL instead of the
> expected EPERM, causing a spurious test failure.
> 
> Add a per-test-case minimum kernel version check so that the
> CLONE_NEWCGROUP case reports TCONF on kernels older than 4.6.
> 
> Signed-off-by: Andrea Cervesato <andrea.cervesato@suse.com>
> ---
>   testcases/kernel/syscalls/clone/clone11.c | 10 +++++++++-
>   1 file changed, 9 insertions(+), 1 deletion(-)
> 
> diff --git a/testcases/kernel/syscalls/clone/clone11.c b/testcases/kernel/syscalls/clone/clone11.c
> index 028da778158de6867a71ac3974f9c2263481d3a3..607e42585fad41784be9104be01f504218559342 100644
> --- a/testcases/kernel/syscalls/clone/clone11.c
> +++ b/testcases/kernel/syscalls/clone/clone11.c
> @@ -21,9 +21,10 @@ static int *child_pid;
>   static struct tcase {
>   	uint64_t flags;
>   	const char *sflags;
> +	int min_kver[3];
>   } tcases[] = {
>   	{ DESC(CLONE_NEWPID) },
> -	{ DESC(CLONE_NEWCGROUP) },
> +	{ DESC(CLONE_NEWCGROUP), .min_kver = {4, 6, 0} },
>   	{ DESC(CLONE_NEWIPC) },
>   	{ DESC(CLONE_NEWNET) },
>   	{ DESC(CLONE_NEWNS) },
> @@ -40,6 +41,13 @@ static void run(unsigned int n)
>   {
>   	struct tcase *tc = &tcases[n];
>   
> +	if (tc->min_kver[0] &&
> +	    tst_kvercmp(tc->min_kver[0], tc->min_kver[1], tc->min_kver[2]) < 0) {
> +		tst_res(TCONF, "clone(%s) needs kernel %d.%d+",
> +			tc->sflags, tc->min_kver[0], tc->min_kver[1]);
> +		return;
> +	}
> +
>   	TST_EXP_FAIL(ltp_clone(tc->flags, child_fn, NULL, CHILD_STACK_SIZE, child_stack),
>   		EPERM, "clone(%s) should fail with EPERM",
>   		tc->sflags);
> 
> ---
> base-commit: a375e8deed471723f5a0114c56eb48fe6f6f45d3
> change-id: 20260611-fix_clone11_min_kver-394cf499c2c7
> 
> Best regards,

Regards,
Avinesh


-- 
Mailing list info: https://lists.linux.it/listinfo/ltp

  parent reply	other threads:[~2026-06-12  5:15 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-06-11 14:03 [LTP] [PATCH] clone11: skip CLONE_NEWCGROUP on kernels < 4.6 Andrea Cervesato
2026-06-11 14:39 ` [LTP] " linuxtestproject.agent
2026-06-12  5:14 ` Avinesh Kumar via ltp [this message]
2026-06-12  8:31 ` [LTP] [PATCH] " Wei Gao via ltp

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=201c8991-f58e-4f00-abc2-e03633ed3e1b@suse.com \
    --to=ltp@lists.linux.it \
    --cc=andrea.cervesato@suse.de \
    --cc=avinesh.kumar@suse.com \
    /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