Skip to content

Commit f4a9a98

Browse files
xuyang0410metan-ucw
authored andcommitted
syscalls/ptrace08: Add exception for RHEL8 4.18 kernel
RHEL 4.18 kernel got this patch commit bd14406b78e6d("perf/hw_breakpoint: Modify breakpoint even if the new attrhas disabled set") since 4.18.0-49. Without this fix, this case failed as below on RHEL8: tst_kernel.c:79: TINFO: uname.machine=x86_64 kernel is 64bit ptrace08.c:96: TINFO: Trying address 0xffff800000000000 ptrace08.c:122: TFAIL: ptrace() breakpoint with kernel addr succeeded ptrace08.c:96: TINFO: Trying address 0xffffffffffffffff ptrace08.c:122: TFAIL: ptrace() breakpoint with kernel addr succeeded ptrace08.c:96: TINFO: Trying address 0xffffbfffffffffff ptrace08.c:122: TFAIL: ptrace() breakpoint with kernel addr succeeded Signed-off-by: Yang Xu <[email protected]> Reviewed-by: Cyril Hrubis <[email protected]>
1 parent 1a2bb70 commit f4a9a98

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

testcases/kernel/syscalls/ptrace/ptrace08.c

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,11 @@ static pid_t child_pid;
5656

5757
static int deffered_check;
5858

59+
static struct tst_kern_exv kvers[] = {
60+
{"RHEL8", "4.18.0-49"},
61+
{NULL, NULL},
62+
};
63+
5964
static void setup(void)
6065
{
6166
/*
@@ -70,9 +75,10 @@ static void setup(void)
7075
* The original fix for the kernel haven't rejected the kernel address
7176
* right away when breakpoint was modified from userspace it was
7277
* disabled instead and the EINVAL was returned when dr7 was written to
73-
* enable it again.
78+
* enable it again. On RHEL8, it has introduced the right fix since
79+
* 4.18.0-49.
7480
*/
75-
if (tst_kvercmp(4, 19, 0) < 0)
81+
if (tst_kvercmp2(4, 19, 0, kvers) < 0)
7682
deffered_check = 1;
7783
}
7884

0 commit comments

Comments
 (0)