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 22:23:02 +0000 [thread overview]
Message-ID: <20261009222302.8971-1-linuxtestproject.agent@gmail.com> (raw)
In-Reply-To: <20261009183530.3114-1-dm.chestnykh@gmail.com>
Hi Dmitry,
On 2026-10-09, Dmitry Chestnykh wrote:
> arch_prctl: add ARCH_GET_FS, ARCH_GET_GS tests
> diff --git a/testcases/kernel/syscalls/arch_prctl/arch_prctl02.c b/testcases/kernel/syscalls/arch_prctl/arch_prctl02.c
> +static int arch_prctl_get(int code, unsigned long *out)
> +{
> + return tst_syscall(__NR_arch_prctl, code, out);
> +}
High: On x32, unsigned long is four bytes, but these raw GET operations
write eight bytes, overflowing fs_prctl and gs_prctl. Both __x86_64__ and
the framework's x86_64 architecture check admit x32; glibc's x32
arch_prctl wrapper uses a uint64_t temporary, but tst_syscall bypasses it.
Use uint64_t for the output pointer, both output objects, and comparison
values.
> + if (gs == 0) {
> + unsigned long test_gs = 0xabababab;
> + TST_EXP_PASS_SILENT(set_gs(test_gs));
> + if (TST_PASS) {
> + TEST_GS_BASE();
> + }
> + }
Low: GS remains nonzero after the first iteration, so subsequent -i
iterations skip the zero-base comparison and ARCH_SET_GS branch; -i 3
produces seven comparisons rather than repeating all three each time.
Restore the original GS base after the changed-base comparison.
> + unsigned long long __res_fs; \
> + unsigned long long __res_gs; \
> + if (TST_PASS) {
> + TEST_GS_BASE();
> + }
> + unsigned idx;
> +static void run(unsigned index)
Low: check-arch_prctl02 reports missing blank lines after declarations,
unnecessary single-statement braces, an unnecessary blank line before a
closing brace, and bare unsigned declarations; fix these and use unsigned
int. Rename __res_fs and __res_gs to avoid reserved identifiers.
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-10-09 22:23 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 ` [LTP] " linuxtestproject.agent
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 [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=20261009222302.8971-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.