[LTP] [PATCH 2/2] syscalls/ptrace08: Add exception for RHEL8 4.18 kernel

Yang Xu xuyang2018.jy@cn.fujitsu.com
Mon Nov 2 12:42:18 CET 2020


RHEL 4.18 kernel got this patch
commit bd14406b78e6d ("perf/hw_breakpoint: Modify breakpoint even if the new attr has disabled set") since 4.18.0-49,

therefore it will return success instead of EINVAL when modifying breakpoint.

Without this fix, the test will fail on RHEL8 4.18 kernel with:
tst_kernel.c:79: TINFO: uname.machine=x86_64 kernel is 64bit
ptrace08.c:90: TINFO: Trying address 0xffff800000000000
ptrace08.c:116: TFAIL: ptrace() breakpoint with kernel addr succeeded
ptrace08.c:90: TINFO: Trying address 0xffffffffffffffff
ptrace08.c:116: TFAIL: ptrace() breakpoint with kernel addr succeeded
ptrace08.c:90: TINFO: Trying address 0xffffbfffffffffff
ptrace08.c:116: TFAIL: ptrace() breakpoint with kernel addr succeeded

Signed-off-by: Yang Xu <xuyang2018.jy@cn.fujitsu.com>
---
 testcases/kernel/syscalls/ptrace/ptrace08.c | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/testcases/kernel/syscalls/ptrace/ptrace08.c b/testcases/kernel/syscalls/ptrace/ptrace08.c
index 63086f1fd..741923e36 100644
--- a/testcases/kernel/syscalls/ptrace/ptrace08.c
+++ b/testcases/kernel/syscalls/ptrace/ptrace08.c
@@ -56,6 +56,11 @@ static pid_t child_pid;
 
 static int deffered_check;
 
+static struct tst_kern_exv kvers[] = {
+	{"RHEL8", "4.18.0-49"},
+	{NULL, NULL},
+};
+
 static void setup(void)
 {
 	/*
@@ -72,7 +77,7 @@ static void setup(void)
 	 * disabled instead and the EINVAL was returned when dr7 was written to
 	 * enable it again.
 	 */
-	if (tst_kvercmp(4, 19, 0) < 0)
+	if (tst_kvercmp2(4, 19, 0, kvers) < 0)
 		deffered_check = 1;
 }
 
-- 
2.23.0





More information about the ltp mailing list