Skip to contentSkip to conversation

syscalls/ptrace10: Add new regression test

PATCH In review Cyril Hrubis 2 participants 5 messages Sep 4, 2020 – Oct 14, 2020

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 syscalls/ptrace10: Add new regression test

New regression test for a kernel commit:

commit bd14406b78e6daa1ea3c1673bda1ffc9efdeead0

Author: Jiri Olsa <[email protected]>
Date:   Mon Aug 27 11:12:25 2018 +0200

perf/hw_breakpoint: Modify breakpoint even if the new attr has disabled set

CC Andy Lutomirski <[email protected]>
CC Peter Zijlstra <[email protected]>
CC Thomas Gleixner <[email protected]>
CC Alexandre Chartre <[email protected]>

---

This is a follow up for the ptrace08 fixes.

 runtest/syscalls                            |  1 +
 testcases/kernel/syscalls/ptrace/.gitignore |  1 +
 testcases/kernel/syscalls/ptrace/ptrace10.c | 86 +++++++++++++++++++++
 3 files changed, 88 insertions(+)
 create mode 100644 testcases/kernel/syscalls/ptrace/ptrace10.c
runtest/syscalls +1 -0
index 398145f65..163471bcd 100644
@@ -993,6 +993,7 @@ ptrace05 ptrace05
 ptrace07 ptrace07
 ptrace08 ptrace08
 ptrace09 ptrace09
+ptrace10 ptrace10
 
 pwrite01 pwrite01
 pwrite02 pwrite02
testcases/kernel/syscalls/ptrace/.gitignore +1 -0
index 7639e1a9f..7ee3b3c47 100644
@@ -5,3 +5,4 @@
 /ptrace07
 /ptrace08
 /ptrace09
+/ptrace10
testcases/kernel/syscalls/ptrace/ptrace10.c new file +86 -0

86 lines not on this page · raw message

Signature · 1 line
2.26.2
Reviewed-by on v1 1/1
#1 lore raw

Hi,
the code looks good, though it might make sense to simply integrate the check into ptrace08. Just 6 extra lines in the existing test should achieve the same coverage.

It also seems the bug existed long before the CVE 2018-1000199 fix because the test fails on vulnerable kernels as well.

Anyway, if you prefer to keep the patch as is:

Quoted 14 lines · Cyril Hrubis

New regression test for a kernel commit:

commit bd14406b78e6daa1ea3c1673bda1ffc9efdeead0

Author: Jiri Olsa <[email protected]>
Date:   Mon Aug 27 11:12:25 2018 +0200

perf/hw_breakpoint: Modify breakpoint even if the new attr has disabled set

CC Andy Lutomirski <[email protected]>
CC Peter Zijlstra <[email protected]>
CC Thomas Gleixner <[email protected]>
CC Alexandre Chartre <[email protected]>

---

Signature · 7 lines
Martin Doucha   [email protected]
QA Engineer for Software Maintenance
SUSE LINUX, s.r.o.
CORSO IIa
Krizikova 148/34
186 00 Prague 8
Czech Republic
#2 lore raw

Hi!

Quoted 3 lines

the code looks good, though it might make sense to simply integrate the check into ptrace08. Just 6 extra lines in the existing test should achieve the same coverage.

I would like to avoid triggering the "your system may be vunerable" messages on fixed kernel, hence the separate test.

Signature · 2 lines
Cyril Hrubis
[email protected]
#3 lore raw
Quoted 2 lines · Cyril Hrubis

I would like to avoid triggering the "your system may be vunerable" messages on fixed kernel, hence the separate test.

Good point, go ahead with a separate test then.

Signature · 7 lines
Martin Doucha   [email protected]
QA Engineer for Software Maintenance
SUSE LINUX, s.r.o.
CORSO IIa
Krizikova 148/34
186 00 Prague 8
Czech Republic
#4 lore raw

Hi!

Quoted 4 lines
Quoted 2 lines

I would like to avoid triggering the "your system may be vunerable" messages on fixed kernel, hence the separate test.

Good point, go ahead with a separate test then.

Thanks for the review, pushed.

Signature · 2 lines
Cyril Hrubis
[email protected]