From: linuxtestproject.agent@gmail.com
To: Stephen Bertram <sbertram@redhat.com>
Cc: ltp@lists.linux.it
Subject: Re: [LTP] network/sockets: Add handshake01
Date: Wed, 18 Nov 2026 04:51:19 +0000 [thread overview]
Message-ID: <20261118045119.4764-1-linuxtestproject.agent@gmail.com> (raw)
In-Reply-To: <20261117232036.1228445-1-sbertram@redhat.com>
Hi Stephen,
On Tue, Nov 17, 2026, Stephen Bertram <sbertram@redhat.com> wrote:
> network/sockets: Add handshake01
> +static int unprivileged_done(void)
> +{
> + int fds[2], err = 0;
> + pid_t pid;
> +
> + SAFE_PIPE(fds);
> + pid = SAFE_FORK();
> +
> + if (!pid) {
> + int ret;
> +
> + SAFE_CLOSE(fds[0]);
> +
> + SAFE_SETGROUPS(0, NULL);
> + SAFE_SETGID(nobody_gid);
> + SAFE_SETUID(nobody_uid);
> +
> + ret = send_done();
> +
> + SAFE_WRITE(SAFE_WRITE_ALL, fds[1], &ret, sizeof(ret));
> + _exit(0);
> + }
> +
> + SAFE_CLOSE(fds[1]);
> + SAFE_READ(SAFE_READ_ALL, fds[0], &err, sizeof(err));
> + SAFE_CLOSE(fds[0]);
> + SAFE_WAITPID(pid, NULL, 0);
> +
> + return err;
> +}
Call tst_res() directly in the child process and terminate with exit(0)
instead of _exit(0) rather than sending the result over a pipe to the
parent. Drop SAFE_PIPE() and SAFE_WAITPID(), as the LTP library propagates
child results via shared memory and reaps children automatically.
> +static void run(void)
> +{
> + int root_err, child_err;
> +
> + nl_family_id = resolve_family(HANDSHAKE_FAMILY_NAME);
Move nl_family_id = resolve_family(HANDSHAKE_FAMILY_NAME) to setup() so the
static family ID resolution and TCONF check run once instead of on every -i
iteration.
Verdict - Needs revision
---
Note:
The agent can sometimes produce false positives although often its
findings are genuine. If you find issues with the review, please
comment this email or ignore the suggestions.
Regards,
LTP AI Reviewer
--
Mailing list info: https://lists.linux.it/listinfo/ltp
prev parent reply other threads:[~2026-11-18 4:51 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-17 23:20 [LTP] [PATCH v1] network/sockets: Add handshake01 Stephen Bertram via ltp
2026-11-18 4:51 ` linuxtestproject.agent [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=20261118045119.4764-1-linuxtestproject.agent@gmail.com \
--to=linuxtestproject.agent@gmail.com \
--cc=ltp@lists.linux.it \
--cc=sbertram@redhat.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.