[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20190708182904.GA12332@altlinux.org>
Date: Mon, 8 Jul 2019 21:29:04 +0300
From: "Dmitry V. Levin" <ldv@...linux.org>
To: Andrew Morton <akpm@...ux-foundation.org>
Cc: Elvira Khabirova <lineprinter@...linux.org>,
Oleg Nesterov <oleg@...hat.com>,
Kees Cook <keescook@...omium.org>,
Andy Lutomirski <luto@...nel.org>,
Eugene Syromyatnikov <esyr@...hat.com>,
Shuah Khan <shuah@...nel.org>,
Stephen Rothwell <sfr@...b.auug.org.au>,
kbuild test robot <lkp@...el.com>,
LKML <linux-kernel@...r.kernel.org>, lkp@...org
Subject: [PATCH] selftests/seccomp/seccomp_bpf: update for
PTRACE_GET_SYSCALL_INFO
The syscall entry/exit is now exposed via PTRACE_GETEVENTMSG,
update the test accordingly.
Reported-by: kernel test robot <rong.a.chen@...el.com>
Signed-off-by: Dmitry V. Levin <ldv@...linux.org>
---
tools/testing/selftests/seccomp/seccomp_bpf.c | 13 +++++++++----
1 file changed, 9 insertions(+), 4 deletions(-)
diff --git a/tools/testing/selftests/seccomp/seccomp_bpf.c b/tools/testing/selftests/seccomp/seccomp_bpf.c
index dc66fe852768..6ef7f16c4cf5 100644
--- a/tools/testing/selftests/seccomp/seccomp_bpf.c
+++ b/tools/testing/selftests/seccomp/seccomp_bpf.c
@@ -1775,13 +1775,18 @@ void tracer_ptrace(struct __test_metadata *_metadata, pid_t tracee,
unsigned long msg;
static bool entry;
- /* Make sure we got an empty message. */
+ /*
+ * The traditional way to tell PTRACE_SYSCALL entry/exit
+ * is by counting.
+ */
+ entry = !entry;
+
+ /* Make sure we got an appropriate message. */
ret = ptrace(PTRACE_GETEVENTMSG, tracee, NULL, &msg);
EXPECT_EQ(0, ret);
- EXPECT_EQ(0, msg);
+ EXPECT_EQ(entry ? PTRACE_EVENTMSG_SYSCALL_ENTRY
+ : PTRACE_EVENTMSG_SYSCALL_EXIT, msg);
- /* The only way to tell PTRACE_SYSCALL entry/exit is by counting. */
- entry = !entry;
if (!entry)
return;
--
ldv
Powered by blists - more mailing lists