Re: [PATCH] selftests/x86/fsgsbase: Check mmap return value

From: Hongfu Li

Date: Mon Jul 13 2026 - 05:52:54 EST


Hi, longlong

> mmap() in main() returns MAP_FAILED on error, but the return value is
> not checked. Subsequent dereferences of shared_scratch (e.g. in
> test_ptrace_write_gsbase) would segfault. Add a MAP_FAILED check using
> err(), consistent with the rest of the file.
>
> Fixes: 697096b14444 ("selftests/x86/fsgsbase: Fix some test case bugs")
> Signed-off-by: longlong yan <yanlonglong@xxxxxxxxxx>

Thank you for your patch.
I notice that the fix for this issue has already been addressed by my
previous patch [1]. Could you please take a look?

[1] https://lore.kernel.org/all/20260626094646.1292754-1-lihongfu@xxxxxxxxxx/

Best regards,
Hongfu