[01/10] seccomp: compel -- Add PTRACE_SECCOMP_GET_METADATA definition

Submitted by Cyrill Gorcunov on May 7, 2018, 8:42 a.m.

Details

Message ID 20180507084250.25191-2-gorcunov@gmail.com
State Accepted
Series "Per-thread seccomp support, v5"
Headers show

Commit Message

Cyrill Gorcunov May 7, 2018, 8:42 a.m.
We will use it to figure out if filter log target is used.
Metadata associated with seccomp filter is relatively new
feature which allows userspace to get and set it back.

Reviewed-by: Dmitry Safonov <0x7f454c46@gmail.com>
Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
---
 compel/include/uapi/ptrace.h | 11 +++++++++++
 1 file changed, 11 insertions(+)

Patch hide | download patch | download mbox

diff --git a/compel/include/uapi/ptrace.h b/compel/include/uapi/ptrace.h
index 7024efef3c27..fcc2d62b08e4 100644
--- a/compel/include/uapi/ptrace.h
+++ b/compel/include/uapi/ptrace.h
@@ -8,6 +8,7 @@ 
  * so there is no way they can be used together. Let's rely on libc one.
  */
 #include <sys/ptrace.h>
+#include <stdint.h>
 
 #include <compel/asm/breakpoints.h>
 
@@ -49,6 +50,16 @@ 
 #define PTRACE_SECCOMP_GET_FILTER	0x420c
 #endif
 
+#ifndef PTRACE_SECCOMP_GET_METADATA
+# define PTRACE_SECCOMP_GET_METADATA	0x420d
+
+struct seccomp_metadata {
+	uint64_t	filter_off;	/* Input: which filter */
+	uint64_t	flags;		/* Output: filter's flags */
+};
+
+#endif /* PTRACE_SECCOMP_GET_METADATA */
+
 #ifdef PTRACE_EVENT_STOP
 # if PTRACE_EVENT_STOP == 7 /* Bad value from Linux 3.1-3.3, fixed in 3.4 */
 #  undef PTRACE_EVENT_STOP