Skip to content

Commit 507f85f

Browse files
xuyang0410wangli5665
authored andcommitted
syscalls/ptrace08: Add another linux tag
Since "syscall/ptrace08: Simplify the test", on older kernels we check that the POKEUSER to dr7 that enables the breakpoint fails properly after the dr0 has been set to an address in the kernel range. on centos7.8GA, it can expose a failure as below: tst_test.c:1250: TINFO: Timeout per run is 0h 05m 00s tst_kernel.c:79: TINFO: uname.machine=x86_64 kernel is 64bit ptrace08.c:90: TINFO: Trying address 0xffff800000000000 ptrace08.c:120: TPASS: ptrace() breakpoint with kernel addr failed: EINVAL (22) ptrace08.c:129: TINFO: 0xffff800000000000 ptrace08.c:90: TINFO: Trying address 0xffffffffffffffff ptrace08.c:116: TFAIL: ptrace() breakpoint with kernel addr succeeded ptrace08.c:129: TINFO: 0xffffffffffffffff ptrace08.c:90: TINFO: Trying address 0xffffbfffffffffff ptrace08.c:120: TPASS: ptrace() breakpoint with kernel addr failed: EINVAL (22) ptrace08.c:129: TINFO: 0xffffbfffffffffff It fails because x86 hw_breakpoint code can't parse this 0xffffffffffffffff kernel address on x86_64 platform. arch/x86/kernel/hw_breakpoint.c int arch_check_bp_in_kernelspace(struct perf_event *bp) return (va >= TASK_SIZE) && ((va + len - 1) >= TASK_SIZE); TASK_SIZE is small and value will overflow if we use 0xffffffffffffffff address (va is unsigned long and len is unsigned int). Signed-off-by: Yang Xu <[email protected]> Reviewed-by: Li Wang <[email protected]>
1 parent 1ad945a commit 507f85f

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

testcases/kernel/syscalls/ptrace/ptrace08.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,9 @@
2929
* Date: Mon Mar 26 15:39:07 2018 -1000
3030
*
3131
* perf/hwbp: Simplify the perf-hwbp code, fix documentation
32+
*
33+
* On Centos7, this is also a regression test for
34+
* commit 27747f8bc355 ("perf/x86/hw_breakpoints: Fix check for kernel-space breakpoints").
3235
*/
3336

3437
#include <stdlib.h>
@@ -164,6 +167,7 @@ static struct tst_test test = {
164167
.tags = (const struct tst_tag[]) {
165168
{"linux-git", "f67b15037a7a"},
166169
{"CVE", "2018-1000199"},
170+
{"linux-git", "27747f8bc355"},
167171
{}
168172
}
169173
};

0 commit comments

Comments
 (0)