]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
selftests/seccomp: fix syscall_restart test for arm compat
authorNeill Kapron <nkapron@google.com>
Sun, 27 Apr 2025 09:40:58 +0000 (09:40 +0000)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 27 Jun 2025 10:07:08 +0000 (11:07 +0100)
commitfda0cb6f845e7c535797a968e3e8f9fd42b4fa5e
tree94234196062de211322d26a5d2498c2b88c56d38
parent0dd63f5c04c7246e6a3481e9f622c93e80c45e8a
selftests/seccomp: fix syscall_restart test for arm compat

[ Upstream commit 797002deed03491215a352ace891749b39741b69 ]

The inconsistencies in the systcall ABI between arm and arm-compat can
can cause a failure in the syscall_restart test due to the logic
attempting to work around the differences. The 'machine' field for an
ARM64 device running in compat mode can report 'armv8l' or 'armv8b'
which matches with the string 'arm' when only examining the first three
characters of the string.

This change adds additional validation to the workaround logic to make
sure we only take the arm path when running natively, not in arm-compat.

Fixes: 256d0afb11d6 ("selftests/seccomp: build and pass on arm64")
Signed-off-by: Neill Kapron <nkapron@google.com>
Link: https://lore.kernel.org/r/20250427094103.3488304-2-nkapron@google.com
Signed-off-by: Kees Cook <kees@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
tools/testing/selftests/seccomp/seccomp_bpf.c