From f78cd13442861a753c0a965d502cc1b0c3eb8866 Mon Sep 17 00:00:00 2001 From: Masahiro Yamada Date: Fri, 17 May 2024 14:03:44 +0900 Subject: [PATCH] UBUNTU: SAUCE: disable ptrace/get_set_sud if CONFIG_GENERIC_ENTRY=n BugLink: https://bugs.launchpad.net/ubuntu-kernel-tests/+bug/2044079 The ptrace requests: PTRACE_SET_SYSCALL_USER_DISPATCH_CONFIG PTRACE_GET_SYSCALL_USER_DISPATCH_CONFIG ... are supported only for architectures with CONFIG_GENERIC_ENTRY=y, which are x86, s390, riscv, loongarch as of Linux 6.8. For the other architectures, the ptrace/get_set_sud kselftest always fails. It is tedious to give a hint to every platform. Check /boot/config-$(uname), and if CONFIG_GENERIC_ENTRY=y is not found, let's disable this test. Signed-off-by: Masahiro Yamada --- ubuntu_kernel_selftests/ubuntu_kernel_selftests.py | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/ubuntu_kernel_selftests/ubuntu_kernel_selftests.py b/ubuntu_kernel_selftests/ubuntu_kernel_selftests.py index cd29963ec21d..7a7984ec4e05 100644 --- a/ubuntu_kernel_selftests/ubuntu_kernel_selftests.py +++ b/ubuntu_kernel_selftests/ubuntu_kernel_selftests.py @@ -135,6 +135,17 @@ class ubuntu_kernel_selftests(test.test): cmd = 'sed -i "s/ vmaccess//" ' + mk utils.system(cmd) + # + # Disable ptrace/get_set_sud on architectures without CONFIG_GENERIC_ENTRY + # LP: #2044079 + # + config_file = '/boot/config-{}'.format(platform.uname()[2]) + if os.path.exists(config_file) and not 'CONFIG_GENERIC_ENTRY=y' in open(config_file).read(): + mk = 'linux/tools/testing/selftests/ptrace/Makefile' + if os.path.exists(mk): + cmd = 'sed -i "s/ get_set_sud//" ' + mk + utils.system(cmd) + # # memory hotplug test will fail on arm and several cloud platforms from 5.6+ # as it was enabled in 5.6 but needs memory that does not -- 2.40.1