From: linuxtestproject.agent@gmail.com
To: dm.chestnykh@gmail.com
Cc: ltp@lists.linux.it
Subject: Re: [LTP] arch_prctl: add ARCH_GET_FS, ARCH_GET_GS tests
Date: Fri, 9 Oct 2026 17:27:49 +0000 [thread overview]
Message-ID: <20261009172749.9075-1-linuxtestproject.agent@gmail.com> (raw)
In-Reply-To: <20261009155224.9042-1-dm.chestnykh@gmail.com>
Hi Dmitry,
On Fri Oct 9 18:52:24 2026 +0300, Dmitry Chestnykh wrote:
> arch_prctl: add ARCH_GET_FS, ARCH_GET_GS tests
> +++ b/testcases/kernel/syscalls/arch_prctl/arch_prctl02.c
> + unsigned long gs = READ_GS_BASE();
> + TST_EXP_EQ_LU(gs_prctl, gs);
The default GS base is zero in ordinary runs, so an always-zero getter
passes; replacing ARCH_GET_GS with a successful zero write reproduced this.
Also exercise a known nonzero 64-bit GS base and restore the original
afterward, without changing the libc-owned FS base.
> + TST_EXP_PASS_SILENT(arch_prctl_get(ARCH_GET_FS, &fs_prctl));
> + if (TST_PASS)
> + TST_EXP_EQ_LU(fs_prctl, fs);
> + else
> + tst_res(TFAIL, "got wrong fs register value");
TST_EXP_PASS_SILENT() already reports syscall failures; injecting EINVAL
for both getters produces four failures for two calls. Remove both else
branches: they duplicate the failures and claim value mismatches without
comparing either value.
> +static void run(unsigned int index)
> +{
> + (void)index;
> + .test = run,
> + .tcnt = 1,
Represent FS and GS as two tcases entries and use
.tcnt = ARRAY_SIZE(tcases), with the index selecting the opcode and
corresponding register read instead of duplicating both cases in run(0).
> + unsigned long v = 0;
> + unsigned long long __res; \
Use a tab for v's indentation; checkpatch reports a warning here.
Rename __res to a non-reserved identifier in both register-reading macros.
> +/*\
> + * Simple test on arch_prctl to get FS_BASE and GS_BASE
> + */
Use the :manpage:`arch_prctl(2)` role and describe the actual assertion:
``ARCH_GET_FS`` and ``ARCH_GET_GS`` return the bases read independently
by RDFSBASE and RDGSBASE.
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
next prev parent reply other threads:[~2026-10-09 17:28 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-10-08 19:47 [LTP] [PATCH] arch_prctl: add ARCH_GET_FS, ARCH_GET_GS tests dm.chestnykh
2026-10-09 10:12 ` [LTP] " linuxtestproject.agent
2026-10-09 15:52 ` [LTP] [PATCH v2] " dm.chestnykh
2026-10-09 17:27 ` linuxtestproject.agent [this message]
2026-10-09 18:35 ` [LTP] [PATCH v3] " dm.chestnykh
2026-10-09 18:39 ` [LTP] [PATCH v4] " dm.chestnykh
2026-10-09 22:23 ` [LTP] " linuxtestproject.agent
2026-10-10 6:38 ` [LTP] [PATCH v5] " dm.chestnykh
2026-10-10 6:42 ` [LTP] [PATCH v6] " dm.chestnykh
2026-10-10 9:35 ` [LTP] " linuxtestproject.agent
2026-10-10 9:44 ` [LTP] [PATCH v7] " dm.chestnykh
2026-10-10 15:49 ` [LTP] " linuxtestproject.agent
2026-10-10 9:35 ` linuxtestproject.agent
2026-10-09 22:23 ` linuxtestproject.agent
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=20261009172749.9075-1-linuxtestproject.agent@gmail.com \
--to=linuxtestproject.agent@gmail.com \
--cc=dm.chestnykh@gmail.com \
--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 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.