[LTP] arch_prctl: add ARCH_GET_FS, ARCH_GET_GS tests

linuxtestproject.agent@gmail.com linuxtestproject.agent@gmail.com
Sat Oct 10 11:35:05 CEST 2026


Hi Dmitry,

On Sat, 10 Oct 2026, 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
> +	if (gs == 0) {
> +		unsigned long long test_gs = 0xabababab;

Medium: Both exercised GS bases fit in 32 bits when the initial base is
zero, so an ARCH_GET_GS implementation that drops the upper 32 bits still
passes. Include a valid base above UINT32_MAX, such as 0x1ababababULL, to
exercise the documented 64-bit result.

> +		set_gs(orig_gs);

Medium: The restoration syscall's return value is discarded. Injecting
EPERM here leaves GS nonzero, but -i 3 exits successfully with seven
passes and silently skips the set/read case in subsequent iterations.
Use TST_EXP_PASS_SILENT(set_gs(orig_gs)) and abort with TBROK on failure.

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


More information about the ltp mailing list