From: Cyril Hrubis <chrubis@suse.cz>
To: Andrea Cervesato <andrea.cervesato@suse.de>
Cc: ltp@lists.linux.it
Subject: Re: [LTP] [PATCH v3 8/8] Add ioctl_pidfd06 test
Date: Wed, 23 Jul 2025 15:08:50 +0200 [thread overview]
Message-ID: <aIDe4n_4kTZE9feR@yuki.lan> (raw)
In-Reply-To: <20250707-ioctl_pidfd_suite-v3-8-22ba4d15ee02@suse.com>
Hi!
> +static void run(void)
> +{
> + int pidfd;
> + pid_t pid_child;
> +
> + memset(args, 0, sizeof(struct tst_clone_args));
> + memset(info, 0, sizeof(struct pidfd_info));
> +
> + info->mask = PIDFD_INFO_EXIT;
> +
> + args->flags = CLONE_PIDFD | CLONE_NEWUSER | CLONE_NEWPID;
> + args->pidfd = (uint64_t)&pidfd;
> + args->exit_signal = SIGCHLD;
> +
> + pid_child = SAFE_CLONE(args);
> + if (!pid_child)
> + exit(100);
> +
> + SAFE_WAITPID(pid_child, NULL, 0);
> +
> + memset(args, 0, sizeof(struct tst_clone_args));
> +
> + args->flags = CLONE_NEWUSER | CLONE_NEWPID;
> + args->exit_signal = SIGCHLD;
> +
> + if (!SAFE_CLONE(args)) {
> + TST_EXP_FAIL(ioctl(pidfd, PIDFD_GET_INFO, info), ESRCH);
> + exit(0);
> + }
SAFE_CLOSE(pid_child) here?
Otherwise we end up out of file descriptors with large enough -i
parameter.
Otherwise:
Reviewed-by: Cyril Hrubis <chrubis@suse.cz>
--
Cyril Hrubis
chrubis@suse.cz
--
Mailing list info: https://lists.linux.it/listinfo/ltp
next prev parent reply other threads:[~2025-07-23 13:08 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-07-07 17:05 [LTP] [PATCH v3 0/8] ioctl_pidfd testing suite Andrea Cervesato
2025-07-07 17:05 ` [LTP] [PATCH v3 1/8] Provide pidfd parameter in tst_clone_args Andrea Cervesato
2025-07-07 17:05 ` [LTP] [PATCH v3 2/8] Fallback PIDFD_GET_INFO related definitions Andrea Cervesato
2025-07-07 17:05 ` [LTP] [PATCH v3 3/8] Add ioctl_pidfd01 test Andrea Cervesato
2025-07-09 9:16 ` Cyril Hrubis
2025-07-07 17:05 ` [LTP] [PATCH v3 4/8] Add ioctl_pidfd02 test Andrea Cervesato
2025-07-09 9:46 ` Cyril Hrubis
2025-07-07 17:05 ` [LTP] [PATCH v3 5/8] Add ioctl_pidfd03 test Andrea Cervesato
2025-07-09 10:22 ` Cyril Hrubis
2025-07-07 17:05 ` [LTP] [PATCH v3 6/8] Add ioctl_pidfd04 test Andrea Cervesato
2025-07-09 10:26 ` Cyril Hrubis
2025-07-07 17:05 ` [LTP] [PATCH v3 7/8] Add ioctl_pidfd05 test Andrea Cervesato
2025-07-09 12:01 ` Cyril Hrubis
2025-07-07 17:05 ` [LTP] [PATCH v3 8/8] Add ioctl_pidfd06 test Andrea Cervesato
2025-07-23 13:08 ` Cyril Hrubis [this message]
2025-07-23 13:59 ` Andrea Cervesato via ltp
2025-07-23 14:03 ` Cyril Hrubis
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=aIDe4n_4kTZE9feR@yuki.lan \
--to=chrubis@suse.cz \
--cc=andrea.cervesato@suse.de \
--cc=ltp@lists.linux.it \
/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