[PATCH] tests: clone3 might return EBADF with invalid cgroup

Dmitry V. Levin ldv at altlinux.org
Sun Jun 7 23:39:02 UTC 2020


On Sun, Jun 07, 2020 at 07:35:45PM +0200, Sven Schnelle wrote:
> Both on s390 and x86 linux-5.7 return EBADF when an
> invalid cgroup is supplied, so add that to the list
> of possible return codes.
> Signed-off-by: Sven Schnelle <svens at stackframe.org>
> ---
>  tests/clone3.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/tests/clone3.c b/tests/clone3.c
> index cbb7a349..c15cb1d3 100644
> --- a/tests/clone3.c
> +++ b/tests/clone3.c
> @@ -413,7 +413,7 @@ main(int argc, char *argv[])
>  	memset(arg, 0, sizeof(*arg));
>  
>  	arg->flags = CLONE_INTO_CGROUP;
> -	rc = do_clone3(arg, sizeof(*arg), ERR(0) | ERR(EINVAL));
> +	rc = do_clone3(arg, sizeof(*arg), ERR(0) | ERR(EINVAL) | ERR(EBADF));
>  	print_clone3(arg, rc, sizeof(*arg), STRUCT_VALID,
>  		     "CLONE_INTO_CGROUP", "0");
>  	printf(", %zu) = %s" INJ_STR, sizeof(*arg), sprintrc(rc));

Applied, thanks.


-- 
ldv


More information about the Strace-devel mailing list